POST /v1/messages accepts Anthropic-shaped messages and returns native JSON or SSE. Use a model ID from the Limitless catalog. This is protocol compatibility with our open-weight backend, not access to Anthropic-hosted Claude models.
The Anthropic SDK uses the API origin, without /v1. Set LIMITLESS_API_ORIGIN to https://trylimitless.ai, or http://127.0.0.1:3001 locally. The OpenAI SDK uses an origin with /v1.
pip install anthropic. max_tokens, model, and a non-empty messages array are required. System instructions belong in system.
Stream content
Using the same client:message_start, content-block events, message_delta, and message_stop. An error event or disconnect can end the stream before completion. The gateway records input/cache usage from the opening message and output totals from later usage events.
Authentication and extensions
The SDK sendsx-api-key. Authorization: Bearer … also works and takes precedence if both are present. The gateway forwards anthropic-version and anthropic-beta; it supplies version 2023-06-01 if omitted.
Custom tools use name and input_schema; return their results as tool_result blocks. Thinking, output schemas, images, and hosted web tools depend on model support. See reasoning, images, and web tools.
Errors use the Messages envelope: { "type": "error", "error": { "type": "…", "code": "…", "message": "…" } }. See errors.