logoPofano

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#

ParameterTypeRequiredDescription
modelstringYesThe Claude model ID (e.g., claude-3-5-sonnet-20241022).
max_tokensintegerYesThe maximum number of tokens to generate.
messagesarrayYesConversation messages in Claude format.
systemstringNoSystem prompt for the conversation.
temperaturenumberNoSampling temperature between 0 and 1.
stop_sequencesarrayNoCustom text sequences that stop generation.
streambooleanNoIf true, response is streamed.
top_pnumberNoNucleus sampling parameter.
top_kintegerNoTop-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."}
    ]
  }'

On this page