Initiate Async Chat Stream
Initiate an asynchronous chat completion stream.
This endpoint starts an asynchronous chat completion process that streams
events. Unlike synchronous chat, this endpoint returns immediately
with a message_id that can be used to observe the stream progress.
Key Features:
- Asynchronous Processing: Non-blocking request handling with immediate response
- Stream Observation: Use returned message_id to observe real-time events
- Works exactly like synchronous chat, but in an async manner
Notes:
- Optional message_id query parameter for custom stream identification
- Stream events follow the same format as synchronous chat responses
- Stream status can be monitored via status endpoint
Query parameters
message_id
Optional custom identifier for the stream. If not provided, a unique ID will be generated automatically.
Request
This endpoint expects an object.
model
Model identifier or alias.
messages
Conversation messages for the request.
max_tokens
Maximum number of tokens to generate in the response.
system
System prompt input. Accepts str, list[str], System, list[System], or null. It is normalized internally to list[System].
tools
Optional tool definitions.
thinking
Thinking configuration.
tool_choice
Tool selection policy.
output_config
Optional output configuration options.
cache_control
Optional request-level cache control.
stream
Whether to stream the response back to the client.
tool_context
Context to provide to the tools, such as documents,
databases connection strings, or data relevant to tool usage.
mcp_servers
List of MCP servers to use for tool retrieval. Each server can have its own configuration.
container
Container identifier for reuse across requests.
response_format
Deprecated response format. Use output_config.format instead.
priority
Priority of the request, used for prioritizing responses.
seed
Random seed for reproducibility.
min_p
Minimum probability threshold for token selection. Tokens with probability below this value are filtered out.
top_p
Nucleus sampling parameter. Only tokens with cumulative probability up to this value are considered.
temperature
Controls randomness in generation. Higher values make output more random, lower values more deterministic.
top_k
Limits token selection to the top K most likely tokens at each step.
repetition_penalty
Penalty applied to tokens that have already appeared in the sequence to reduce repetition.
presence_penalty
Penalty applied based on whether a token has appeared in the text, encouraging topic diversity.
frequency_penalty
Penalty applied based on how frequently a token appears in the text, reducing repetitive content.
stop_sequences
Custom stop sequences that stop generation when matched.
metadata
Request metadata (for example, user_id).
service_tier
Service tier preference (for example, “auto” or “standard_only”).
inference_geo
Geographic region hint for inference processing.
correlation_id
Correlation ID for tracking the request across systems.
maximum_loaded_skills
Optional cap for concurrently loaded skills in a conversation. When exceeded, the oldest loaded skill is evicted.
context_management
Response
This endpoint returns an object.
message_id
Unique identifier for the initiated stream
status
Initial status of the stream (typically ‘pending’)
message
Confirmation message for successful stream initiation
Errors
401
Unauthorized
422
Unprocessable Entity

