Portal
Documentation: all sections

Anthropic Messages API

POST /v1/messages speaks the Anthropic Messages schema, so anything built on it (Claude Code, the Anthropic SDKs, and the agent frameworks that wrap them) works against Sable by changing one environment variable.

export ANTHROPIC_BASE_URL=https://api.buildsable.com
export ANTHROPIC_AUTH_TOKEN=$SABLE_API_KEY

claude

Use Sable model ids (sable-llama-3.3-70b), not Anthropic ones; the catalog is listed in Models.

What's translated

AnthropicSable / OpenAI
system (string or blocks)hoisted to a leading system message
max_tokensmax_tokens
stop_sequencesstop
tools[].input_schematools[].function.parameters
tool_choice: {type:"any"}tool_choice: "required"
tool_choice: {type:"tool", name}tool_choice: {type:"function", …}
tool_use content blocksassistant tool_calls
tool_result content blockstool role messages
stop_reason: max_tokensfinish_reason: length
stop_reason: tool_usefinish_reason: tool_calls

Streaming emits the Anthropic event sequence: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop. Tool calls stream in Anthropic form too: a streamed tool call opens a content_block_start with a tool_use block and delivers its arguments as input_json_delta deltas, so Anthropic-native tool loops work unmodified.

Errors arrive in the Anthropic error envelope, {"type": "error", "error": {"type": "…", "message": "…"}}, rather than the OpenAI shape, so an Anthropic SDK's error handling parses them natively.

Sable extensions

sable_privacy_tier, sable_region, and sable_scrub work here exactly as they do on the OpenAI surface, and the signed receipt is returned in the same x-sable-receipt headers. On a streaming call the trailing sable.receipt SSE event is passed through unchanged: an Anthropic-shaped client ignores the unknown event type, and a Sable-aware one still gets its receipt.

Implementation note

This endpoint translates the request and delegates to the same handler that serves /v1/chat/completions. It does not open its own upstream connection. Sealing on ingress, credit authorization, per-key scopes, metering, receipts, multi-upstream failover, and confidential routing with its fail-closed guard all apply identically. There is no second code path that could drift out of sync.