Skip to navigation

Create Response

View as Markdown

Generate a model reply in the OpenAI Responses format.

Models: sarvam-105b, sarvam-105b-conversations, glm5.3, gemma4, deepseekv4.1-flash-1017, glm5.3-flash, deepseekv4.1-flash-1017-interactive, and, on Provisioned Throughput, deepseekv4-pro, kimi-k3.1-pro, qwen38-27b (ids are case-sensitive).

Each call is independent. Send the full conversation in input every time — nothing is stored for you. Leave out store or set it to false (true returns 400). You cannot load a past response by id (GET /v2/responses/{id} is always 404).

Streaming is optional. Default is a single JSON body (stream omitted or false). Set stream: true only if you want server-sent events.

Reasoning (glm5.3, deepseekv4.1-flash-1017): both support low, high, and max. On glm5.3, reasoning.effort only accepts low or high — omit reasoning / effort for max-level reasoning, since sending the literal string "max" returns 400. On deepseekv4.1-flash-1017, all three values including max work directly. Read the trace from the reasoning item’s content[0].text; summary is filled only when reasoning.summary is set. Reasoning tokens count toward max_output_tokens, which has no default cap — omitting it means unbounded generation.

Other fields are documented below. See the Responses API guide.

Authentication

api-subscription-keystring
API Key authentication via header
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
modelenumRequired

Model IDs accepted by POST /v2/responses (case-sensitive; unknown ids return 404):

  • sarvam-105b — Sarvam flagship model.
  • sarvam-105b-conversations — Sarvam 105B tuned for real-time dialogue.
  • glm5.3 — 1,048,576-token context; reasoning in output as a reasoning item; flat function tools; max request size 10,485,760 bytes.
  • glm5.3-flash — long context, vision (inline base64 images), tools, and reasoning; reasoning.effort accepts low or high only, as on glm5.3.
  • gemma4 — 262,144-token context, vision (inline base64 images), tools, and optional reasoning (reasoning.effort low or high).
  • deepseekv4.1-flash-1017 — long context, vision (inline base64 images), tools, and reasoning.
  • deepseekv4.1-flash-1017-interactive — same capabilities as deepseekv4.1-flash-1017, on a high-throughput deployment (more than 200 output tokens per second).
  • deepseekv4-pro (Provisioned Throughput) — long context, text input, tools, and reasoning (default high).
  • kimi-k3.1-pro (Provisioned Throughput) — long context, image input (inline base64; no video on this route), tools, and reasoning (always on).
  • qwen38-27b (Provisioned Throughput) — 262,144-token context, image input (inline base64), tools, and reasoning (on by default).
inputstring or list of objectsRequired
A prompt string, or the conversation so far as a list of items. Replay the full list on every request because this endpoint does not store prior turns.
streamfalseRequired

Optional. Default false — same as chat completions. Omit or false for one JSON response body. Set true to stream named server-sent events. There is no [DONE] sentinel — the stream ends on response.completed, response.incomplete, or response.failed.

max_output_tokensinteger or nullOptional

Maximum output tokens to generate, including reasoning tokens on reasoning models. If omitted, there is no default cap — generation is unbounded and continues until the model stops on its own or the context window fills. Always set this explicitly in production. Values above the model context window return 400.

temperaturedouble or nullOptional0-2Defaults to 1

Sampling temperature between 0 and 2. Default 1 on glm5.3 when omitted. Output is not bit-reproducible, even at 0.

storeboolean or nullOptional

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.

toolslist of objects or nullOptional

Function tools use the flat Responses shape (type, name, parameters, strict) — the nested chat-completions tool shape is 400. tool_choice: required with no tools returns 400. Function arguments in output are a JSON string (parse before use). Multiple tool calls per turn are supported; use parallel_tool_calls: true or omit (see that field).

tool_choiceenum or object or map from strings to any or nullOptional

Forwarded exactly as written: none, auto, required, { "type": "function", "name": "..." }, or another object.

reasoningobject or nullOptional

Optional reasoning config for glm5.3, glm5.3-flash, gemma4, the DeepSeek models, kimi-k3.1-pro, and qwen38-27b. effort: on glm5.3 and glm5.3-flash, low or high only (the literal string max returns 400; omitting it gives max on glm5.3 and high on glm5.3-flash); on deepseekv4.1-flash-1017, deepseekv4.1-flash-1017-interactive, and deepseekv4-pro, low, high, max, or none (thinking off); on kimi-k3.1-pro, low, medium, high, or max (thinking is always on); on qwen38-27b, none turns thinking off. The trace is in the reasoning item’s content[0].text; summary is filled only when summary is set. Optional summary: auto or detailed.

extra_bodymap from strings to anyOptionalDefaults to {}

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.

instructionsstring or nullOptional

System-style instructions. Echoed back on the response object when set.

top_pdouble or nullOptional<=1Defaults to 0.95

Nucleus sampling. Default 0.95 on glm5.3 when omitted. Must be greater than 0 and at most 1 (0 is rejected on glm5.3).

top_kinteger or nullOptional

Not supported on the Responses route for glm5.3; any value returns 400.

frequency_penaltydouble or nullOptional-2-2

Optional. Range -2 to 2. May be accepted and echoed on Responses without changing model output.

presence_penaltydouble or nullOptional-2-2

Optional. Range -2 to 2. May be accepted and echoed on Responses without changing model output.

textobject or nullOptional

Output format, set in format (text, json_object, or json_schema).

parallel_tool_callsboolean or nullOptional

false limits a turn to a single tool call on every open-weight model. sarvam-105b ignores it on this route.

ninteger or nullOptional

Ignored on this route — Responses always returns one output. Accepted for OpenAI SDK compatibility only; omit or leave at 1.

seedinteger or nullOptional

Ignored on Responses. Accepted for SDK compatibility only.

previous_response_idstring or nullOptional

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.

conversationstring or map from strings to anyOptional

Conversation state is not supported. Omit this field and replay the complete conversation in input.

backgroundboolean or nullOptional

true is 400 invalid_request_error. This endpoint is synchronous only.

max_tool_callsinteger or nullOptional

400 invalid_request_error — not supported by any serving deployment, top-level or via extra_body.

top_logprobsinteger or nullOptional>=0

How many of the most likely tokens to return at each output position, with their log probabilities. Send it with include: ["message.output_text.logprobs"]; without include, output[].content[].logprobs comes back empty. 0 returns no logprobs. Supported on sarvam-105b, glm5.3-flash, deepseekv4.1-flash-1017, deepseekv4.1-flash-1017-interactive, deepseekv4-pro, and qwen38-27b; glm5.3, gemma4, and kimi-k3.1-pro return 400.

includelist of strings or nullOptional

Extra data to add to the response. message.output_text.logprobs returns token log probabilities (use with top_logprobs); reasoning.encrypted_content is accepted. An unknown value returns 400.

Response

idstring

Rewritten to this service’s request id. The id is for logs and x-request-id; responses are not stored for retrieval.

object"response"
modelstring
Rewritten to the public model id the caller asked for.
outputlist of objects

Typed output items from the backend — messages, reasoning, function calls, and vendor extras.

created_atdoubleOptional

Unix timestamp (seconds) when the response was created. Returned as a float (e.g. 1789632469.0), not an integer.

statusstringOptional

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.

incomplete_detailsobject or nullOptional
errorobject or nullOptional
usageobject or nullOptional
temperaturedouble or nullOptional
Echoed back from the request.
top_pdouble or nullOptional
Echoed back from the request.
toolslist of objects or nullOptional
Echoed back from the request.
tool_choiceenum or object or map from strings to any or nullOptional
Echoed back from the request.
instructionsstring or nullOptional
Echoed back from the request when set.
storeboolean or nullOptional

Echoed back from the request. Always false — nothing created by this endpoint is retrievable.

parallel_tool_callsboolean or nullOptional

Echoed from the request as sent — see the request field description for actual enforcement behavior.

max_output_tokensinteger or nullOptional
Echoed back from the request.
service_tierstring or nullOptional

OpenAI-compatible service-tier field, present for schema parity. Observed value: "auto".

backgroundboolean or nullOptional

Echoed back from the request. true is 400 — see the request field.

completed_atdouble or nullOptional

Unix timestamp (seconds, float) when generation finished. null while incomplete or failed.

conversationstring or map from strings to any or nullOptional
Echoed back from the request.
max_tool_callsinteger or nullOptional

Echoed back from the request. Always 400 if set — not supported by any serving deployment.

metadatamap from strings to anyOptional

Not in the documented request schema, but accepted and echoed back. Defaults to {}.

previous_response_idstring or nullOptional

Echoed back from the request. Always 400 if set — this endpoint holds no state.

reasoningobject or nullOptional
Echoed back from the request.
textobject or nullOptional
Echoed back from the request.
presence_penaltydouble or nullOptional

Not in the documented request schema, but accepted and echoed back. Observed default: 0. Behavior on this route is otherwise unverified.

frequency_penaltydouble or nullOptional

Not in the documented request schema, but accepted and echoed back. Observed default: 0. Behavior on this route is otherwise unverified.

promptmap from strings to any or nullOptional

Not in the documented request schema. Accepted and echoed back; behavior otherwise unverified.

prompt_cache_keystring or nullOptional

Not in the documented request schema. Accepted and echoed back; behavior otherwise unverified.

prompt_cache_retentionstring or nullOptional

Not in the documented request schema. Accepted and echoed back; behavior otherwise unverified.

safety_identifierstring or nullOptional

Not in the documented request schema. Accepted and echoed back; behavior otherwise unverified.

top_logprobsinteger or nullOptional

Not in the documented request schema. Accepted and echoed back. Observed default: 0; behavior otherwise unverified.

truncationstring or nullOptional

Not in the documented request schema. Accepted and echoed back. Observed default: "disabled"; behavior otherwise unverified.

userstring or nullOptional

Not in the documented request schema. Accepted and echoed back; behavior otherwise unverified.

billingmap from strings to any or nullOptional

Reserved — always observed as null in testing. Shape not yet defined; do not rely on this field.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
413
Content Too Large Error
429
Too Many Requests Error
502
Bad Gateway Error
503
Service Unavailable Error