OpenClaw 集成

OpenClaw + TheRouter:全渠道 AI 智能体

为 OpenClaw 部署提供健康感知路由、多模态支持和 125+ 模型。自动故障切换、成本可视化、企业级安全。

为什么选择 TheRouter + OpenClaw

构建可靠、经济高效的全渠道 AI 智能体

自动故障切换

健康感知路由,瞬时切换供应商。某个供应商故障时,你的渠道保持在线,无需人工介入。

多模态就绪

全渠道支持视觉、音频、PDF 和视频。在 WhatsApp、Telegram、Discord、Slack 上运行丰富的多媒体工作流。

成本可视化

按渠道跟踪使用量,token 级别计费。实时查看每个机器人、渠道和对话的确切成本。

企业级安全

API 密钥隔离、审计日志、GDPR/CCPA 合规。默认零 prompt 存储。满足企业信任要求。

统一 API

单一 OpenAI 兼容端点访问 125+ 模型,覆盖 Anthropic、OpenAI、Google、Bedrock、xAI。无需供应商特定代码。

直连供应商

每个请求都访问真实供应商的真实模型。无替代、无池化、无中间商。每个请求都可验证。

跨供应商的多模态能力

在所有渠道上运行视觉、音频和文档工作流

AnthropicOpenAIGoogle (Vertex AI)BedrockxAI
文本
视觉
音频
PDF
视频

✓ = 完全支持 • = 部分支持 — = 不支持

全渠道 AI 驱动

一次构建,随处部署

微信

中国领先的商务和社交消息平台

WhatsApp

业务对话的丰富多媒体支持

Telegram

快速、安全的机器人,支持内联查询和 webhook

Discord

社区互动,支持斜杠命令和讨论串

Slack

工作场所自动化和团队协作

企业级安全与信任

为生产部署而构建,提供合规性、审计轨迹和隐私保障

API 密钥隔离

每层强制执行租户边界。无跨租户访问。

审计日志

完整的请求历史,包含渠道、模型、成本和延迟跟踪。

个人信息保护法 (PIPL) 合规

符合中国《个人信息保护法》、《数据安全法》和《网络安全法》要求。

零 Prompt 存储

请求体通过但默认不持久化。仅保留元数据。

几分钟即可开始

三步实现生产就绪的 OpenClaw 部署

1

注册并获取 API Key

创建 TheRouter 账号,从控制台生成 API key。

获取 API Key
2

安装 OpenClaw

全局安装或在项目中安装 OpenClaw 框架。

npm install -g openclaw
3

配置并部署

将 JSON5 配置复制粘贴到 OpenClaw 设置中,即可开始使用。

CLI 一键设置
openclaw onboard --non-interactive \
  --provider-name=therouter \
  --provider-type=openai \
  --provider-url=https://airouter-api.mizone.me/v1 \
  --provider-api-key=${THEROUTER_API_KEY} \
  --default-model=anthropic/claude-sonnet-4.6
OpenClaw 配置 (35 个模型)
展开完整配置 ▼
{
  // TheRouter OpenClaw Configuration
  // 35 curated models covering multimodal, reasoning, coding, and cost-effective use cases
  // Copy this entire block into your OpenClaw config file

  agents: {
    defaults: {
      model: {
        // Primary model for all agents
        primary: "anthropic/claude-sonnet-4.6",
        // Automatic fallback models if primary is unavailable
        fallbacks: [
          "openai/gpt-5.2",
          "google/gemini-3-flash-preview"
        ],
      },
    },
  },

  providers: [
    {
      name: "therouter",
      type: "openai",
      url: "https://api.therouter.ai/v1",
      // Set your API key via environment variable
      apiKey: "${THEROUTER_API_KEY}",

      models: [
        {
          "id": "anthropic/claude-opus-4.6",
          "name": "Claude Opus 4.6",
          "context_length": 1000000,
          "max_completion_tokens": 128000,
          "pricing": {
            "input": 0.000005,
            "output": 0.000025,
            "cache_read": 5e-7
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "long_context",
            "prompt_caching"
          ]
        },
        {
          "id": "anthropic/claude-sonnet-4.6",
          "name": "Claude Sonnet 4.6",
          "context_length": 1000000,
          "max_completion_tokens": 64000,
          "pricing": {
            "input": 0.000003,
            "output": 0.000015,
            "cache_read": 3e-7
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "long_context",
            "prompt_caching"
          ]
        },
        {
          "id": "anthropic/claude-haiku-4.5",
          "name": "Claude Haiku 4.5",
          "context_length": 200000,
          "max_completion_tokens": 8192,
          "pricing": {
            "input": 0.000001,
            "output": 0.000005,
            "cache_read": 1.0000000000000001e-7
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "tools",
            "cost_effective",
            "prompt_caching"
          ]
        },
        {
          "id": "anthropic/claude-sonnet-3.7",
          "name": "Claude Sonnet 3.7",
          "context_length": 200000,
          "max_completion_tokens": 16384,
          "pricing": {
            "input": 0.000003,
            "output": 0.000015,
            "cache_read": 3e-7
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "extended_thinking"
          ]
        },
        {
          "id": "anthropic/claude-opus-4.5",
          "name": "Claude Opus 4.5",
          "context_length": 200000,
          "max_completion_tokens": 64000,
          "pricing": {
            "input": 0.000005,
            "output": 0.000025,
            "cache_read": 5e-7
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "computer_use"
          ]
        },
        {
          "id": "openai/gpt-5.4",
          "name": "GPT-5.4",
          "context_length": 1000000,
          "max_completion_tokens": 128000,
          "pricing": {
            "input": 0.0000025,
            "output": 0.000015,
            "cache_read": 2.5e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "long_context",
            "prompt_caching"
          ]
        },
        {
          "id": "openai/gpt-5.2",
          "name": "GPT-5.2",
          "context_length": 400000,
          "max_completion_tokens": 128000,
          "pricing": {
            "input": 0.00000175,
            "output": 0.000014,
            "cache_read": 1.75e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "prompt_caching"
          ]
        },
        {
          "id": "openai/gpt-5-mini",
          "name": "GPT-5 Mini",
          "context_length": 400000,
          "max_completion_tokens": 128000,
          "pricing": {
            "input": 2.5e-7,
            "output": 0.000002,
            "cache_read": 2.5000000000000002e-8
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "cost_effective",
            "prompt_caching"
          ]
        },
        {
          "id": "openai/gpt-4.1",
          "name": "GPT-4.1",
          "context_length": 1047576,
          "max_completion_tokens": 32768,
          "pricing": {
            "input": 0.000002,
            "output": 0.000008,
            "cache_read": 5e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "tools",
            "long_context",
            "prompt_caching"
          ]
        },
        {
          "id": "openai/gpt-4.1-mini",
          "name": "GPT-4.1 Mini",
          "context_length": 1047576,
          "max_completion_tokens": 32768,
          "pricing": {
            "input": 4.0000000000000003e-7,
            "output": 0.0000016000000000000001,
            "cache_read": 1.0000000000000001e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "tools",
            "cost_effective",
            "long_context",
            "prompt_caching"
          ]
        },
        {
          "id": "openai/o3",
          "name": "o3",
          "context_length": 200000,
          "max_completion_tokens": 100000,
          "pricing": {
            "input": 0.000002,
            "output": 0.000008,
            "cache_read": 5e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "deep_reasoning"
          ]
        },
        {
          "id": "openai/o4-mini",
          "name": "o4-mini",
          "context_length": 200000,
          "max_completion_tokens": 100000,
          "pricing": {
            "input": 0.0000011,
            "output": 0.0000044,
            "cache_read": 2.75e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "cost_effective"
          ]
        },
        {
          "id": "openai/gpt-audio-1.5",
          "name": "gpt-audio-1.5",
          "context_length": 128000,
          "max_completion_tokens": 16384,
          "pricing": {
            "input": 0.000004,
            "output": 0.000016,
            "cache_read": 4.0000000000000003e-7
          },
          "modality": {
            "input": [
              "text",
              "audio",
              "image"
            ],
            "output": [
              "text",
              "audio"
            ]
          },
          "capabilities": [
            "vision",
            "audio_input",
            "audio_output",
            "tools",
            "multimodal"
          ]
        },
        {
          "id": "openai/gpt-5-codex",
          "name": "GPT-5-Codex",
          "context_length": 400000,
          "max_completion_tokens": 128000,
          "pricing": {
            "input": 0.00000125,
            "output": 0.00001,
            "cache_read": 1.25e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "coding",
            "prompt_caching"
          ]
        },
        {
          "id": "openai/gpt-5.3-codex",
          "name": "GPT-5.3-Codex",
          "context_length": 400000,
          "max_completion_tokens": 128000,
          "pricing": {
            "input": 0.000005,
            "output": 0.00004,
            "cache_read": 5e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "coding",
            "prompt_caching"
          ]
        },
        {
          "id": "openai/gpt-realtime-1.5",
          "name": "gpt-realtime-1.5",
          "context_length": 128000,
          "max_completion_tokens": 16384,
          "pricing": {
            "input": 0.000004,
            "output": 0.000016,
            "cache_read": 4.0000000000000003e-7
          },
          "modality": {
            "input": [
              "text",
              "audio",
              "image"
            ],
            "output": [
              "text",
              "audio"
            ]
          },
          "capabilities": [
            "vision",
            "audio_input",
            "audio_output",
            "tools",
            "realtime"
          ]
        },
        {
          "id": "google/gemini-3.1-pro-preview",
          "name": "Gemini 3.1 Pro Preview",
          "context_length": 1000000,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 0.000002,
            "output": 0.000012,
            "cache_read": 2.0000000000000002e-7
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "long_context",
            "prompt_caching"
          ]
        },
        {
          "id": "google/gemini-3-flash-preview",
          "name": "Gemini 3 Flash Preview",
          "context_length": 1000000,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 5e-7,
            "output": 0.000003,
            "cache_read": 5.0000000000000004e-8
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "tools",
            "long_context",
            "cost_effective",
            "prompt_caching"
          ]
        },
        {
          "id": "google/gemini-3.1-flash-lite-preview",
          "name": "Gemini 3.1 Flash Lite Preview",
          "context_length": 1000000,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 2.5e-7,
            "output": 0.0000015,
            "cache_read": 2.5000000000000002e-8
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "tools",
            "long_context",
            "cost_effective",
            "prompt_caching"
          ]
        },
        {
          "id": "google/gemini-2.5-pro",
          "name": "Gemini 2.5 Pro",
          "context_length": 1048576,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 0.00000125,
            "output": 0.00001,
            "cache_read": 1.25e-7
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "long_context",
            "thinking",
            "prompt_caching"
          ]
        },
        {
          "id": "google/gemini-2.5-flash",
          "name": "Gemini 2.5 Flash",
          "context_length": 1048576,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 3e-7,
            "output": 0.0000025,
            "cache_read": 3e-8
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "long_context",
            "thinking",
            "prompt_caching"
          ]
        },
        {
          "id": "google/gemini-2.5-flash-lite",
          "name": "Gemini 2.5 Flash Lite",
          "context_length": 1048576,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 1.0000000000000001e-7,
            "output": 4.0000000000000003e-7,
            "cache_read": 1e-8
          },
          "modality": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "tools",
            "long_context",
            "cost_effective",
            "prompt_caching"
          ]
        },
        {
          "id": "google/gemini-3.1-flash-image-preview",
          "name": "Gemini 3.1 Flash Image Preview",
          "context_length": 131072,
          "max_completion_tokens": 32768,
          "pricing": {
            "input": 5e-7,
            "output": 0.00006
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text",
              "image"
            ]
          },
          "capabilities": [
            "vision",
            "image_generation",
            "multimodal"
          ]
        },
        {
          "id": "xai/grok-4",
          "name": "Grok 4",
          "context_length": 256000,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 0.0000045,
            "output": 0.0000225,
            "cache_read": 0.000001125
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "deep_reasoning"
          ]
        },
        {
          "id": "xai/grok-4-1-fast-reasoning",
          "name": "Grok 4.1 Fast Reasoning",
          "context_length": 2000000,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 3e-7,
            "output": 7.5e-7,
            "cache_read": 7.5e-8
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "long_context",
            "prompt_caching"
          ]
        },
        {
          "id": "xai/grok-code-fast-1",
          "name": "Grok Code Fast 1",
          "context_length": 256000,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 3e-7,
            "output": 0.00000225,
            "cache_read": 3e-8
          },
          "modality": {
            "input": [
              "text"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "reasoning",
            "tools",
            "coding"
          ]
        },
        {
          "id": "deepseek/deepseek-v3.2",
          "name": "DeepSeek V3.2",
          "context_length": 128000,
          "max_completion_tokens": 32768,
          "pricing": {
            "input": 8.000000000000001e-7,
            "output": 0.0000024
          },
          "modality": {
            "input": [
              "text"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "reasoning",
            "tools",
            "coding",
            "cost_effective"
          ]
        },
        {
          "id": "deepseek/deepseek-r1",
          "name": "DeepSeek R1",
          "context_length": 128000,
          "max_completion_tokens": 32768,
          "pricing": {
            "input": 0.00000175,
            "output": 0.000007
          },
          "modality": {
            "input": [
              "text"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "reasoning",
            "deep_reasoning",
            "chain_of_thought",
            "coding"
          ]
        },
        {
          "id": "meta/llama-4-maverick",
          "name": "Llama 4 Maverick",
          "context_length": 1000000,
          "max_completion_tokens": 16384,
          "pricing": {
            "input": 3e-7,
            "output": 0.00000125
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "tools",
            "long_context",
            "multilingual"
          ]
        },
        {
          "id": "meta/llama-4-scout",
          "name": "Llama 4 Scout",
          "context_length": 10000000,
          "max_completion_tokens": 16384,
          "pricing": {
            "input": 2.2e-7,
            "output": 8.5e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "tools",
            "extreme_context",
            "multilingual"
          ]
        },
        {
          "id": "meta/llama-3.2-90b",
          "name": "Llama 3.2 90B Vision",
          "context_length": 128000,
          "max_completion_tokens": 8192,
          "pricing": {
            "input": 9.000000000000001e-7,
            "output": 9.000000000000001e-7
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "multimodal"
          ]
        },
        {
          "id": "qwen/qwen3-235b",
          "name": "Qwen3 235B",
          "context_length": 131072,
          "max_completion_tokens": 32768,
          "pricing": {
            "input": 3e-7,
            "output": 0.00000115
          },
          "modality": {
            "input": [
              "text"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "reasoning",
            "tools",
            "multilingual",
            "thinking"
          ]
        },
        {
          "id": "qwen/qwen3-coder-480b",
          "name": "Qwen3 Coder 480B",
          "context_length": 262144,
          "max_completion_tokens": 65536,
          "pricing": {
            "input": 6e-7,
            "output": 0.00000235
          },
          "modality": {
            "input": [
              "text"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "tools",
            "coding",
            "long_context"
          ]
        },
        {
          "id": "mistral/mistral-large-3",
          "name": "Mistral Large 3",
          "context_length": 128000,
          "max_completion_tokens": 16384,
          "pricing": {
            "input": 6.5e-7,
            "output": 0.000002
          },
          "modality": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "vision",
            "reasoning",
            "tools",
            "multilingual"
          ]
        },
        {
          "id": "mistral/devstral-2",
          "name": "Devstral 2",
          "context_length": 128000,
          "max_completion_tokens": 16384,
          "pricing": {
            "input": 5.5e-7,
            "output": 0.0000026
          },
          "modality": {
            "input": [
              "text"
            ],
            "output": [
              "text"
            ]
          },
          "capabilities": [
            "tools",
            "coding"
          ]
        }
      ],
    },
  ],
}
查看完整配置和模型

或安装 TheRouter 技能

支持 Claude Code、OpenClaw、Cursor、Gemini CLI 及 30+ 智能体工具

clawhub install therouter-api
npx @skill-hub/cli install therouter-api

常见问题

关于在 OpenClaw 部署中使用 TheRouter 的常见问题

准备好开始了吗?

注册 TheRouter 并在几分钟内连接您的 OpenClaw 部署。无需信用卡即可开始。