STOP WASTING PAID TOKENS. START POOLING ACCOUNTS TODAY. [ GET YOUR VAULT ]

Connect OpenClaw to SpiderGate

Who this is for: anyone running OpenClaw who wants its agents to send model calls through SpiderGate.

What this does: walks you through adding SpiderGate to ~/.openclaw/openclaw.json as a custom provider and making a SpiderGate model your default.

Before you begin

  • OpenClaw installed, with its gateway running.

  • Permission to mint agent tokens for your brand in SpiderGate.

  • About 5 minutes.

Steps

Step 1 — Mint an agent token

In SpiderGate, open Keys (/dashboard/gate/keys) and choose Connect an agent. Name it after the tool, set its limits, and create it. Copy the token now: SpiderGate shows it exactly once. See Agent Keys for budgets and scopes; the tool needs gate:chat and gate:models, which new tokens have by default.

Agent tokens expire, by default after 30 days. Note the date, and mint a new one before then.

Step 2 — Add SpiderGate as a provider

OpenClaw reads a JSON5 config at ~/.openclaw/openclaw.json and applies edits automatically. Add a provider under models.providers. SpiderGate speaks Chat Completions, so use api: "openai-completions":

{
  env: { vars: { SPIDERGATE_API_KEY: "YOUR_SPIDERGATE_TOKEN" } },
  agents: {
    defaults: {
      model: { primary: "spidergate/spideriq/coding" },
    },
  },
  models: {
    mode: "merge",
    providers: {
      spidergate: {
        baseUrl: "https://spideriq.ai/api/gate/v1",
        apiKey: "${SPIDERGATE_API_KEY}",
        api: "openai-completions",
        models: [
          { id: "spideriq/coding", name: "SpiderGate coding" },
        ],
      },
    },
  },
}

OpenClaw needs each custom model listed in models[] with at least its id. Use a task alias such as spideriq/coding, or one of your own routing aliases.

Step 3 — Set the default model

OpenClaw splits a model reference on the first /, so spidergate/spideriq/coding means provider spidergate, model spideriq/coding. The config above already sets it as the default; to change it later, run:

openclaw models set spidergate/spideriq/coding

Tip: If you do not set a context window on the model, OpenClaw assumes 200,000 tokens. Set contextWindow on the model entry to the real limit of the model behind your alias.

Warning: If the model you name is one of your own routing aliases backed by a coding-plan key (Z.ai, Alibaba Qwen, BytePlus, MiniMax), automated traffic from this tool can break that provider's plan terms. Back any alias an automation calls with pay-as-you-go keys.

Verify it worked

Ask your OpenClaw agent something short. Open Traces in the SpiderGate dashboard (Traces). Your request appears under the agent token you minted, with the model that served it.

Troubleshoot

The request fails with "unsupported field" or a 400 on reasoning_effort. OpenClaw sends reasoning_effort for models you mark reasoning: true. Set compat.supportsReasoningEffort: false on that model entry.

OpenClaw does not show token usage while streaming. OpenClaw does not ask unknown endpoints for streaming usage. Set compat.supportsUsageInStreaming: true on each SpiderGate model entry.

A 401 from SpiderGate. The token is wrong or expired. Mint a new one (Step 1) and update SPIDERGATE_API_KEY.

Related