API DocsAI Model APIsChat
Native Claude Format
Requests in Anthropic Claude Messages API format.
Native Claude Format
Requests in Anthropic Claude Messages API format.
Requires anthropic-version in the request header.
Base URL
https://autorouter.top— Production
Authentication
BearerAuth: http (bearer)
Authenticate using a Bearer Token.
Format: Authorization: Bearer sk-xxxxxx
Endpoints
POST /v1/messages
Native Claude Format
Requests in Anthropic Claude Messages API format.
Requires anthropic-version in the request header.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
anthropic-version | header | string | Yes | Anthropic API version |
x-api-key | header | string | No | Anthropic API Key (optional, can also use Bearer Token) |
Request Body
Content-Type: application/json
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | - |
messages | array | Yes | - |
system | oneOf | No | - |
max_tokens | integer | Yes | - |
temperature | number | No | - |
top_p | number | No | - |
top_k | integer | No | - |
stream | boolean | No | - |
stop_sequences | array | No | - |
tools | array | No | - |
tool_choice | oneOf | No | - |
thinking | object | No | - |
metadata | object | No | - |
Responses
200: Successfully created response
Content-Type: application/json
Request Example
curl -X POST "https://autorouter.top/v1/messages" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, please introduce yourself."
}
]
}'Response Examples
{
"id": "string",
"type": "message",
"role": "assistant",
"content": [
{
"type": "string",
"text": "string"
}
],
"model": "string",
"stop_reason": "end_turn",
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0
}
}