Create chat completion
Creates a model response for the given chat conversation with support for retries, fallbacks, prompts, and variables.
Authorizations
Body
A list of messages comprising the conversation so far.
Developer-provided instructions that the model should follow, regardless of messages sent by the user.
- System message
- Developer message
- User message
- Assistant message
- Tool message
Model ID used to generate the response, like openai/gpt-5.6-sol or anthropic/claude-sonnet-5. The AI Gateway offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the Supported models to browse available models.
Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, xhigh, and max. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1.- All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. - The
gpt-5-promodel defaults to (and only supports)highreasoning effort. xhighis currently only supported forgpt-5.1-codex-max.
Any of "none", "minimal", "low", "medium", "high", "xhigh", "max".
none, minimal, low, medium, high, xhigh, max Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: ["text", "audio"].
text, audio Request-scoped transforms applied to the text exchanged with the model. Supports pii_redaction, which replaces PII with placeholders before the provider sees it and restores the original values in the response, and response_healing, which repairs malformed JSON in non-streaming output.
- PII redaction plugin
- Response healing plugin
- Trace scrubbing plugin
Leverage Orq's intelligent routing capabilities to enhance your AI application with enterprise-grade reliability and observability. Orq provides automatic request management including retries on failures, model fallbacks for high availability, identity-level analytics tracking, conversation threading, and dynamic prompt templating with variable substitution.
Response
Returns a chat completion object, or a streamed sequence of chat completion chunk objects if the request is streamed.
Represents a chat completion response returned by model, based on the provided input.