Skip to main content
POST

Claude Messages API

The Claude Messages API preserves Anthropic’s native request structure and is suitable for migrating existing Claude SDK-based services or services using native prompt structures. Requests will be routed into the Claude relay format and dispatched to the corresponding upstream based on the channel.

Authentication

You can also use Claude native request headers:

Request Body

model
string
required
Claude model name.
messages
array<object>
required
Array of conversation messages. In Claude’s native format, message roles are typically user or assistant.
system
string | array<object>
System prompt. Claude does not use system role messages; instead, system instructions are passed through this field.
max_tokens
integer
Maximum number of output tokens. Most Claude requests should pass this explicitly.
stream
boolean
Whether to enable SSE streaming output.
temperature
number
Sampling temperature.
top_p
number
Top-p sampling parameter.
top_k
integer
Top-K sampling parameter.
stop_sequences
array<string>
Stop sequences.
tools
array<object>
Claude tool list, typically including name, description, and input_schema.
tool_choice
object
Controls the tool selection strategy, for example { "type": "tool", "name": "get_weather" }.
thinking
object
Extended thinking configuration, for example { "type": "enabled", "budget_tokens": 10000 }.
metadata
object
Business-side metadata, such as user_id.

Request Example

Multimodal Input

Tool Calling

Response Example