Create Response
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Request
Model IDs accepted by POST /v2/chat/completions and POST /v2/responses:
sarvam-105b— Sarvam flagship chat model.glm5.3— open-source; 1M context, tool calling, visible reasoning.gemma4— open-source; image input, tool calling.deepseekv4-flash— open-source; 1M context, tool calling, reasoning.
GET /v2/models is environment-specific and may omit IDs that completions still accept. A model whose backend has no /v1/responses route fails POST /v2/responses with 502.
A prompt string, or the conversation so far as a list of items. Replay the full list on every request — this endpoint does not store prior turns. Items with role are messages (user, assistant, system, developer). item_reference is 400. Other items (function_call, function_call_output, reasoning, and later protocol types) are forwarded verbatim.
If true, the reply is streamed as named server-sent events. There is no [DONE] sentinel — the stream ends on response.completed, response.incomplete, or response.failed.
Maximum tokens to generate. Omitted when unset — the backend’s own default applies. Greater than the model’s context window is 400. When unset, the admission token check adds nothing for generation.
Sampling temperature between 0 and 2. When unset, defaults to 0.5 if reasoning is present, otherwise 0.2.
Must be false or omitted (omitting is 200 and echoed as false). true is 400 invalid_request_error — nothing created here is retrievable. OpenAI SDKs default this to true, so a default client.responses.create(...) fails.
Function tools are executed (flat shape: type, name, description, parameters, strict). Hosted tools (mcp, web_search, file_search) may 200 and echo on the response but are not run — tool_choice: required with only those types is 400 (needs a function definition). Fireworks sse is 400 (unknown variant). A model without tool calling returns 400.
Forwarded exactly as written: none, auto, required, { "type": "function", "name": "..." }, or another object.
Reasoning config. A reasoning output item with summary[] is returned by default on glm5.3 even when this object is omitted — summary is not required to receive it. effort accepts none, minimal, low, medium, high, xhigh. max is 400 on this route (chat completions do accept max).
Merged into the outbound body. Must not overwrite any modelled field (400). max_tool_calls and prompt are 400 here and in extra_body — not supported by any serving deployment.
System-style instructions. Echoed back on the response object when set.
Nucleus sampling, greater than 0 and at most 1. In-range values are honoured and echoed. 0 and values outside 0–1 currently fail as 503 model_overloaded rather than a clean 400.
Output format. If you send text, format is required (400 when missing). json_object and strict json_schema are honoured on glm5.3 and skip the reasoning item.
Whether the model may emit more than one function call in one turn. Echoed on the response. On live glm5.3, false does not serialize two requested calls into one.
400 invalid_request_error. This endpoint holds no state — replay the conversation in input. OpenAI and Fireworks use this to continue a chat; we do not.
400 invalid_request_error (string or { "id": "..." }). Not a silent no-op — the field is refused.
true is 400 invalid_request_error. This endpoint is synchronous only.
400 invalid_request_error — not supported by any serving deployment, top-level or via extra_body.
Response
Successful response. With stream: true, the body is text/event-stream instead of JSON.
Rewritten to this service’s request id. GET /v2/responses/{id} still 404s — the id is for logs and x-request-id, not retrieval.
Typed output items from the backend — messages, reasoning, function calls, and vendor extras.
Unix timestamp (seconds) when the response was created.
Typically completed, incomplete, or failed. Corrected to incomplete with incomplete_details.reason: max_output_tokens when the caller set max_output_tokens, the backend reported output_tokens >= max_output_tokens, status was completed, and incomplete_details was absent.