Generate a response for the given chat conversation
model to auto for automatic model selection based on criteria like price, latency, or performance.
For more advanced routing — such as conditional routing, A/B testing across variants, and reusable configurations — create a router and reference it via the model field (e.g., inworld/my-router).Your authentication credentials. For Basic authentication, please populate Basic $INWORLD_API_KEY
A list of messages comprising the conversation so far.
If using a router where a prompt is specified, these messages will be appended to the prompt.
If true, partial message deltas will be sent as server-sent events.
Sampling temperature between 0 and 2. Higher values make output more random.
0 <= x <= 2Nucleus sampling parameter. Must be greater than 0.
0 < x <= 1Maximum number of tokens to generate.
x >= 1Maximum number of completion tokens to generate.
x >= 1Penalizes tokens based on presence in the text.
-2 <= x <= 2Penalizes tokens based on frequency in the text.
-2 <= x <= 2Random seed for generation.
Up to 4 sequences where the API will stop generating.
Modifies the likelihood of specified tokens appearing in the completion.
Controls the amount of reasoning effort the model uses. Note: This parameter is provider/model-specific and may not be supported by all models (e.g., OpenAI models do not support this parameter). This will be overridden if extra_body.reasoning is specified.
none, low, minimal, medium, high, xhigh A unique identifier for the end user. When used with a router, the same user will consistently receive the same variant across requests (sticky routing).
Optional parameters for model routing and optimization.
A successful response. Returns either a complete chat completion or streaming chunks.
Unique identifier for the chat completion.
Object type, always 'chat.completion'.
Unix timestamp when the completion was created.
The model that was actually used.
List of chat completion choices.
Token usage statistics.
Routing metadata providing transparency into model selection decisions.