Introducing ModelTunnel AI Native Cloud: Better frontier models, faster runs, lower costs →

Integrating OpenClaw

OpenClaw is an open-source personal AI agent that runs on your machine and talks to you through Telegram, Discord, WhatsApp and other channels. Because ModelTunnel is OpenAI-compatible, you can register it as a custom model provider and use every ModelTunnel model inside OpenClaw.

Prefer a graphical app? ModelTunnel Claw is a ready-to-use desktop build of OpenClaw with ModelTunnel preconfigured.

Prerequisites

  • OpenClaw installed (npm install -g openclaw and openclaw onboard).
  • A ModelTunnel API key from the API page.

Option 1 — one-click script

The script adds ModelTunnel as a provider, registers the recommended models and sets the default model. It only edits ~/.openclaw/openclaw.json and backs it up first.

curl -fsSL https://modeltunnel.ai/install/openclaw.sh | DEEPNEXUS_API_KEY=sk-dn-... bash

Then restart the gateway:

openclaw gateway restart

Option 2 — manual configuration

Open ~/.openclaw/openclaw.json and add a provider under models.providers:

{
  "models": {
    "mode": "merge",
    "providers": {
      "deepnexus": {
        "baseUrl": "https://modeltunnel.ai/v1",
        "apiKey": "sk-dn-...",
        "api": "openai-completions",
        "models": [
          { "id": "deepseek-v4.1-flash", "name": "DeepSeek-V4.1-Flash", "contextWindow": 128000, "maxTokens": 8192 },
          { "id": "deepseek-v4-pro", "name": "DeepSeek-V4-Pro", "contextWindow": 128000, "maxTokens": 8192 },
          { "id": "glm-5.3", "name": "GLM-5.3", "contextWindow": 200000, "maxTokens": 8192 },
          { "id": "kimi-k3", "name": "Kimi-K3", "contextWindow": 256000, "maxTokens": 8192 }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": { "primary": "deepnexus/deepseek-v4.1-flash" }
    }
  }
}

Restart the gateway and check that the models are listed:

openclaw gateway restart
openclaw models list | grep deepnexus

Switching models

In any chat with your agent, send /model deepnexus/deepseek-v4-pro to switch for that session, or change agents.defaults.model.primary to make it the default.

Troubleshooting

SymptomFix
401 Invalid API keyCheck the apiKey value and that the key hasn't been deleted on the API page.
402 Insufficient balanceTop up your account.
Model not foundUse an ID from Language Models; IDs are case-sensitive in OpenClaw.
No reply in Telegram / DiscordRun openclaw logs and confirm the gateway restarted after editing the config.
Integrating OpenClaw · ModelTunnel