Native Claude format
A request in Anthropic Claude Messages API format.
The anthropic-version header is required.
Header Parameters
Anthropic API version
Anthropic API key (optional; a Bearer token also works)
Request Body
application/json
Model name; must match the identifier in the model catalog exactly
Conversation messages, in chronological order
System prompt, a string or an array of text blocks with optional per-block caching
Top-level cache marker, applied automatically to the last cacheable block
Inference region constraint
Maximum tokens for this generation, useful for capping cost
1 <= valueRandomness, 0.0–1.0, default 1.0. No longer recommended on recent models
0 <= value <= 1Nucleus sampling threshold. No longer recommended on recent models
Sample only from the top K candidates. No longer recommended on recent models
Whether to stream the response over SSE
Custom stop sequences; generation ends as soon as one is produced
Tools the model may call
Tool choice: auto, none, or a specific tool
Extended thinking settings: type is enabled / disabled / adaptive, budget_tokens is at least 1024
Context management policy (Beta) controlling how long conversations are trimmed
Structured output settings, including effort level and a JSON Schema
Output format
Code-execution container ID and skills to load; reusable across requests
MCP servers to attach (Beta)
Custom key-value pairs recorded alongside the request
Generation speed tier
"standard" | "fast"Capacity tier: auto prefers priority capacity, standard_only uses standard capacity only
"auto" | "standard_only"Response Body
application/json
curl -X POST "https://jiniu.ai/v1/messages" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-3-opus-20240229", "messages": [ { "role": "user", "content": "string" } ], "max_tokens": 1 }'{
"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
}
}