Create Message
Create a Claude / Anthropic Messages compatible request. Use this for clients such as Claude Code that call the Messages API shape; streaming and non-streaming responses are supported.
AuthorizationBearer <token>
Authenticate with your API Key. Get your API Key in the Router One console; the format is sk-xxx.
In: header
modelstring
Model ID. Set to auto for Router One routing, or specify a concrete model.
messages
Conversation messages in the Claude / Anthropic Messages format.
Items
1 <= itemssystem?string
Optional system prompt.
max_tokensinteger
Maximum number of output tokens.
Range
1 <= valuestream?boolean
Whether to enable streaming response.
Default
falsetemperature?number
Sampling temperature, range 0-2.
Default
1Range
0 <= value <= 2Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.router.one/v1/messages" \ -H "Content-Type: application/json" \ -d '{ "model": "auto", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Hello" } ] }'{
"id": "msg_abc123",
"type": "message",
"role": "assistant",
"model": "claude-sonnet-4-20250514",
"content": [
{
"type": "text",
"text": "Hello! How can I help you?"
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 9,
"output_tokens": 12
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}{
"error": {
"message": "Insufficient balance",
"type": "billing_error",
"code": "insufficient_balance"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}{
"error": {
"message": "string",
"type": "string",
"code": "string"
}
}