Skip to main content
Use Anthropic client libraries against Modellix by pointing the base URL at the LLM gateway and authenticating with a Modellix API key. The gateway speaks the Anthropic Messages protocol at POST /v1/messages.
Use a Modellix API key from the console, not an Anthropic Console key. Model IDs use provider/name (for example anthropic/claude-sonnet-5)—see Models & Pricing for the full list.

Configure the client

Do not set ANTHROPIC_BASE_URL to https://llm.modellix.ai/v1. Including /v1 breaks path construction for native Anthropic clients.

Bearer alternative

If a tool requires Bearer auth instead of x-api-key, use ANTHROPIC_AUTH_TOKEN with the same Modellix key. Do not set ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN to different values.

Messages example

max_tokens is required on Messages. Put system instructions in system, not as a system role inside messages (roles are user or assistant only).

Streaming

Set stream=true (or the SDK equivalent). The gateway returns Anthropic Messages SSE events.

Optional headers

Native Anthropic clients often send anthropic-version (for example 2023-06-01); Modellix forwards it upstream when present. For multi-turn session affinity you can also send X-Mdlx-Session-Id (see LLM API).