Jiniu AIJiniu AI
Docs
Chat

Native Claude format

A request in Anthropic Claude Messages API format. The anthropic-version header is required.

POST
/v1/messages

Header Parameters

anthropic-version*string

Anthropic API version

x-api-key?string

Anthropic API key (optional; a Bearer token also works)

Request Body

application/json

model*string

Model name; must match the identifier in the model catalog exactly

messages*

Conversation messages, in chronological order

system?string|

System prompt, a string or an array of text blocks with optional per-block caching

cache_control?object

Top-level cache marker, applied automatically to the last cacheable block

inference_geo?string

Inference region constraint

max_tokens*integer

Maximum tokens for this generation, useful for capping cost

Range1 <= value
temperature?number

Randomness, 0.0–1.0, default 1.0. No longer recommended on recent models

Range0 <= value <= 1
top_p?number

Nucleus sampling threshold. No longer recommended on recent models

top_k?integer

Sample only from the top K candidates. No longer recommended on recent models

stream?boolean

Whether to stream the response over SSE

stop_sequences?array<string>

Custom stop sequences; generation ends as soon as one is produced

tools?

Tools the model may call

tool_choice?

Tool choice: auto, none, or a specific tool

thinking?

Extended thinking settings: type is enabled / disabled / adaptive, budget_tokens is at least 1024

context_management?object

Context management policy (Beta) controlling how long conversations are trimmed

output_config?object

Structured output settings, including effort level and a JSON Schema

output_format?object

Output format

container?string|

Code-execution container ID and skills to load; reusable across requests

mcp_servers?

MCP servers to attach (Beta)

metadata?

Custom key-value pairs recorded alongside the request

speed?string

Generation speed tier

Value in"standard" | "fast"
service_tier?string

Capacity tier: auto prefers priority capacity, standard_only uses standard capacity only

Value in"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
  }
}