Skip to content

docs: hosted gptel-make-openai host/endpoint gotchas vs Responses API #1529

Description

@cursor

IF your feature request is related to a problem

gptel-make-openai treats api.openai.com as Responses API (/v1/responses). A hosted Chat Completions host must use a different :host and keep :endpoint "/v1/chat/completions". :host is hostname only (no https://). Easy to paste a full URL and get a bad request.

Describe the solution you'd like

Working backend for a live Chat Completions host (PZERO). Public catalog: GET https://api.pzero.studio/v1/models. Default text id: deepseek-v4-flash. Prepaid Bearer key (pzero_…).

(setq gptel-model 'deepseek-v4-flash
      gptel-backend
      (gptel-make-openai "PZERO"
        :host "api.pzero.studio"
        :protocol "https"
        :endpoint "/v1/chat/completions"
        :stream t
        :key (getenv "PZERO_API_KEY")
        :models '(deepseek-v4-flash)))

Do not set :host "api.openai.com" (that selects Responses). Do not put https:// in :host. Endpoint here is the chat path (gptel concatenates protocol+host+endpoint). That is the opposite of Avante/LiteLLM /v1 roots.

Describe alternatives you've considered

The Groq/Mistral examples in the README already use gptel-make-openai with a custom host. This is that shape with the Responses-dispatch gotcha spelled out.

Additional context

https://github.com/karthink/gptel/blob/master/gptel-openai.el (host matching api.openai.com switches constructor)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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