# The Best LLM Models for OpenClaw in 2026: Claude, GPT, Gemini and Open Weights

Canonical: https://clawdocx.com/blog/best-llm-models-openclaw
Author: Sam Okafor
Published: 2026-02-10
Updated: 2026-09-19

> The best LLM for OpenClaw in September 2026: Claude Sonnet 5 by default, Kimi K2.5 on a budget, Qwen3.6 locally, with current prices and configs.

## Which model should you run OpenClaw on right now?

Run OpenClaw on **Claude Sonnet 5** (`anthropic/claude-sonnet-5`) unless you have a specific reason not to. At $2 per million input tokens and $10 per million output tokens with a 1M token context window, it is the best speed-to-intelligence balance Anthropic currently sells, and its per-token price is a third below the Sonnet 4.6 it succeeds, though see the tokenizer note below before you bank that saving.

On a budget, run **Kimi K2.5** (`openrouter/moonshotai/kimi-k2.5`) at $0.45 in and $2.25 out. GPT-5.6 Luna is cheaper per token, but Kimi K2.5 is the model OpenClaw users rank first for agent work, and agent work is what you are buying.

For zero marginal cost, run **`qwen3.6:27b` through Ollama** on hardware you already own. haimaker.ai's July 2026 ranking of local models for OpenClaw puts it first, and the 27b build is an 18GB download with a 256K context window and native tool calling.

If your agent runs long unattended chains where a wrong step is expensive, step up to **Claude Opus 5** at $5 / $25 or **Claude Fable 5.1** at $10 / $50. Anthropic points Fable 5.1 at "demanding reasoning and long-horizon agentic work", which is a fair description of what an always-on agent does overnight.

## How the top models compare for agent work

Prices below are per million tokens, current as of September 19, 2026. Anthropic, OpenAI and Google prices come from each provider's official pricing page; the Kimi K2.5 price is the rate listed on the Price Per Token leaderboard.

| Model | Provider | Input $/M tokens | Output $/M tokens | Context window | Best for |
|---|---|---|---|---|---|
| Claude Fable 5.1 | Anthropic | $10.00 | $50.00 | 1M | Long-horizon unattended runs |
| Claude Opus 5 | Anthropic | $5.00 | $25.00 | 1M | Complex agentic coding |
| Claude Sonnet 5 | Anthropic | $2.00 | $10.00 | 1M | The default daily driver |
| Claude Haiku 4.5 | Anthropic | $1.00 | $5.00 | 200K | Heartbeats and quick lookups |
| GPT-6 Astra | OpenAI | $10.00 | $50.00 | 1.05M | Hardest end-to-end work |
| GPT-5.6 Terra | OpenAI | $2.00 | $12.00 | 1.05M | Balanced OpenAI option |
| GPT-5.6 Luna | OpenAI | $0.20 short / $0.40 long | $1.20 short / $1.80 long | 1.05M | High-volume background tasks |
| Gemini 3.1 Pro (preview) | Google | $2.00 | $12.00 | 1M | Research over long documents |
| Gemini 3.8 Flash | Google | $0.75 | $3.75 | 1M | Fast agent loops, free tier |
| Kimi K2.5 | Moonshot AI | $0.45 | $2.25 | 256K | Cheap agent work, open weights |

Five caveats the table cannot hold. Gemini 3.1 Pro charges $2 / $12 only on prompts at or under 200K tokens and $4 / $18 above that. It is also still a preview model (`gemini-3.1-pro-preview`), so treat it as subject to change before you build an agent around it. Gemini 3.8 Flash is priced at $0.75 / $3.75 through December 31, 2026 and $1.50 / $7.50 after. Claude Sonnet 5's $2 / $10 began as introductory pricing, and Anthropic has since confirmed it as the standard price instead of raising it on September 1. OpenAI prices its GPT-5.6 models by context tier as well: long-context prompts cost $0.40 in and $1.80 out for Luna, and $4.00 in and $18.00 out for Terra.

> **Note**
>
> Claude 4.7 and later models use a newer tokenizer that produces roughly 30% more tokens for the same text. A headline price cut is therefore smaller in practice than it looks. Compare providers on a real workload of your own, not on the sticker price.

## What about open models and community rankings?

Open weights won the price argument this year. The Price Per Token leaderboard for OpenClaw scores models on community votes from real agent workflows weighted by recent activity, so rank does not track raw vote count. As of September 18, 2026 it put Kimi K2.5 from Moonshot AI first with 7,814 votes at $0.45 / $2.25, GLM 4.7 from Z.ai second with 338 votes at $0.40 / $1.75, and Claude Opus 4.6 third with 295.

Kimi K2.5's weights ship under a Modified MIT License with a 256K context window, multi-step tool calling with interleaved thinking, and an agent swarm mode that decomposes a task across sub-agents. That combination, at under a quarter of Claude Sonnet 5's input price, explains why it shows up in so many OpenClaw configs.

For fully local setups, haimaker.ai's ranked test of Ollama models for OpenClaw puts `qwen3.6:27b` first and names 18GB of VRAM as the floor. Ollama's own library backs up the sizing: `qwen3.6` publishes 27b and 35b tags at 18GB and 23GB respectively, both with a 256K context window and tools, thinking and vision enabled.

Two honest limits on local models. They still trail the frontier on long tool-use chains, and they occupy the memory your other applications wanted. Keep a cheap cloud model in the fallback chain rather than pretending a 27B model will never get stuck.

## Recommended OpenClaw configurations

Model refs take the form `provider/model`, or `provider/vendor/model` on aggregators like OpenRouter, and live under `agents.defaults.model` in `~/.openclaw/openclaw.json`, which OpenClaw reads as JSON5. `primary` is the model the agent starts on, and `fallbacks` is an ordered list it tries when the primary is unavailable. Set your provider keys first; [API key setup](/docs/api-key-setup) covers where they belong.

### Quality first

```json5
// ~/.openclaw/openclaw.json
{
  agents: {
    defaults: {
      model: {
        primary: "anthropic/claude-opus-5",
        fallbacks: ["anthropic/claude-sonnet-5", "openai/gpt-6-astra"],
      },
    },
  },
}
```

### Balanced, the configuration most people should run

```json5
{
  agents: {
    defaults: {
      model: {
        primary: "anthropic/claude-sonnet-5",
        fallbacks: ["anthropic/claude-haiku-4-5", "openai/gpt-5.6-luna"],
      },
    },
  },
}
```

### Budget

OpenClaw ships this ref in its bundled OpenRouter starter models. Newer Kimis exist: OpenRouter also carries `openrouter/moonshotai/kimi-k2.6`, and the direct `moonshot` provider has moved to Kimi K3 and Kimi K2.7 Code rather than K2.5. K2.5 is the build with the community track record behind it, so start there and treat the newer ones as experiments against that baseline.

```json5
{
  agents: {
    defaults: {
      model: {
        primary: "openrouter/moonshotai/kimi-k2.5",
        fallbacks: ["anthropic/claude-haiku-4-5"],
      },
    },
  },
}
```

### Free and local

```json5
{
  models: {
    providers: {
      ollama: {
        baseUrl: "http://127.0.0.1:11434",
        apiKey: "ollama-local",
        api: "ollama",
        models: [
          { id: "qwen3.6:27b", name: "Qwen3.6 27B" },
        ],
      },
    },
  },
  agents: {
    defaults: {
      model: {
        primary: "ollama/qwen3.6:27b",
        fallbacks: ["anthropic/claude-haiku-4-5"],
      },
    },
  },
}
```

Three details from the OpenClaw docs are easy to get wrong. The `baseUrl` is the native Ollama address with no `/v1` suffix, `api: "ollama"` is what guarantees native tool-calling behavior rather than an OpenAI-compatible approximation, and the `apiKey` is the placeholder the docs use, which you can omit when `OLLAMA_API_KEY` is set in the environment. OpenClaw discovers your local models once you opt in with `OLLAMA_API_KEY`, but declaring an explicit `models` array makes it skip discovery, so list every model you want available.

You can skip the file entirely and use the CLI:

```bash
openclaw models set anthropic/claude-sonnet-5
openclaw models fallbacks add anthropic/claude-haiku-4-5
openclaw models list
```

## Multi-model routing

Running a single model for everything is the expensive way to run an agent. OpenClaw gives you two levers for spreading the load.

The first is the fallback chain shown above. Fallbacks are tried in order when the primary is unavailable, and OpenClaw rotates auth profiles within a provider before moving to the next entry. That is failover rather than cost routing, and it matters most for an always-on agent that cannot afford to sit out a provider incident.

The second is per-agent models. `agents.entries.*.model` overrides `agents.defaults.model`, so a sub-agent that only summarizes an inbox can sit on Claude Haiku 4.5 or GPT-5.6 Luna while your main agent stays on Claude Sonnet 5. Splitting work across agents is how you get task-level cost control without guessing at a routing table.

If you want an agent pinned to a fixed set of models, `agents.defaults.modelPolicy.allow` takes exact refs or wildcards such as `anthropic/*`, and has done since v2026.8.1. Note that `openclaw models set` and `openclaw models aliases add` write model entries but never modify `modelPolicy.allow`, so the allowlist stays under your control.

> **Tip**
>
> Start with one primary and one cheap fallback. Add per-agent overrides only after a week of real usage has shown you where the tokens actually go.

## How to keep costs under control

Four habits move the bill more than the model choice itself does.

**Cache your prompts.** Cache reads cost 10% of the base input price on Claude models, and 2.5% on Claude Fable 5.1. An agent that re-sends the same system prompt, soul file and memory on every turn is the ideal caching workload.

**Batch anything that is not urgent.** Anthropic's Batch API is 50% off both input and output. Nightly digests, backlog triage and bulk summarization do not need to be synchronous.

**Demote background work.** Heartbeats, classification and routing do not need a frontier model. Claude Haiku 4.5 at $1 / $5 or GPT-5.6 Luna at $0.20 / $1.20 on short context handle them for a fraction of the price.

**Push the noisy majority to a free tier or local model.** Google AI Studio offers a free tier for Gemini models, configured through the same `models.providers` block as any other provider, and a local `qwen3.6:27b` costs only electricity.

Set a spending cap on every provider account before you leave an agent running overnight. Our [cost optimization guide](/docs/cost-optimization) has the full budgeting framework, including how to estimate a monthly figure from a week of real usage.

## What to read next

- [Run OpenClaw 100% free with Ollama](/blog/openclaw-ollama-free-local-setup) walks through the local setup end to end, including which model fits your hardware.
- [Running OpenClaw on a Mac mini](/blog/openclaw-mac-mini-server) covers the always-on server that most local-model users end up building.
- [API key setup](/docs/api-key-setup) shows where provider keys live, how routing reads them, and how to keep them out of plain text.

Prices moved more than once in the first nine months of 2026 and the community leaderboard reordered more often than that. Check the provider pricing pages in the sources below before you commit to a monthly budget.

## Frequently asked questions

**Which LLM should I use for OpenClaw in September 2026?**

Claude Sonnet 5 is the default pick at $2 per million input tokens and $10 per million output tokens, with a 1M token context window. Step up to Claude Opus 5 for long-horizon or high-stakes work, and drop to Kimi K2.5 or Claude Haiku 4.5 when cost matters more than depth.

**What is the cheapest way to run an OpenClaw agent?**

Running a local model through Ollama costs nothing per token. The qwen3.6:27b build is the local model haimaker.ai's ranked test of OpenClaw agent work placed first, and it needs roughly 18GB of memory. If you want a hosted model instead, GPT-5.6 Luna at $0.20 in and $1.20 out per million tokens on short-context prompts and Google AI Studio's free Gemini tier are the cheapest starting points.

**Can OpenClaw fall back to a second model automatically?**

Yes. Set agents.defaults.model.fallbacks in openclaw.json to an ordered list of provider/model refs, or run openclaw models fallbacks add. OpenClaw tries them in order when the primary is unavailable, rotating auth profiles within a provider before moving to the next fallback.

**Do I need a 1M token context window for an OpenClaw agent?**

Rarely. Most agent turns fit well under 200K tokens, which is why Claude Haiku 4.5 at 200K and Kimi K2.5 at 256K work fine for daily use. A 1M window earns its keep when your agent reads a whole codebase or a long document set in a single pass.

**Is Claude Opus 5 worth the extra cost over Claude Sonnet 5?**

Opus 5 costs $5 in and $25 out per million tokens against Sonnet 5's $2 and $10, so it is about two and a half times the price. Anthropic positions Opus 5 for complex agentic coding and enterprise work, so it pays off on long tool-use chains where a wrong step is expensive, and not on routine chat.

**Which local model runs on a 16GB machine?**

16GB is tight for qwen3.6:27b, which is an 18GB download. On a 16GB machine, run a smaller model and keep a cheap cloud fallback such as Claude Haiku 4.5 for anything the local model fumbles. A 24GB machine runs the 27b build comfortably; the 35b build is a 23GB download and wants 32GB or more.

## Sources

- [Claude API pricing](https://platform.claude.com/docs/en/about-claude/pricing)
- [Claude models overview](https://platform.claude.com/docs/en/about-claude/models/overview)
- [OpenAI API pricing](https://developers.openai.com/api/docs/pricing)
- [OpenAI models](https://developers.openai.com/api/docs/models)
- [Gemini API pricing](https://ai.google.dev/gemini-api/docs/pricing)
- [Gemini 3 developer guide](https://ai.google.dev/gemini-api/docs/gemini-3)
- [Gemini 3.8 Flash model reference](https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash)
- [OpenClaw: Models CLI](https://docs.openclaw.ai/concepts/models)
- [OpenClaw: Configuration](https://docs.openclaw.ai/gateway/configuration)
- [OpenClaw: OpenRouter](https://docs.openclaw.ai/providers/openrouter)
- [OpenClaw: Moonshot AI](https://docs.openclaw.ai/providers/moonshot)
- [OpenClaw: Ollama configuration](https://docs.openclaw.ai/providers/ollama/configuration)
- [Price Per Token: best model for OpenClaw leaderboard](https://pricepertoken.com/leaderboards/openclaw)
- [haimaker.ai: best local LLMs for OpenClaw, ranked](https://haimaker.ai/blog/best-local-models-for-openclaw/)
- [Kimi K2.5 model repository](https://github.com/MoonshotAI/Kimi-K2.5)
- [Qwen3.6 in the Ollama library](https://ollama.com/library/qwen3.6)