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

# Anthropic-compatible access

> Call APIONE with the Anthropic SDK or HTTP Messages API.

The Anthropic SDK Base URL does not include /v1. The SDK adds /v1/messages.

## HTTP example

```bash theme={null}
curl --fail-with-body --max-time 120 https://api.apione.ai/v1/messages \
  -H "x-api-key: $APIONE_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  --data "{\"model\":\"$APIONE_MODEL\",\"max_tokens\":512,\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}"
```

Set the environment variable as shown in the [quickstart](https://apione.ai/docs/en/quickstart.md). Select a model available to your key.

## Python example

```bash theme={null}
python -m pip install anthropic
```

```python theme={null}
import os
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.apione.ai",
    api_key=os.environ["APIONE_API_KEY"],
)
message = client.messages.create(
    model=os.environ["APIONE_MODEL"],
    max_tokens=512,
    messages=[{"role": "user", "content": "Explain API compatibility."}],
)
for block in message.content:
    if block.type == "text":
        print(block.text)
```

## Differences from OpenAI Chat

* Put the system prompt in the top-level system field rather than a system message inside messages.
* max\_tokens is required.
* Read text blocks from content\[], not choices.
* Streaming uses named events and requires protocol-specific parsing.

Compatibility does not imply every extension field can be translated. Reduce unsupported requests to a minimal example. See [APIONE's protocol documentation](https://apione.ai/en/api-docs/docs/anthropic-compat).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.