This section has moved to Streaming.
Send a simple prompt
Pass a string ininput for a single-turn request.
The response includes generated text in output_text.
If a guardrail blocks the request, output_text is absent and the output carries a refusal instead; see Guardrails.
X-On-Behalf-Of.
Add instructions
Useinstructions to define behavior before the model sees the user input.
Keep instructions short and specific.
Send structured messages
Use an array of message items ininput when you want explicit roles.
Each message item uses type, role, and content.
Continue a multi-turn exchange
Useprevious_response_id to continue from an earlier response without resending the full history.
conversation.
Stream a response
See Streaming for complete client examples.Tune sampling and length
Sampling fields change how the model picks each token. Length fields cap how much it writes. All of them are optional and sit at the top level of the request, next tomodel and input.
400. In the example, check status: if the model hit the 400-token cap, the response is incomplete rather than completed, and usage.output_tokens stays at or below the cap. Some fields below are gateway extensions. They are not part of the OpenAI Responses API, and whether they reach the model depends on its upstream, the provider API the gateway forwards your request to, which speaks either the Responses format or the Completions format.
Fields marked as gateway extensions are not part of the OpenAI Responses API, so the OpenAI SDK’s types do not know them. Send them with the MKA1 SDK, the CLI, or raw HTTP.
Four more gateway extensions pass provider options through untouched:
chat_template_kwargs (for example {"enable_thinking": false}), prefill_think (a boolean or prefill text), use_cache, and extra_body, an object merged into the upstream request after the gateway strips any auth, base-URL, and header keys from it.
Not every field reaches every model. Fields the gateway drops lists the cases.
Check what a model supports
Not every model accepts every field.GET /api/v1/llm/models/{model_id} returns a capabilities object with four booleans:
Models that are not LLMs (embeddings, images, speech) report
false for all four. The model object also lists input_modalities and output_modalities, the kinds of content the model accepts and produces, such as ["text", "image"].
false for it, the gateway does not reject the request. It drops that one field before calling the model, forwards everything else, and the model uses its own default for that setting. Nothing in the response says the field was dropped: it echoes temperature, top_p, and reasoning exactly as you sent them. Check the model’s capabilities first when the setting matters.
Control reasoning
Reasoning models think before they answer. Thereasoning object sets how much thinking you want and whether you see it:
effort:none,minimal,low,medium,high, orxhigh.summary:auto,concise, ordetailed. Asks the model to return a readable summary of its reasoning.
null. {"effort": "low"} on its own fails validation.
Each key reaches the model only when the model can use it:
effortgoes only to models that reportsupports_reasoning_effort: true. A Completions-format upstream receives it asreasoning_effort.summarygoes only to models that reportsupports_reasoning: trueand whose upstream speaks the Responses format.
ReasoningEffort type does not include none or xhigh; send those with the MKA1 SDK, the CLI, or raw HTTP.
Reasoning shows up in three places:
outputcan contain an item withtype: "reasoning". Itssummaryarray holdssummary_textparts, andcontent(when present) holds the rawreasoning_textparts. Add"reasoning.encrypted_content"toincludeto getencrypted_contentas well.usage.output_tokens_details.reasoning_tokensis the share ofoutput_tokensthe model spent thinking. Reasoning tokens are output tokens, so they count againstmax_output_tokens.- In a stream,
response.reasoning_text.deltaandresponse.reasoning_summary_text.deltaevents typically arrive before theresponse.output_text.deltaevents. The streaming output latency benchmark shows this order on a live model.
effort, read supports_reasoning and supports_reasoning_effort as shown in Check what a model supports. After the call, usage.output_tokens_details.reasoning_tokens shows how much reasoning happened.
When you send model: "auto", the gateway applies the organization’s auto
policy for Responses. The default is a direct model-registry alias. An
organization admin can configure a balanced policy that asks an LLM judge to
choose among eligible models using capability, price, gateway latency,
comparable evals, request requirements, and conversation continuity. Routing
does not change the reasoning.effort you send, but the gateway still drops it
when the chosen model reports supports_reasoning_effort: false. Auto routing explains the policy and its failure and
privacy behavior.
Fields the gateway drops
Each field below passes validation, but the gateway drops it before calling the model in the case listed. A dropped field never fails the request, and nothing in the response says it was dropped. Some cases depend on the model’s upstream, the provider API the gateway forwards your request to.
Because unknown fields are removed silently, a misspelled field name looks accepted but has no effect. If a setting seems to do nothing, compare your request with the API reference.
Pause a background response
A background response can call thesleep tool to wait up to 20 minutes for a webhook or an outside job, and you can wake it early with follow-up input. See background responses.
Next steps
- Review the API overview for authentication and base URL details
- See background responses when you need to offload long-running work and poll or stream for results
- See manage conversations to organize multi-turn exchanges into reusable conversation containers
- See manage agents when you want reusable agent definitions and persisted runs
- See streaming output latency for measured time to first streamed token on the Responses API