responses

Cursor Chat Completions

Cursor BYOK endpoint. Accepts both request shapes Cursor sends to its OpenAI-compatible base URL and always answers in chat completions format.

Cursor agent mode sends Responses API format bodies (input, flat tool defs, reasoning, custom tools) to the chat/completions path while expecting chat completions responses; those are routed through the Responses API pipeline and converted back. Genuine chat completions bodies (messages present) are routed through the standard chat completions pipeline, after normalizing each level of the tools array and tool_choice to the chat completions shapes OpenAI requires. Cursor mixes Responses API shapes into chat bodies per level, independently: a flat tool def ({"type": "custom", "name": "ApplyPatch", ...}) gets nested under custom, and a flat grammar format ({"type": "grammar", "definition", "syntax"}) gets wrapped as {"type": "grammar", "grammar": {...}} wherever it appears, including inside tool defs Cursor already sent pre-nested.

curl -X POST http://localhost:4000/cursor/chat/completions     -H "Content-Type: application/json"     -H "Authorization: Bearer sk-1234"     -d '{
    "model": "gpt-4o",
    "input": [{"role": "user", "content": "Hello"}]
}'
Responds back in chat completions format.
post/cursor/chat/completions

Response

Successful Response

{"stackTrail":"paths:/cursor/chat/completions:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}

Changes