Skip to main content
POST
Use x-api-key: $PIPELLM_API_KEY and anthropic-version: 2023-06-01. Native /v1/messages only routes to Anthropic-compatible platforms.
string
required
Anthropic model ID from GET /v1/models.
array
required
Conversation messages. Roles are user or assistant.
integer
required
Maximum output tokens.
string | array
System prompt.
number
Sampling temperature, 0–1.
number
Nucleus sampling.
integer
Top-k sampling.
boolean
If true, return server-sent events.
string[]
Custom stop sequences.
array
Tool definitions. See Tool Use.

Endpoint

This free route accepts Anthropic Messages requests and routes only to Anthropic-compatible platforms. To keep the Anthropic format while calling OpenAI or Gemini models, use the Anthropic Format Converter.

Install SDKs

Code Examples

Response Format

string
Message ID.
string
Always message.
string
Always assistant.
array
Output blocks. Text replies use { "type": "text", "text": "..." }. Tool calls use tool_use blocks.
string
end_turn, max_tokens, or tool_use.
object
input_tokens and output_tokens.

Errors

Same envelope as Errors. Native /v1/messages also returns 400 when the body is not Anthropic format.
Missing model, messages, or max_tokens, or a protocol mismatch.
Missing or invalid x-api-key.
See Rate Limits.

Routing & Protocols

Native-route constraints and converter routes

Anthropic Overview

Headers, models, and route family overview

Anthropic Format Converter

Keep Anthropic format while calling other providers