> ## Documentation Index
> Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude API

> Use Claude-compatible requests through APIXO

Use APIXO as a Claude-compatible API gateway. Keep the Anthropic Messages request format, replace the base URL, and use your APIXO API key.

## What to change

| Setting                 | APIXO value                                                                |
| ----------------------- | -------------------------------------------------------------------------- |
| Base URL                | `https://llm.apixo.ai`                                                     |
| Request URL             | `https://llm.apixo.ai/v1/messages`                                         |
| API key                 | `APIXO_API_KEY` from [APIXO API Keys](https://apixo.ai/dashboard/api-keys) |
| API key header          | `x-api-key`                                                                |
| Required version header | `anthropic-version: 2023-06-01`                                            |
| Model location          | Request body `model`                                                       |

## Quickstart

```bash theme={null}
export APIXO_API_KEY="your_apixo_api_key"
```

```bash theme={null}
curl -X POST "https://llm.apixo.ai/v1/messages" \
  -H "x-api-key: $APIXO_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 256,
    "messages": [
      {"role": "user", "content": "Explain RAG in 3 bullets."}
    ]
  }'
```

## Streaming

```bash theme={null}
curl -N -X POST "https://llm.apixo.ai/v1/messages" \
  -H "x-api-key: $APIXO_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "stream": true,
    "max_tokens": 256,
    "messages": [
      {"role": "user", "content": "Write a short release note."}
    ]
  }'
```

## SDK example

Use the Anthropic SDK with APIXO's base URL.

```javascript theme={null}
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.APIXO_API_KEY,
  baseURL: "https://llm.apixo.ai"
});

const resp = await client.messages.create({
  model: "claude-sonnet-4-6",
  max_tokens: 256,
  messages: [{ role: "user", content: "Say hello in one sentence." }]
});

console.log(resp.content);
```

## Supported Claude models

* `claude-opus-4-7`
* `claude-opus-4-6`
* `claude-opus-4-6-thinking`
* `claude-opus-4-5-20251101`
* `claude-opus-4-5-20251101-thinking`
* `claude-sonnet-4-6`
* `claude-sonnet-4-6-thinking`
* `claude-sonnet-4-5-20250929`
* `claude-sonnet-4-5-20250929-thinking`
* `claude-haiku-4-5-20251001`
* `claude-haiku-4-5-20251001-thinking`

## Troubleshooting

* `401`: missing or invalid API key
* `400`: invalid Messages API request body, unsupported model id, or missing `max_tokens`
* `429`: rate limit or temporary capacity limit
* `502` / `504`: upstream provider error or timeout

Retry `429`, `502`, and `504` with backoff. Fix `400` and `401` before retrying.

## Related

* [LLM Gateway Overview](/docs/llm)
* [Supported Models](/docs/llm/supported-models)
* [LLM Authentication](/docs/llm/authentication)
* [LLM Streaming](/docs/llm/streaming)
* [LLM Errors and Retry](/docs/llm/errors-retry)
* [Pricing](https://apixo.ai/pricing)
