Skip to main content

Anthropic Messages

Haimaker accepts the Anthropic Messages protocol at POST /v1/messages. This lets applications built with the Anthropic SDK use a Haimaker API key and a model from the production catalog.

from anthropic import Anthropic

client = Anthropic(
api_key="YOUR_API_KEY",
base_url="https://api.haimaker.ai",
)

message = client.messages.create(
model="anthropic/claude-sonnet-4-6",
max_tokens=256,
messages=[{"role": "user", "content": "Hello!"}],
)

print(message.content[0].text)
curl https://api.haimaker.ai/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4-6",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello!"}]
}'

Use GET /public/model_hub for current model names. Streaming is supported through the Anthropic SDK's normal streaming interface.