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", ...}](seeChatMessageContentPartschema 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).
Authorizations
OrcaRouter API keys look like sk-orca-.... Pass them in the
Authorization: Bearer sk-orca-... header.
Body
Model ID. Supports three forms:
- Provider-prefixed (default):
openai/gpt-4o-mini,anthropic/claude-sonnet-4.6,google/gemini-2.5-flash - Plain alias:
gpt-4o-mini(when a bare-name alias is available) - Named router:
orcarouter/{name}(resolves to a model at request time;orcarouter/autois seeded on signup for every account and picks the cheapest live chat model)
"gpt-4o"
"openai/gpt-4o"
"orcarouter/auto"
When true, response is streamed as server-sent events.
Only applies when stream: true.
auto, none, required - Text (default)
- JSON mode
- JSON Schema
0 <= x <= 20 <= x <= 1x >= 1Preferred over max_tokens for reasoning models.
x >= 1For deterministic sampling.
0 <= x <= 20-2 <= x <= 2-2 <= x <= 2For OpenAI reasoning models (o1, o3*, o4*, gpt-5*-pro,
etc.). Anthropic Claude uses the thinking field instead;
Gemini uses provider-specific configuration.
low, medium, high Enable web search on a Chat Completions request. The
Responses API uses tools: [{"type": "web_search"}]
instead. Honored by OpenAI search-preview models, OpenAI
models that accept the modern web_search tool, and
Anthropic models (translated to Anthropic's native
web_search server-tool).
Free-form raw payload forwarded to the upstream's web-search
tool when web_search_options is not expressive enough.
Most users should prefer web_search_options.
OrcaRouter-specific request extensions. Place these under the
extra_body top-level key of your chat completion request.
