Skip to main content
Anthropic Claude models are first-class citizens in Swarms. Every Claude model — Fable 5, Opus 4.8, Sonnet 4.6, Haiku 4.5, and older Claude 3.x — works through the same Agent interface with no extra setup.

Installation

Environment Setup

Or in a .env file:

Quick Start

The minimum needed to run a Claude agent:

Model Names

Swarms passes model names straight through to LiteLLM. Use the canonical Anthropic identifier:
For Fable 5 specifically, see the dedicated Claude Fable 5 tutorial — it documents the model’s specific constraints (no tools, no temperature).

Fable 5 — Frontier Reasoning

Fable 5 is Anthropic’s state-of-the-art model. It excels at long, complex tasks but does not support tools or temperature.

Sonnet 4.6 — The Workhorse

Sonnet is the right default for most production agents. It supports tools, vision, streaming, and runs cheaper than Opus or Fable 5.

Haiku 4.5 — Fast & Cheap

Haiku is the right pick for triage, routing, and high-volume work where latency and cost matter.

Extended Thinking

All recent Claude models support extended thinking. Swarms exposes it via two parameters:
When thinking_tokens is set, Swarms automatically filters the redundant think tool out of autonomous planning — the model is already reasoning internally.

Streaming

Stream tokens straight to stdout:
Or pipe tokens through your own callback:

Vision

Claude has strong vision capabilities. Pass an image path, URL, or base64 string:

Tool Use

Most Claude models (Sonnet, Haiku, Opus) handle long, structured tool-call sequences well:
Fable 5 does not support tools. Use Sonnet or Opus for tool-calling agents.

Multi-Model Patterns

Different Claude models for different jobs in the same workflow:

Production Defaults

For Claude agents in production:

Next Steps