Back to guides
Compare·September 17, 2026·6 min read

Best API for OpenClaw: choose a provider and model by task

Choose the provider and model that fit the work, then separate routine checks from complex tasks.

Last reviewed on .

To choose the best API for OpenClaw, start with a documented model provider. Choose OpenRouter for model variety, direct Anthropic for a focused Claude setup, and compare Kunavo when the model rate is your main buying criterion. For the cheapest sustainable setup, separate routine checks from difficult work instead of sending every task to one expensive model.

This guide compares the LLM API that produces the assistant's responses and tool calls. Search, browsing, and image services are separate purchases. For hosting and the complete operating bill, see OpenClaw pricing.

Choose the provider by what you are buying

OptionBest fitBuying tradeoff
Direct model vendor, such as AnthropicYou know which model family you wantVendor account, rates, and features; another family needs another connection
OpenRouterYou want broad model choice and provider routingInspect each model's rates, available providers, and routing preferences
KunavoYou want its listed Claude, GPT, or Gemini models at the published API ratesUse a custom provider; confirm the selected API and tool workflow before migrating
Free hosted modelsExploration and work that can tolerate interruptionsRequest limits, model availability, and supported features constrain use
Local inferenceYou have suitable hardware and want to operate the model locallyHardware capacity, latency, maintenance, and tool support become your responsibility

OpenClaw publishes a provider directory, an OpenRouter setup guide, and a separate custom-provider reference. A gateway listed in a price table is not automatically a built-in OpenClaw integration.

Use different models for different jobs

For short summaries, classification, and bounded heartbeat checks, start with Claude Haiku 4.5. For ordinary coding and tool work, shortlist Claude Sonnet 5. For complex repository changes and extended reasoning, shortlist Claude Opus 5. These starting points follow Anthropic's model-selection guidance; they are not OpenClaw benchmark results.

Make the escalation rule explicit. A routine check can report a known status or hand an unfamiliar condition to the stronger model. It should not silently grow into a large debugging task. If the check only compares a value with a threshold, run that comparison directly and reserve the model for interpreting exceptions.

Capability tier and provider price are separate decisions. Compare the actual row for the model you want; a gateway's rates need not follow the same ordering as the vendor's list prices.

A concrete price comparison

Compare the same model across providers. The table shows USD per million standard uncached input and output tokens: Anthropic's direct API prices checked September 17, 2026, beside current Kunavo catalog rates. Cache charges, paid tools, and taxes are separate.

ModelDirect Anthropic: input / outputKunavo: input / outputCandidate role
Claude Haiku 4.5$1.00 / $5.00$0.40 / $2.00Routine, bounded work
Claude Sonnet 5$2.00 / $10.00$2.00 / $10.00Everyday coding and tool use
Claude Opus 5$5.00 / $25.00$2.00 / $10.00Complex tasks and escalation

Suppose your month contains 10 million uncached input tokens and 1 million output tokens. Putting all of them on Claude Opus 5 costs $30.00 at these rates. Allocating 9 million input and 900,000 output tokens to Claude Haiku 4.5, with the remainder on Claude Opus 5, costs $8.40.

This is arithmetic for an assumed workload split, not a promised saving. It excludes cache charges, external tools, and infrastructure, and assumes the smaller model can complete its assigned work without extra attempts. That last condition determines whether the lower rate produces a lower bill.

Budget the first payment and recurring context

Kunavo starts with a $10 prepaid top-up, with no required subscription and a balance that does not expire. A small task consumes part of that balance; its token cost is not the cash required to open a funded account. The billing guide also explains why a catalog estimate is not a price ceiling: the final charge can be higher when upstream-cost billing exceeds that estimate.

OpenRouter's credit terms set a $5 minimum purchase. Its standard pay-as-you-go card fee is 5.5%, with a $0.80 minimum per top-up. That makes $5 of credits cost $5.80 before tax, or $100 cost $105.50. The fee is paid when funding the account, not added again to every API call. Compare funded credit you will actually consume.

For an assistant that repeatedly sends the same instructions, compare reported cache hits before choosing on fresh-input price. Direct Sonnet 5 costs $0.20 per million cache-read tokens, $2.50 for five-minute writes, and $4 for one-hour writes; Kunavo's catalog cache-read rate for the same model is $0.20. Its Claude cache writes bill at 1.25 times the input rate. These billing rates do not establish that every OpenClaw route uses caching: verify the returned usage before budgeting routine checks as cache hits.

Anthropic's pricing includes the supported 1M context window at standard rates for Sonnet 5 and Opus 5; Kunavo has no long-context surcharge for these Claude models either. Longer history still means more billed tokens. Keep recurring checks bounded, and include fresh input, cache writes, cache reads, and output separately in a monthly estimate.

When OpenRouter, free, or local is the better purchase

Choose OpenRouter when you need to compare model families or control upstream provider preferences. Its routing documentation supports priorities such as price, latency, and throughput. Select a concrete model and inspect its live pricing instead of assuming an automatic route always chooses the cheapest acceptable result.

Use free endpoints for initial exploration or non-urgent work. OpenRouter documents free-model request limits, so a zero token price does not establish enough capacity for an always-on assistant. Avoid making a time-sensitive routine depend on an allowance you have not checked.

Choose local inference when the hardware is already available and operating it is acceptable. OpenClaw's Ollama setup checks model capabilities, including tool support. A model that chats well but cannot execute the required tool workflow is not a useful bargain for that job.

Buy one working route before adding fallback complexity

First choose the model role and provider. Confirm the model ID, endpoint, streaming, tool calls, and usage reporting with one bounded task. Then add fallback routes with a known budget; otherwise a failure can quietly move work to a different price or capability tier.

Configure a Kunavo route in OpenClaw

This is a text-only starting configuration based on OpenClaw's custom-provider schema and Kunavo's Messages endpoint. It has not been validated here with a paid OpenClaw task. Keep your current working route available during the trial.

  1. Create a Kunavo key in API keys and fund the account at billing when ready to send paid requests.
  2. Set KUNAVO_API_KEY in the gateway's environment. OpenClaw also reads ~/.openclaw/.env, where you can add KUNAVO_API_KEY=your-key; an existing process variable takes precedence. See the environment reference. Keep the real key out of project files.
  3. Back up your configuration, then merge the fields below into ~/.openclaw/openclaw.json, preserving your other providers, agents, and channels. The configuration guide covers non-default file locations.
Merge these fields into ~/.openclaw/openclaw.json
{
  "models": {
    "mode": "merge",
    "providers": {
      "kunavo": {
        "baseUrl": "https://api.kunavo.com",
        "apiKey": "${KUNAVO_API_KEY}",
        "api": "anthropic-messages",
        "authHeader": true,
        "models": [
          {
            "id": "claude-haiku-4-5",
            "name": "Claude Haiku 4.5",
            "input": [
              "text"
            ],
            "contextWindow": 200000,
            "maxTokens": 1024
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "kunavo/claude-haiku-4-5"
      }
    }
  }
}

The base URL is the origin: this adapter appends /v1/messages. The kunavo/ prefix identifies the OpenClaw provider; the request's model ID remains claude-haiku-4-5. Here 1024 is a deliberately small output cap for the first trial, not the model's native maximum. The example only declares text input.

After saving a valid configuration
openclaw config validate
openclaw gateway restart
openclaw models list --provider kunavo

Config validation checks configuration, while model listing checks the loaded catalog; neither proves a paid task works. Restart before listing so a running gateway loads the new provider. Open a fresh session and confirm its active model: an existing session or agent can retain an override of the default.

For the first task, ask it to read a small scratch README and summarize it, then ask one follow-up about that file. Check the tool result, response streaming, and the recorded charge in Kunavo before moving scheduled work. A 401 calls for checking the key in the gateway environment; a model-not-found error calls for checking the provider prefix and model ID. Missing local cost metadata can show a zero estimate even when the provider billed the request.

FAQ

What is the best API for OpenClaw?

Choose a directly documented provider such as Anthropic when you want one model vendor and a straightforward setup. Choose OpenRouter when broad model selection and provider routing are central requirements. Consider Kunavo when its published rates fit your selected models, with a custom-provider verification step. Use local inference when you can operate the hardware and the model meets your tool-use requirements.

What is the cheapest model for OpenClaw?

Free model endpoints can have a zero inference price but also usage limits and availability constraints. For paid work, choose the least expensive model that completes the task with acceptable review effort. Haiku 4.5 is a concrete candidate for bounded routine work; a stronger model may be more economical for a difficult task if it avoids repeated failed attempts.

Can I use a cheap model for heartbeat checks?

Yes, if the check has a bounded input and a clear decision, and the chosen model supports the required tools. Keep complex coding or open-ended investigation on a separate route. A deterministic status check may not need a model at all.

Is a search API the API OpenClaw uses to think?

No. The main model API generates responses and tool calls. A web-search API supplies information as a tool and may have a separate bill. Buying search credits does not fund the assistant's model requests.

Official documentation checked September 17, 2026. Kunavo rates and illustrative totals are calculated from the live model catalog.