Skip to main content
POST
  • Native Anthropic Messages API format
  • Drop-in compatible with the official Anthropic SDK (Python / JavaScript) — just change base_url
  • Supports streaming (SSE)
  • Supports multi-turn conversations, system prompts, vision input, and tool use
If you are already using the OpenAI SDK, use the OpenAI-compatible endpoint instead. If you are using the Anthropic SDK or Claude Code, this endpoint is recommended.

Authorizations

string
Bearer token authentication for direct HTTP calls
string
API key authentication, compatible with the Anthropic SDK
string
デフォルト:"2023-06-01"
Anthropic API version. The Anthropic SDK sets this automatically.Recommended: 2023-06-01

Body

string
必須
モデル nameAll Claude models are supported, for example:
  • claude-opus-4-6
  • claude-sonnet-4-6
  • claude-haiku-4-5
object[]
必須
Conversation messages in chronological order. Only user and assistant roles are allowed here — use the top-level system field for system prompts.
integer
必須
Maximum number of tokens to generate
  • Claude Sonnet 4-6: up to 64000
  • Claude Opus 4-6: up to 32000
string | object[]
System prompt, set at the top level (not inside messages)Accepts a plain string or an array of content blocks.
boolean
デフォルト:false
Enable streaming output (Server-Sent Events)
  • true: tokens streamed incrementally following the Anthropic SSE event format
  • false: full response returned at once
number
デフォルト:1
Sampling temperature controlling output randomnessRange: 01
number
Nucleus sampling thresholdRange: 01. Avoid setting both temperature and top_p simultaneously.
string[]
Stop sequences — generation stops when any of these strings is produced

レスポンス

string
Unique identifier for the request, prefixed with msg_
string
Object type, always message
string
レスポンス role, always assistant
object[]
List of generated content blocks
  • content[].type: content type, typically text
  • content[].text: generated text
string
The model that handled the request
string
Reason generation stopped
  • end_turn: model finished naturally
  • max_tokens: max_tokens limit reached
  • stop_sequence: a stop sequence was triggered
object
Token usage for this request
  • usage.input_tokens: input token count
  • usage.output_tokens: output token count