Skip to main content
Version: 1.13.0-dev

Chat completion for Cursor

POST 

/v1/cursor/chat/completions

The chat route for Cursor. Set https://<gateway>/v1/cursor as Cursor's "Override OpenAI Base URL". The request runs the same checks, metering and audit as /v1/chat/completions. A key with scopes needs completions:write.

The body can be a Chat Completions body or a Responses API body:

  • A body with a non-empty messages array is a Chat Completions body. Its tools are put in the Chat Completions shape first: a flat function or custom tool is nested, and a flat grammar is wrapped as grammar: {syntax, definition}.
  • Any other body is a Responses API body. Its tools are put in the flat Responses shape, the empty messages and stream_options are removed, and it is read as /v1/responses reads a body. OpenAI and Azure OpenAI are sent it as it came; another provider gets the translation.

Cursor's model-picker variants are read off the model name: a trailing -fast is removed, and a trailing -thinking-minimal, -low, -medium, -high or -xhigh is removed and becomes the reasoning effort. Only this route reads model names this way.

The answer is always in the Chat Completions shape, plain or streamed. stream_options.include_usage asks for the usage chunk on both body kinds.

Request​

Responses​

Chat completion, or an SSE stream of chunks ending with data:[DONE] when stream is true