Skip to main content
POST
/
messages
Create a message (Anthropic-compatible)
curl --request POST \
  --url https://api.orcarouter.ai/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "claude-3-5-sonnet-latest",
  "messages": [
    {
      "role": "user",
      "content": "<string>"
    }
  ],
  "max_tokens": 123,
  "system": "<string>",
  "stop_sequences": [
    "<string>"
  ],
  "stream": true,
  "temperature": 123,
  "top_p": 123,
  "top_k": 123,
  "tools": [
    {}
  ],
  "tool_choice": {},
  "metadata": {}
}
'
{
  "id": "<string>",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "<string>"
    }
  ],
  "model": "<string>",
  "stop_reason": "end_turn",
  "stop_sequence": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_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
Example:

"claude-3-5-sonnet-latest"

messages
object[]
required
max_tokens
integer
required
system
stop_sequences
string[]
stream
boolean
temperature
number
top_p
number
top_k
integer
tools
object[]
tool_choice
object
metadata
object

Response

200 - application/json

OK

id
string
type
enum<string>
Available options:
message
role
enum<string>
Available options:
assistant
content
object[]
model
string
stop_reason
enum<string>
Available options:
end_turn,
max_tokens,
stop_sequence,
tool_use
stop_sequence
string | null
usage
object