Zum Hauptinhalt springen
POST
/
messages
Eine Nachricht erstellen
curl --request POST \
  --url https://api.orcarouter.ai/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "anthropic/claude-sonnet-4.6",
  "messages": [
    {
      "content": "<string>"
    }
  ],
  "max_tokens": 123,
  "system": "<string>",
  "stop_sequences": [
    "<string>"
  ],
  "stream": true,
  "temperature": 123,
  "top_p": 123,
  "top_k": 123,
  "tools": [
    {}
  ],
  "tool_choice": {},
  "thinking": {
    "budget_tokens": 123
  },
  "mcp_servers": "<unknown>",
  "metadata": {}
}
'
{
  "id": "<string>",
  "content": [
    {
      "text": "<string>"
    }
  ],
  "model": "<string>",
  "stop_sequence": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "cache_creation_input_tokens": 123,
    "cache_read_input_tokens": 123,
    "server_tool_use": {}
  }
}

Autorisierungen

Authorization
string
header
erforderlich

OrcaRouter-API-Schlüssel sehen aus wie sk-orca-.... Übergib sie im Authorization: Bearer sk-orca-...-Header.

Body

application/json
model
string
erforderlich
Beispiel:

"anthropic/claude-sonnet-4.6"

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

Anthropic-Extended-Thinking. Setze auf Claude 4 / Claude-Opus-Modellen, die Thinking unterstützen. Das Modell emittiert einen versteckten Reasoning-Pass vor seiner endgültigen Antwort.

mcp_servers
any

Freiform-MCP-Server-Konfiguration, wortwörtlich an Anthropic weitergeleitet.

metadata
object

Antwort

200 - application/json

OK

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