- Compatible with the native Anthropic Messages API format
- Works directly with the official Anthropic SDKs (Python / JavaScript) — just change the
base_url - Supports streaming output (SSE)
- Supports multi-turn conversations, system prompts, vision input, and tool calls
Note: If you're already using the OpenAI SDK, we recommend the OpenAI format endpoint. If you're using the Anthropic SDK or Claude Code, this endpoint is recommended.
Authorizations
Bearer Token authentication, for direct HTTP calls
Authorization: Bearer YOUR_API_KEYAPI Key authentication, compatible with the Anthropic SDK
x-api-key: YOUR_API_KEY2023-06-01Anthropic API version, passed automatically when using the Anthropic SDK
Recommended value: 2023-06-01
Body
Model name
Supports all Claude family models, for example:
claude-opus-4-6claude-sonnet-4-6claude-haiku-4-5
List of conversation messages, in chronological order. Only the user and assistant roles are supported; for system prompts use the top-level system field
Maximum number of tokens to generate
- Claude Sonnet 4-6 supports up to
64000 - Claude Opus 4-6 supports up to
32000
System prompt, set at the top level (not inside messages)
Supports a string or a content-block array format
falseWhether to enable streaming output (Server-Sent Events)
true: stream results token by token; event format follows the Anthropic SSE specfalse: wait for the full response and return it all at once
1Sampling temperature, controls output randomness
Range: 0 ~ 1
Nucleus sampling probability threshold
Range: 0 ~ 1. We recommend not setting both temperature and top_p at the same time
Stop sequences; generation stops when the specified string is encountered
Response
Unique identifier for this request, in the format msg_*
Object type, always message
Response role, always assistant
List of generated content blocks
content[].type: content type, usuallytextcontent[].text: the generated text content
The model actually used
Reason for stopping
end_turn: the model finished normallymax_tokens: reached themax_tokenslimitstop_sequence: a stop sequence was triggered
Token usage statistics for this request
usage.input_tokens: number of input tokensusage.output_tokens: number of output tokens
