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 text as it is generated
Setstream to true to receive server-sent events instead of waiting for the full response.
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.
top_logprobs is accepted for OpenAI compatibility but the gateway does not forward it to models yet.
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. These four, and the provider-specific rows in the table, reach only providers other than OpenAI; on an upstream at api.openai.com the gateway drops them.
Check what a model supports
Not every model accepts every sampling field.GET /api/v1/llm/models/{model_id} returns a capabilities object with two booleans: supports_temperature and supports_top_p. Models that are not LLMs (embeddings, images, speech) report false for both.
temperature or top_p to a model that reports false, the gateway does not reject the request. It drops that one field before calling the model, forwards everything else, and the response succeeds with the model’s own default sampling. Nothing in the response says the field was dropped, so 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.
Whether summary reaches the model depends on the upstream. A Responses-format upstream gets both keys. A Completions-format upstream gets effort (as reasoning_effort) and the gateway drops summary.
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.
reasoning object before the call, the same way it drops temperature and top_p for models that do not support them. The request still succeeds. The capabilities object above has no reasoning flag, so there is no way to check this ahead of time; usage.output_tokens_details.reasoning_tokens shows afterwards 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. Auto routing explains the policy and its failure and
privacy behavior.
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