Claude Messages
Anthropic Claude Messages API format.
Pofano natively supports the Anthropic Claude Messages API format, allowing you to use Claude models with their native API structure.
Endpoint#
POST /v1/messages
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The Claude model ID (e.g., claude-3-5-sonnet-20241022). |
max_tokens | integer | Yes | The maximum number of tokens to generate. |
messages | array | Yes | Conversation messages in Claude format. |
system | string | No | System prompt for the conversation. |
temperature | number | No | Sampling temperature between 0 and 1. |
stop_sequences | array | No | Custom text sequences that stop generation. |
stream | boolean | No | If true, response is streamed. |
top_p | number | No | Nucleus sampling parameter. |
top_k | integer | No | Top-k sampling parameter. |
Authentication#
You can authenticate using either the standard Bearer token or the x-api-key header (Claude-compatible format):
Using x-api-key header#
curl https://ai.pofano.com/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Explain the theory of relativity."}
]
}'Using Bearer token#
curl https://ai.pofano.com/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Explain the theory of relativity."}
]
}'
Pofano