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

# Anthropic-compatible protocol

> Call Claude models with the native Messages API

Anthropic Messages uses its own message shape and headers. Base URL is `https://api.bianxie.ai`; use a model ID from the [live model page](https://api.bianxie.ai/pricing).

## Request

```bash theme={null}
curl https://api.bianxie.ai/v1/messages \
  -H "x-api-key: API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model",
    "max_tokens": 1024,
    "messages": [{
      "role": "user",
      "content": "Explain quantum entanglement in one paragraph."
    }]
  }'
```

`max_tokens` is required. Pass system instructions in the top-level `system` field, not as an OpenAI-style system message. Add `"stream": true` for SSE streaming.

## Response shape

```json theme={null}
{
  "id": "msg_example",
  "type": "message",
  "role": "assistant",
  "model": "your-model",
  "content": [{"type": "text", "text": "Quantum entanglement is..."}],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {"input_tokens": 18, "output_tokens": 42}
}
```

Read text blocks from `content[]`. Tool calls use other content-block types; streaming emits message and content-block events.
