- Compatible with the native Anthropic Messages API format
- Supports direct integration with the official Anthropic SDKs (Python / JavaScript) by changing only
base_url - Supports streaming output (SSE)
- Supports multi-turn conversations, system prompts, visual input, and tool calls
Note: If you are already using the OpenAI SDK, we recommend using the OpenAI-compatible endpoint. If you are using the Anthropic SDK or Claude Code, we recommend using this endpoint.
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, automatically included when using the Anthropic SDK
Recommended value: 2023-06-01
Body
Model name
Supports all Claude series 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. Use the top-level system field for system prompts
Maximum number of tokens to generate
- Claude Sonnet 4-6 supports up to
64000 - Claude Opus 4-6 supports up to
32000
System prompt configured at the top level rather than inside messages
Supports either a string or an array of content blocks
falseWhether to enable streaming output (Server-Sent Events)
true: Returns tokens incrementally using an event format that follows the Anthropic SSE specificationfalse: Waits for the complete response and returns it all at once
1Sampling temperature that controls output randomness
Range: 0 to 1
Probability threshold for nucleus sampling
Range: 0 to 1. It is recommended not to set both temperature and top_p
Stop sequences. Generation stops when any 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: Generated text content
Name of the model actually used
Reason for stopping
end_turn: The model finished normallymax_tokens: Themax_tokenslimit was reachedstop_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
