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

# Claude API: tiers, versions and how to connect

> Claude's tiers — Haiku, Sonnet, Opus — plus the Claude Fable 5 flagship: how they differ, how to read the version numbers (claude-fable-5, claude-opus-5, claude-sonnet-5) and how to connect over the OpenAI-compatible protocol.

Anthropic's Claude is a model family prized for code, agents and long-document work. Every model speaks the OpenAI-compatible protocol, so you connect with any OpenAI SDK — just change the `base_url`. Below: how the three tiers are organized, how to read the version numbers, and how to send a first request.

## Three tiers: Haiku, Sonnet, Opus

Claude has three named tiers. The idea is simple: the "higher" the tier, the more capable the model, but the slower and pricier it is.

| Tier       | Best for                                                                | Relative cost |
| ---------- | ----------------------------------------------------------------------- | ------------- |
| **Haiku**  | Fast, high-volume work: classification, tagging, short replies at scale | Cheapest      |
| **Sonnet** | Everyday all-rounder: code, analysis, long context                      | Mid           |
| **Opus**   | The hardest work: heavy refactors, multi-step agents, deep reasoning    | Premium       |

<Tip>
  Not sure? Start with **Sonnet** (the latest is `claude-sonnet-5`). It covers most work. Move up to **Opus** when Sonnet stops keeping up with the complexity; drop to **Haiku** when speed and cost matter more than peak quality.
</Tip>

## Reading the version numbers

An ID encodes both the tier and the generation, e.g. `claude-sonnet-5` or `claude-opus-5`. One rule: **higher numbers are newer and more capable** within a tier.

* `claude-haiku-4-5-20251001` — the fast Haiku tier. Some snapshots carry a release-date suffix like this one.
* `claude-sonnet-4-5-20250929`, `claude-sonnet-4-6`, `claude-sonnet-5` — the Sonnet tier; `-5` is newer than `-4-6`, which is newer than `-4-5`.
* `claude-opus-4-5-20251101`, `claude-opus-4-6`, `claude-opus-4-7`, `claude-opus-4-8`, `claude-opus-5` — the Opus tier; `claude-opus-5` is the newest generation and supersedes the whole `4-x` branch.
* `claude-fable-5` — **Fable**, a standalone flagship that sits above the tiers (see below); it isn't part of the numeric ladder.

Comparing numbers across tiers is meaningless: `opus-4-8` beats `sonnet-5` not because of the number but because it's the Opus tier.

<Note>
  Exact current IDs, versions and per-token prices are on the **Pricing** page at [www.ruapi.ai](https://www.ruapi.ai). Names match Anthropic's official ones, and new versions appear in the catalog automatically.
</Note>

## Claude Fable 5 — the flagship

`claude-fable-5` is Anthropic's most capable widely released model, built for the most demanding reasoning and long-horizon agentic work: large migrations, complex multi-step implementations, and agent runs that stay on task for hours. It has a **1M-token context window** and leads the Opus tier on hard, long-horizon coding and analysis — though on short, well-scoped tasks Opus stays close and costs less.

**Fable or Opus?** Reach for `claude-fable-5` on the hardest jobs: big refactors, multi-day agents, deep analytical work. For everyday coding and chat, `claude-opus-5` is faster and about half the price. Fable sits at the top of the price range — the exact per-token rate is on the [Pricing](https://www.ruapi.ai) page.

<Note>
  Fable 5 ships with safety classifiers that decline a small share of requests (cybersecurity, biological and chemical topics, model distillation). A declined request comes back as a normal HTTP `200` with `stop_reason: "refusal"` — not an error — so have your client handle that case. Haiku, Sonnet and Opus don't behave this way.
</Note>

## What Claude is best at

* **Code** — writing, refactoring and debugging; one of the family's strongest suits, especially in Sonnet and Opus.
* **Agents and tool use** — the model returns structured function calls that agents and pipelines are built on (see [function calling](/en/function-calling) for an example).
* **Long documents** — a large context window fits whole codebases and long texts.
* **Vision** — you can pass images as input: screenshots, diagrams, scans (see [image input](/en/vision) for the request format).

## Connecting Claude

The `base_url` is always `https://www.ruapi.ai/v1`. Take any OpenAI SDK and put the model ID in the `model` field:

```python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_KEY",
    base_url="https://www.ruapi.ai/v1",
)

resp = client.chat.completions.create(
    model="claude-sonnet-5",  # or claude-fable-5 for the hardest agentic work
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
```

Step-by-step key, `base_url` and first-request setup in Python and curl are in the [Quickstart](/en/quickstart). For long answers, [streaming](/en/streaming) is handy. Get your key and balance on the [top-up](/en/topup) page.

## Next

<CardGroup cols={2}>
  <Card title="Connect and first request" icon="bolt" href="/en/quickstart">
    base\_url, key, Python and curl code.
  </Card>

  <Card title="GPT models" icon="robot" href="/en/gpt-api">
    OpenAI GPT tiers: which to choose.
  </Card>

  <Card title="Gemini models" icon="sparkles" href="/en/gemini-api">
    Google Gemini: tiers and capabilities.
  </Card>
</CardGroup>
