-
First of all, many thanks for the wonderful package. I want to add 2 headers in order to transmit to OpenRouter which app is making the connectiion (https://openrouter.ai/docs/api-reference/overview). I had the follwoing:
If I enable gptel-log-level (debug), the headers are not added to the curl request... Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I tested this and the headers are being sent as specified. So I can't reproduce the issue. However that's not going to solve your problem, because the default (lambda () (when-let* ((key (gptel--get-api-key)))
`(("Authorization" . ,(concat "Bearer " key))))) You need to set the header to a function or to an alist (like you do) that includes the bearer key. For easy debugging and access to the payload, run |
Beta Was this translation helpful? Give feedback.
I tested this and the headers are being sent as specified. So I can't reproduce the issue.
However that's not going to solve your problem, because the default
:header
used by the OpenAI backend needs to send the API key as well. Here's the default header:You need to set the header to a function or to an alist (like you do) that includes the bearer key.
For easy debugging and access to the payload, run
(setq gptel-expert-commands t)
, then pick the dry-run option from gptel's menu. In the inspection window that pops up you can copy the Curl command to the clipboard.