Skip to content
Discussion options

You must be logged in to vote

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:

(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 (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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rogorido
Comment options

Answer selected by rogorido
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants