Skip to main content
POST
/
chat
/
completions
Create a chat completion
curl --request POST \
  --url https://api.orcarouter.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "messages": [
    {
      "role": "system",
      "content": "<string>",
      "name": "<string>",
      "tool_calls": [
        {
          "id": "<string>",
          "type": "function",
          "function": {
            "name": "<string>",
            "arguments": "<string>"
          }
        }
      ],
      "tool_call_id": "<string>"
    }
  ],
  "stream": true,
  "stream_options": {
    "include_usage": true
  },
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "<string>",
        "description": "<string>",
        "parameters": {},
        "strict": true
      }
    }
  ],
  "tool_choice": "auto",
  "parallel_tool_calls": true,
  "response_format": {
    "type": "text"
  },
  "temperature": 1,
  "top_p": 0.5,
  "max_tokens": 2,
  "max_completion_tokens": 123,
  "n": 1,
  "stop": "<string>",
  "seed": 123,
  "logprobs": true,
  "top_logprobs": 10,
  "presence_penalty": 0,
  "frequency_penalty": 0,
  "logit_bias": {},
  "user": "<string>",
  "reasoning_effort": "low",
  "extra_body": {
    "models": [
      "gpt-4o",
      "claude-3-5-sonnet",
      "gemini-2.5-pro"
    ],
    "route": "fallback"
  }
}
'
{
  "id": "<string>",
  "object": "chat.completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "system",
        "content": "<string>",
        "name": "<string>",
        "tool_calls": [
          {
            "id": "<string>",
            "type": "function",
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            }
          }
        ],
        "tool_call_id": "<string>"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

OrcaRouter API keys look like sk-orca-.... Pass them in the Authorization: Bearer sk-orca-... header.

Body

application/json
model
string
required

Model ID. Supports three forms:

  • Plain: gpt-4o
  • Provider-prefixed: openai/gpt-4o (admin may have configured it this way for OpenRouter-style naming)
  • Named router: orcarouter/{name} (resolves to your configured router; orcarouter/auto is seeded on signup for everyone)
Examples:

"gpt-4o"

"openai/gpt-4o"

"orcarouter/auto"

messages
object[]
required
stream
boolean

When true, response is streamed as server-sent events.

stream_options
object

Only applies when stream: true.

tools
object[]
tool_choice
Available options:
auto,
none,
required
parallel_tool_calls
boolean
default:true
response_format
Text (default) · object
temperature
number
Required range: 0 <= x <= 2
top_p
number
Required range: 0 <= x <= 1
max_tokens
integer
Required range: x >= 1
max_completion_tokens
integer

Preferred over max_tokens for reasoning models.

n
integer
default:1
Required range: x >= 1
stop
seed
integer

For deterministic sampling.

logprobs
boolean
top_logprobs
integer
Required range: 0 <= x <= 20
presence_penalty
number
Required range: -2 <= x <= 2
frequency_penalty
number
Required range: -2 <= x <= 2
logit_bias
object
user
string
reasoning_effort
enum<string>

For reasoning models (o1, Claude thinking, etc.)

Available options:
low,
medium,
high
extra_body
object

OrcaRouter-specific request extensions. Place these under the extra_body top-level key of your chat completion request.

Response

Successful completion. Streaming responses use SSE (text/event-stream).

id
string
object
enum<string>
Available options:
chat.completion
created
integer
model
string
choices
object[]
usage
object