Skip to main content
Use the Responses resource when you want the MKA1 API to return text. Start with a plain string for simple prompts. Use message items when you need explicit roles or conversation state. Later sections cover sampling and length limits, reasoning effort, and the request fields the gateway drops. Pausing a background response has its own section in background responses.

Send a simple prompt

Pass a string in input 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.
If you are not acting for an end user, omit X-On-Behalf-Of.

Add instructions

Use instructions to define behavior before the model sees the user input. Keep instructions short and specific.

Send structured messages

Use an array of message items in input when you want explicit roles. Each message item uses type, role, and content.
This pattern is useful when you want the request body to carry the message history directly.

Continue a multi-turn exchange

Use previous_response_id to continue from an earlier response without resending the full history.
If you need a reusable conversation container, create one with the Conversations resource and then pass the conversation ID in conversation.
Note: deleting a conversation does not delete its items. Deleting a response permanently deletes the response and associated data. See the Conversations and Responses pages in the API Reference for the full resource workflow.

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 to model and input.
The gateway validates every value before it calls the model. A value outside its range returns 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"].
If you send a field to a model that reports 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. The reasoning object sets how much thinking you want and whether you see it:
  • effort: none, minimal, low, medium, high, or xhigh.
  • summary: auto, concise, or detailed. Asks the model to return a readable summary of its reasoning.
Both keys must be present whenever you send the object. Set the one you are not using to null. {"effort": "low"} on its own fails validation. Each key reaches the model only when the model can use it:
  • effort goes only to models that report supports_reasoning_effort: true. A Completions-format upstream receives it as reasoning_effort.
  • summary goes only to models that report supports_reasoning: true and whose upstream speaks the Responses format.
The gateway drops a key the model cannot use, and the request still succeeds.
The OpenAI SDK’s 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:
  • output can contain an item with type: "reasoning". Its summary array holds summary_text parts, and content (when present) holds the raw reasoning_text parts. Add "reasoning.encrypted_content" to include to get encrypted_content as well.
  • usage.output_tokens_details.reasoning_tokens is the share of output_tokens the model spent thinking. Reasoning tokens are output tokens, so they count against max_output_tokens.
  • In a stream, response.reasoning_text.delta and response.reasoning_summary_text.delta events typically arrive before the response.output_text.delta events. The streaming output latency benchmark shows this order on a live model.
To know before the call whether a model reasons and whether it accepts 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 the sleep 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