API Reference
Anthropic Messages
Send a message to the Anthropic models. Supports streaming and non-streaming responses.
POST
Send a message to Anthropic models using the native Anthropic Messages API format. Supports streaming and non-streaming responses.
Create Anthropic Message
To create an Anthropic message, use the following endpoint:POST /v1/messages
This endpoint is compatible with the Anthropic SDK (
anthropic Python/Node.js package). Point
your SDK at https://api.routeway.ai and replace your Anthropic API key with your Routeway
key — no other changes needed.Request Body
The Anthropic model ID to use (e.g.
"claude-opus-4-5", "claude-sonnet-4-5"). See
Models for the full list of supported Anthropic models.An array of message objects forming the conversation. Each object must have a
role
("user" or "assistant") and a content field (string or array of content blocks).The maximum number of tokens to generate before stopping.
A system prompt that provides context and instructions to the model. Can be a plain string
or an array of content blocks.
Sampling temperature between 0 and 1. Higher values produce more varied outputs.
Whether to stream the response as Server-Sent Events (SSE).
Custom text sequences that will cause the model to stop generating.
A list of tools the model may call. Each tool must have a
name, optional description,
and an input_schema (JSON Schema object).Controls tool use. Can be
{"type": "auto"}, {"type": "any"}, or
{"type": "tool", "name": "..."}.Nucleus sampling parameter. Use
temperature or top_p, but not both.Only sample from the top K options for each subsequent token.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Required range:
0 <= x <= 2Required range:
0 <= x <= 1Required range:
x >= 0- ToolChoiceAuto
- ToolChoiceNone
- ToolChoiceAny
- ToolChoiceSpecific
- ThinkingConfigEnabled
- ThinkingConfigDisabled
- ThinkingConfigAdaptive
Response
Successful Response
content
(TextBlock · object | ImageBlock · object | DocumentBlock · object | ToolUseBlock · object | ToolResultBlock · object)[]
required
- TextBlock
- ImageBlock
- DocumentBlock
- ToolUseBlock
- ToolResultBlock
Available options:
end_turn, max_tokens, stop_sequence, tool_use, content_filter Allowed value:
"message"Allowed value:
"assistant"