# Claude Fable 5.1 · API guide

Use the exact API model ID `claude-fable-5-1`. This guide describes the platform contract; check the live catalog before calling the model.

## Request example

The platform origin is filled in at build time. Set API_KEY to your server-side key before running.

```bash
curl "https://newrouters.com/v1/messages" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  --data '{
  "model": "claude-fable-5-1",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Explain how an HTTP request works in three concise steps."
    }
  ],
  "stream": false
}'
```

## Protocol and response

This model uses the claude protocol. Read its native response and usage fields; do not wrap the request in the media task input envelope.

Supported endpoint templates：

- `POST /v1/messages`
- `POST /v1/messages/count_tokens`

| Limit | Catalog value |
| --- | --- |
| Context tokens | 1000000 |
| Maximum output tokens | 128000 |

For streaming, use the native protocol streaming option and parse its events; check supported capabilities in the live catalog.








<!-- official-reference:start -->
## Official sources and identity

Checked: 2026-09-27 · Platform model: `claude-fable-5-1` · Official reference: `claude-fable-5-1`

- [claude-fable-5-1 official reference](https://platform.claude.com/docs/en/models/fable-5-1/overview)
- [Anthropic Messages API](https://platform.claude.com/docs/en/api/messages/create)
- [Anthropic thinking and sampling rules](https://platform.claude.com/docs/en/build-with-claude/thinking)
<!-- official-reference:end -->

## Pricing and troubleshooting

Check current availability, contract and account pricing before integration. Keep request IDs and usage receipts when diagnosing errors. [Complete API reference](/docs/api)

## Request examples in other languages

### JavaScript

```javascript
const apiBaseUrl = "https://newrouters.com";
const apiKey = process.env.API_KEY;
if (!apiKey) throw new Error("Set API_KEY in your server environment");

const response = await fetch(apiBaseUrl + "/v1/messages", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": apiKey,
    "anthropic-version": "2023-06-01"
  },
  body: JSON.stringify({
  "model": "claude-fable-5-1",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Explain how an HTTP request works in three concise steps."
    }
  ],
  "stream": false
})
});

const result = await response.json();
if (!response.ok) throw new Error(JSON.stringify(result));
console.log(result);
```

### Python

```python
import json
import os
from urllib.request import Request, urlopen

api_base_url = "https://newrouters.com"
api_key = os.environ["API_KEY"]
body = json.loads("{\"model\":\"claude-fable-5-1\",\"max_tokens\":1024,\"messages\":[{\"role\":\"user\",\"content\":\"Explain how an HTTP request works in three concise steps.\"}],\"stream\":false}")

request = Request(
    api_base_url + "/v1/messages",
    data=json.dumps(body).encode("utf-8"),
    headers={
    "Content-Type": "application/json",
    "x-api-key": api_key,
    "anthropic-version": "2023-06-01"
    },
    method="POST",
)
with urlopen(request) as response:
    print(json.load(response))
```

## Response fields (illustrative values)

### HTTP 200

```json
{
  "content": [
    {
      "type": "text",
      "text": "..."
    }
  ],
  "stop_reason": "end_turn"
}
```


