Skip to main content
POST
/
v1
/
messages
curl --request POST \
  --url https://api.shuyou.ai/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
  }
}

Authorizations

x-api-key
string
header
required

ShuYou API key sent as x-api-key (Anthropic-compatible).

Headers

anthropic-version
string
required

Anthropic API version. Currently only 2023-06-01 is supported.

Example:

"2023-06-01"

anthropic-beta
string

Optional beta features (comma-separated). code-execution-2025-08-25 is not supported on ShuYou.

Body

application/json
model
string
required

Model ID (provider/model_name), e.g. from List Models.

Example:

"anthropic/claude-sonnet-4.6"

max_tokens
integer
required

Maximum tokens to generate (including thinking tokens when enabled).

Required range: x >= 1
Example:

1024

messages
object[]
required

Conversation history. Roles alternate user / assistant; up to 100,000 messages.

Minimum array length: 1
system

System prompt (no system role in messages).

metadata
object
deprecated

Not supported on ShuYou.

stop_sequences
string[]

Custom sequences that stop generation (stop_reason: stop_sequence).

stream
boolean
default:false

Stream the response via server-sent events.

temperature
number
default:1

Sampling temperature (0 = more deterministic, 1 = more creative).

Required range: 0 <= x <= 1
top_p
number

Nucleus sampling. Prefer tuning either temperature or top_p.

Required range: 0 <= x <= 1
top_k
integer

Sample only from the top K tokens (advanced).

Required range: x >= 0
thinking
object

Extended thinking configuration.

tool_choice
object
tools
object[]

Tools the model may call (client tools and supported server tools).

output_config
object

Output configuration such as structured JSON.

cache_control
object
container
string

Container identifier for reuse across requests (e.g. code execution).

inference_geo
string

Geographic region for inference processing.

service_tier
enum<string>
deprecated

Not supported on ShuYou.

Available options:
auto,
standard_only

Response

Message object, or SSE stream when stream is true

id
string
type
enum<string>
Available options:
message
role
enum<string>
Available options:
assistant
model
string
content
object[]
stop_reason
enum<string>
Available options:
end_turn,
max_tokens,
stop_sequence,
tool_use,
pause_turn,
refusal
stop_sequence
string | null
usage
object