curl --request POST \
--url https://api.shuyou.ai/openrouter/v1/messages \
--header 'Content-Type: application/json' \
--header 'anthropic-version: <anthropic-version>' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "anthropic/claude-sonnet-4.6",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, Claude"
}
]
}
'{
"id": "msg_example",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-sonnet-4.6",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 15
}
}Create a Message
Create a message using the OpenRouter-compatible Anthropic Messages API on ShuYou.
curl --request POST \
--url https://api.shuyou.ai/openrouter/v1/messages \
--header 'Content-Type: application/json' \
--header 'anthropic-version: <anthropic-version>' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "anthropic/claude-sonnet-4.6",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, Claude"
}
]
}
'{
"id": "msg_example",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-sonnet-4.6",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 15
}
}Overview
Anthropic Messages API format, proxied through OpenRouter on ShuYou. Supports text, images, tools, and extended thinking when the upstream model allows it.https://api.shuyou.ai/openrouter
Endpoint: POST /v1/messages
Include the anthropic-version header (for example 2023-06-01) as required by the Anthropic Messages specification.Authorizations
ShuYou API key sent as x-api-key (Anthropic-compatible).
Headers
Anthropic API version. Currently only 2023-06-01 is supported.
"2023-06-01"
Optional beta features (comma-separated). code-execution-2025-08-25 is not supported on ShuYou.
Body
Model ID (provider/model_name), e.g. from List Models.
"anthropic/claude-sonnet-4.6"
Maximum tokens to generate (including thinking tokens when enabled).
x >= 11024
Conversation history. Roles alternate user / assistant; up to 100,000 messages.
1Show child attributes
Show child attributes
System prompt (no system role in messages).
Not supported on ShuYou.
Show child attributes
Show child attributes
Custom sequences that stop generation (stop_reason: stop_sequence).
Stream the response via server-sent events.
Sampling temperature (0 = more deterministic, 1 = more creative).
0 <= x <= 1Nucleus sampling. Prefer tuning either temperature or top_p.
0 <= x <= 1Sample only from the top K tokens (advanced).
x >= 0Extended thinking configuration.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
Tools the model may call (client tools and supported server tools).
- Option 1
- Option 2
Show child attributes
Show child attributes
Output configuration such as structured JSON.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Container identifier for reuse across requests (e.g. code execution).
Geographic region for inference processing.
Not supported on ShuYou.
auto, standard_only Response
Message object, or SSE stream when stream is true