Chat
Create a chat completion
OpenAI-compatible chat completions. Supports:
- Streaming (stream: true, SSE)
- Tool / function calling (tools, tool_choice)
- Structured outputs (response_format)
- Multimodal — send images via content: [{type: "image_url", ...}] (see ChatMessageContentPart schema below). https:// URLs work against every vision-capable model; OrcaRouter's translation layer adapts the content part for each upstream (OpenAI, Anthropic, Google, xAI Grok).
- OrcaRouter fallback chains via extra_body.models.
Use provider-prefixed model names (openai/gpt-4o-mini, anthropic/claude-sonnet-4.6, google/gemini-2.5-flash), plain bare-name aliases when available, or named routers (orcarouter/auto).
post/chat/completions
Request body
Example request
{
"model": "gpt-4o",
"messages": [
{
"content": [
{
"image_url": {
"url": "https://example.com/photo.jpg"
}
}
]
}
],
"extra_body": {
"models": [
"openai/gpt-4o",
"anthropic/claude-haiku-4.5",
"google/gemini-2.5-pro"
]
}
}Response
Successful completion. Streaming responses use SSE (text/event-stream).
Example response
{
"choices": [
{
"message": {
"content": [
{
"image_url": {
"url": "https://example.com/photo.jpg"
}
}
]
}
}
]
}