Chat Completions
Generate conversational responses using a structured message format with roles (system, user, assistant, developer, tool). Best for chatbots, assistants, and multi-turn conversations.
gemma-4-31b Dedicated deployments, set image_url.detail on each image to control its image token budget. Supported values are low, medium, high, auto (default), and original. Defaults and limits depend on the deployment. See Image token budgets for availability, mappings, and examples.Authorizations
Headers
Body
The model or endpoint ID to use for generating a response. For Shared Inference, use a model ID from the model catalog. For Dedicated Inference, use the endpoint ID assigned to your organization.
Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
Configuration for a Predicted Output, which can greatly speed up response times when large parts of the model response are known in advance. Most common when regenerating a file with mostly minor changes. Available by request on dedicated endpoints. Predicted Outputs are not available for qwen-3.8-27b with Shared Inference or for kimi-k2.7-code.
An opaque identifier that groups related requests so they reuse the
same prompt cache. Requests sharing
the same prompt_cache_key are routed together, which increases
cache hits and reduces time to first token.
Set it to a stable identifier such as a conversation, session, or workflow ID. Prompt caching works automatically when this field is omitted. This field is an optional routing hint and is available for all models.
1024Selects a model-specific reasoning level. Effort levels don't reserve or guarantee an exact reasoning-token budget.
Supported values and defaults vary by model.
For qwen-3.8-27b, high selects the model's native xhigh mode.
For gemma-4-31b, low, medium, and high enable reasoning
equivalently.
The value none disables reasoning for qwen-3.8-27b and
gemma-4-31b. For kimi-k2.7-code, all accepted values, including
none, are ignored and reasoning stays enabled. The other listed
models don't support none.
Reasoning tokens count toward max_completion_tokens and
usage.completion_tokens. See Reasoning
for model-specific examples.
low, medium, high, max, none Selects how the API returns reasoning. Support varies by model.
Setting this field to none doesn't disable reasoning. Use
reasoning_effort to disable reasoning on supported models.
qwen-3.8-27breturns reasoning separately, including whenrawis selected.hiddenisn't supported.kimi-k2.7-codedefaults toparsedand supportsraw.hiddenisn't supported. Do not combinerawwithjson_objectorjson_schemaresponse formats.kimi-k3andkimi-k3.1-prosupportparsedonly. Do not sendraworhidden.zai-glm-5.3-flashandgpt-oss-120bdefault toparsedand supportrawandhidden.gemma-4-31bdoesn't supportraworhidden.
See Reasoning formats for the complete model comparison.
parsed, raw, hidden, none Controls whether historical assistant reasoning is removed from the conversation before prompting the model. Assistant final-answer content is retained.
Not supported for gemma-4-31b, kimi-k2.7-code, kimi-k3, or
kimi-k3.1-pro. Do not send this field for those models.
See Multi-turn reasoning for an example that resends assistant reasoning.
An object that controls the format of the model response.
Setting { "type": "json_schema", ... } enables Structured Outputs, which enforces schema compliance. See Structured Outputs for details.
Setting { "type": "json_object" } enables legacy JSON mode, which ensures the model returns valid JSON but does not enforce a specific schema. To use json_object, include a system or user message specifying the desired format. json_object is not compatible with streaming, so stream must be set to false.
- Text
- JSON Schema
- JSON Object
Controls request prioritization. default uses the request's
standard priority and quota. priority attempts the configured
higher priority and can retry at the standard priority. auto
starts with standard priority and quota, then can fall back to
flex. flex uses the lowest configured priority and separate
flex rate limits.
Service tiers are not available with Shared Inference on the Developer Tier.
Note: This feature is in Private Preview. For access or more information, contact us or reach out to your account representative.
Available options:
priority- Highest priority processing. Requires an endpoint with service-tier support enabled.default- Standard priority processingauto- Automatically uses the highest available service tierflex- Lowest priority processing
See Service Tiers for more information.
priority, default, auto, flex Controls which (if any) tool is called by the model.
none: No tool is called.auto: The model chooses whether to call a tool. This is the default when tools are present.required: Forces a tool call.
A specific tool can be forced by passing an object specifying the function name.
none, auto, required Nucleus sampling parameter between 0 and 1. The model considers only tokens comprising the top top_p probability mass. For example, 0.1 means only tokens comprising the top 10% probability mass are considered. We recommend changing either this value or temperature, but not both.
0 <= x <= 1Response
Successful response
The effective service tier used to process the request. An auto request can return auto or flex, and a priority request can return priority or auto. The field may be omitted or null when the request uses default processing.
priority, default, auto, flex 
