/v1/messages endpoint accepts requests in Anthropic’s native Claude Messages API format. If you already use the anthropic Python or JavaScript SDK, you can redirect it at Anyone by changing only the base URL — all request and response fields remain identical. Anyone authenticates you with the API key from your dashboard and routes the request to the configured Claude channel. You can also send Claude-format requests to non-Claude upstream channels; Anyone translates the format automatically where possible.
Endpoint
Authentication
Claude Messages requests use two headers instead ofAuthorization:
You may alternatively use
Authorization: Bearer YOUR_TOKEN for the API key if your client does not support x-api-key. Anyone accepts both forms.Request parameters
string
required
The Claude model to use, for example
claude-opus-4-6 or claude-sonnet-4-6. To enable extended thinking, use the -thinking model name suffix: claude-sonnet-4-6-thinking.object[]
required
The conversation history. Messages alternate between
user and assistant roles. The first message must have role user.integer
required
The maximum number of tokens to generate. This field is required by the Claude Messages API. For Claude models, the value must not exceed the model’s output token limit.
string | object[]
A system prompt that sets context and instructions for the conversation. Pass a plain string, or an array of content blocks for advanced use cases such as caching system prompts.
boolean
default:"false"
When
true, the response is returned as a stream of server-sent events using Anthropic’s streaming format. Events include message_start, content_block_start, content_block_delta, content_block_stop, message_delta, and message_stop.number
Sampling temperature between
0 and 1. Higher values produce more varied output.number
Nucleus sampling probability mass between
0 and 1. Recommended when temperature is not set.integer
Sample from only the top
k most likely tokens. Not recommended for most use cases.string[]
Custom sequences at which the model will stop generating. The stop sequence itself is not included in the output.
object[]
Tools the model may call. Each tool defines a function the model can invoke.
object
Controls how the model selects tools.
object
Enable extended thinking for supported models. Use the
-thinking model name suffix as an alternative.Response fields
string
A unique identifier for this message in the format
msg_....string
Always
"message" for complete responses.string
Always
"assistant" for generated messages.object[]
An array of content blocks in the response.
string
The model that generated the response.
string
Why the model stopped generating. One of
"end_turn" (natural end), "max_tokens" (token limit reached), "stop_sequence" (custom stop sequence matched), or "tool_use" (model called a tool).object
Token counts for this request.
Examples
- Non-streaming
- Streaming
- Tool use
Format conversion
You can also route Claude-format requests (/v1/messages) to non-Claude upstream channels. Anyone performs automatic format conversion, translating the Claude Messages format to the upstream provider’s native format. This lets you use a single client format across providers. Conversion is best-effort; some Claude-specific features (such as extended thinking) may not be available on all upstream channels.
