Skip to content

open to configure openai url path #320

Open
@mattsawyer77

Description

@mattsawyer77

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions