Messages

Create a message

Changed on
post/messages

Request

  • Base URL
    https://api.orcarouter.ai/v1
  • URL
    https://api.orcarouter.ai/v1/messages
  • Auth
    HTTP bearer

Headers

X-OrcaRouter-Include-Coststring
Example:true

Opt in to per-request cost reporting. When true (or 1, case-insensitive), the billed cost of the call is added to the response's usage object — usage.cost_usd on the OpenAI and Anthropic formats, usageMetadata.costUsd on the Gemini format. On streams it rides the frame carrying final usage (send stream_options: {"include_usage": true} on the OpenAI format). Absent or any other value means off. See Per-request cost.

Request body

modelstring required
max_tokensinteger required
stop_sequencesstring[]
streamboolean
temperaturenumber
top_pnumber
top_kinteger
toolsobject[]
tool_choiceobject
mcp_serversunknown
metadataobject

Example request

{
  "model": "anthropic/claude-sonnet-4.6"
}

Response

OK

idstring
type'message'
role'assistant'
modelstring
stop_reason'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use'
stop_sequencestring nullable

Changes