OpenClaw

One provider block in openclaw.json. Any model on the list.

Checked 2026-10-12

·All guides·Models

Where the settings are

~/.openclaw/openclaw.json. It is JSON5, so comments and trailing commas are fine. The Gateway watches the file and applies most changes on save; a few need a restart.

OpenClaw takes an OpenAI-compatible base URL under models.providers with api: "openai-completions". Every model on the Models page answers in that format, Claude included.

The provider block

mode: "merge" keeps the bundled providers next to yours. Model refs are provider/model, so the primary becomes uplinkswitch/claude-sonnet-5-5.

~/.openclaw/openclaw.json
{
  env: { vars: { UPLINKSWITCH_API_KEY: "sk-uplink-live-..." } },
  agents: {
    defaults: { model: { primary: "uplinkswitch/claude-sonnet-5-5" } },
  },
  models: {
    mode: "merge",
    providers: {
      uplinkswitch: {
        baseUrl: "https://api.uplinkswitch.com/v1",
        apiKey: "${UPLINKSWITCH_API_KEY}",
        api: "openai-completions",
        models: [
          { id: "claude-sonnet-5-5", name: "Claude Sonnet 5.5" },
          { id: "claude-opus-5-5", name: "Claude Opus 5.5" },
          { id: "gpt-6.1-sol", name: "GPT-6.1 Sol" },
          { id: "gemini-3.1-pro-preview", name: "Gemini 3.1 Pro" },
          { id: "deepseek-v4-pro-0813", name: "DeepSeek V4 Pro" },
          { id: "kimi-k3", name: "Kimi K3" },
        ],
      },
    },
  },
}

${UPLINKSWITCH_API_KEY} is read from the environment. Inline env.vars only apply when the process env lacks the key; ~/.openclaw/.env works as well. A missing variable stays unresolved and logs a warning.

Per-model fields

reasoning, input, cost, contextWindow and maxTokens are optional. Defaults: reasoning: false, input: ["text"], zero cost, no fixed output limit (so max_tokens is left out of the request) and a 200000-token context fallback. OpenClaw recommends explicit values. Set input to include "image" for models that take images, or attachments go in as text.

model entry
{
  id: "claude-sonnet-5-5",
  name: "Claude Sonnet 5.5",
  reasoning: true,
  input: ["text", "image"],
  // contextWindow and maxTokens: the model developer's published limits
}

Check it

shell
openclaw models list --provider uplinkswitch
openclaw models status

The first lists the ids you declared under UplinkSwitch. The second shows the resolved primary model and its auth. Then send a message; the request shows in the console within seconds.

To change the default later: openclaw models set uplinkswitch/gpt-6.1-sol.

Good to know

  • Only the ids in models[] are callable. agents.defaults.models holds aliases and metadata; it does not register a model on its own.
  • On a host other than OpenAI's, OpenClaw drops the developer role, service_tier, store flags and prompt-cache hints from the request. Those are OpenAI-only fields; the Models page lists each model's cache read price.
  • A model with reasoning: true sends reasoning_effort when thinking is on. Set compat.supportsReasoningEffort: false on the entry if that field is rejected.
  • Custom endpoints do not inherit a catalog route's Code Mode tier. Leave compat.codeMode alone unless you have tested it.