Skip to content

open to configure openai url path #320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mattsawyer77 opened this issue Mar 10, 2025 · 2 comments
Open

open to configure openai url path #320

mattsawyer77 opened this issue Mar 10, 2025 · 2 comments

Comments

@mattsawyer77
Copy link

I'm trying to get this setup to use our internal OpenAI proxy. I first tried the following configuration:

(setq chatgpt-shell-openai-key (getenv "OPENAI_API_KEY"))
(setq chatgpt-shell-model-version "gpt-4o")
(setq chatgpt-shell-api-url-base "https://<redacted>/api")
(setq chatgpt-shell-logging t)

but this resulted in a http 405 error: "Method not allowed". Through some scraping around I found that I have to use a URI with the path /api/chat/completions instead of /api/v1/chat/completions. Perhaps this is something odd/outdated with the way our proxy is setup?

Anyway I tweaked the code in chatgpt-shell-openai-make-model as follows and got this working end-to-end:

;; (path "/v1/chat/completions") ;; not working
(path "/chat/completions") ;; working

I'm no elisp expert, so maybe I am missing something here and making things hard for myself. If not, perhaps it would be good to make the openai url path configurable?

@djr7C4
Copy link
Contributor

djr7C4 commented Mar 10, 2025

I've never used it but I believe there is a variable for setting up a proxy. Did you try that?

@xenodium
Copy link
Owner

Try chatgpt-shell-proxy. More details at #267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants