← Home

Guide

OpenClaw + Anthropic: Use Anthropic Models with OpenClaw

Connect your AI agent to Anthropic — the company behind Claude, one of the most capable model families for reasoning, writing, and instruction-following.

What Is Anthropic?

Anthropic is an AI safety company that builds the Claude family of large language models. Founded in 2021, Anthropic focuses on creating safe, steerable, and helpful AI systems. Their models are widely used for conversation, analysis, coding, and creative tasks.

OpenClaw supports Anthropic models through two paths: the Anthropic API directly or via OpenRouter (which routes to Anthropic behind the scenes).

Example Anthropic Models

ModelBest ForContextCost (Input)
Claude Opus 4.6Complex reasoning, research, coding1M tokens~$5/M tokens
Claude Sonnet 4.6Best balance of speed & quality1M tokens~$3/M tokens
Claude Haiku 4.5Fast responses, daily chat, budget200K tokens~$1/M tokens

Option 1: Use Anthropic via OpenClaw Launch (Easiest)

The fastest way to get an Anthropic-powered agent. No API key needed.

  1. Go to openclawlaunch.com and open the configurator.
  2. Select a Claude model from the model dropdown.
  3. Pick your chat platform (Telegram, Discord, or Web).
  4. Click Deploy. Your Anthropic-powered agent is live in 30 seconds.
Tip: OpenClaw Launch routes Claude requests through OpenRouter automatically. AI credits are included in your plan — no separate Anthropic billing needed.

Option 2: Anthropic API Direct (Self-Hosted)

If you're running OpenClaw on your own server and have an Anthropic API key, you can connect directly without any intermediary:

{
  "models": {
    "providers": {
      "anthropic": {
        "apiKey": "sk-ant-..."
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4-6"
      }
    }
  }
}

Get your API key from the Anthropic Console. Anthropic bills API usage from prepaid usage credits.

Billing reliability: Anthropic's Console provides separate controls for one-time credit purchases and automatic reloads. Before relying on direct Anthropic billing as your only production route, verify each funding path you plan to depend on, including one-time purchases and auto-reload. Anthropic Console and credit-allocation issues are handled by Anthropic support; card-authorization problems may also require your issuer. Configure and test a non-Anthropic fallback model through another provider if uninterrupted access matters. See Anthropic's API billing guide.

Option 3: Anthropic via OpenRouter (Self-Hosted)

OpenRouter acts as a unified gateway to multiple AI providers, including Anthropic. This is useful if you want to switch between providers without changing API keys:

{
  "models": {
    "providers": {
      "openrouter": {
        "apiKey": "sk-or-..."
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "openrouter/anthropic/claude-sonnet-4.6"
      }
    }
  }
}

Get your OpenRouter key from openrouter.ai/keys.

Anthropic API vs OpenRouter

FeatureAnthropic DirectOpenRouter
LatencyLowest (direct connection)Slightly higher (proxy hop)
Models availableAnthropic only300+ models from all providers
BillingAnthropic ConsoleOpenRouter unified billing
Model switchingNeed separate keys for other providersOne key for everything
Rate limitsAnthropic tier-basedOpenRouter managed

Recommendation: Use OpenRouter if you want flexibility to try other models. Use Anthropic direct if you're committed to Claude and want the lowest latency.

BYOK (Bring Your Own Key)

On OpenClaw Launch, you can use your own Anthropic API key or OpenRouter key instead of the included AI credits. Add and manage your key on the API Keys page, then choose a compatible model. Requests using that key route through your own provider billing.

Switching Models at Runtime

OpenClaw lets you switch between Anthropic models without redeploying. Use the /model command in chat:

/model anthropic/claude-haiku-4-5
/model anthropic/claude-opus-4-6

This works for both self-hosted and managed instances.

What's Next?

Deploy with Anthropic

Get an Anthropic-powered AI agent running in 30 seconds.

Deploy Now