Back to blog

Tools & integrationsGuide

How to connect OpenClaw to CheapTokens

Add CheapTokens as a custom provider in OpenClaw — through openclaw onboard or the openclaw.json config — and make it the default model for your agents.

By CheapTokens TeamPublished 1 min read

OpenClaw agent connected to the CheapTokens API
On this page
  1. Before you start
  2. Option 1. On a fresh install
  3. Option 2. Edit the config
  4. Check that it works

OpenClaw lets you add your own model provider. Add CheapTokens with its address, key and model, make it the default, and your agents run on open-weight models at fixed per-token prices. The steps follow the OpenClaw documentation (v2026.10.3, “Custom providers and local runtimes”); they have not been run on a live installation yet.

Before you start#

  • OpenClaw is installed.
  • You have a CheapTokens API key and a positive balance — see Your first API request.

Option 1. On a fresh install#

Run openclaw onboard and pick Custom provider. It asks for the address, the key and the model ID and writes the provider entry for you:

  • address: https://api.cheaptokens.dev/v1
  • key: your CheapTokens key
  • model ID: deepseek-ai/DeepSeek-V4-Flash-0731

Option 2. Edit the config#

With OpenClaw already set up, add the provider to ~/.openclaw/openclaw.json:

json5
{
  models: {
    providers: {
      cheaptokens: {
        baseUrl: "https://api.cheaptokens.dev/v1",
        apiKey: "your-cheaptokens-key",
        api: "openai-completions",
        models: [{ id: "deepseek-ai/DeepSeek-V4-Flash-0731", name: "DeepSeek-V4-Flash-0731" }],
      },
    },
  },
  agents: {
    defaults: { model: { primary: "cheaptokens/deepseek-ai/DeepSeek-V4-Flash-0731" } },
  },
}

api: "openai-completions" means the OpenAI-compatible protocol, with the address ending in /v1. The default model is written as provider/model ID; the split happens at the first /, so a model ID with a slash is fine. Other models: zai-org/GLM-5.3-Flash, MiniMaxAI/MiniMax-M2.7 — see GLM vs DeepSeek vs MiniMax.

Check that it works#

Start an agent with a short task. An answer means the setup is done; status codes are explained in Connection errors and fixes.

A daemon that runs around the clock resends long contexts all the time, so the bill grows with input tokens; you pay from a prepaid balance, and when it runs out the key pauses instead of running up a debt. How to estimate it: What an AI agent costs.