Home / Learn / Running Unlimited OpenClaw on Claude
Running Unlimited OpenClaw on Claude — OpenClaw Gateway Guide

Running Unlimited OpenClaw on Claude

OpenClaw is a multi-channel AI gateway that connects Claude to over 50 messaging channels through a hub-and-spoke architecture. Each channel is an independent inference endpoint — Telegram bots, Discord servers, Slack workspaces, web widgets, and custom integrations all route through a central gateway running on your infrastructure. With skills injected into system prompts and channels that never close, OpenClaw represents continuous, always-on API consumption that scales linearly with the number of active channels and users.

OpenClaw's Always-On Architecture

OpenClaw operates as a hub-and-spoke gateway. The hub is a central process (typically running on a VPS at port 18789) that manages model configuration, skill injection, and request routing. Spokes are channel connectors — each one maintains a persistent connection to a messaging platform and forwards incoming messages to the hub for inference.

Every channel is an open inference faucet. When a user sends a message on any connected platform, the channel connector forwards it to the hub, which constructs the full prompt (system prompt + skills + conversation history + user message), sends it to Claude, and streams the response back to the channel. There is no queuing or batching — every message gets immediate inference.

The gateway never sleeps. As long as the process is running, all 50+ channels are active and any incoming message triggers a Claude API call. Unlike interactive tools that consume tokens only when a developer is working, OpenClaw consumes tokens whenever any user on any channel sends a message — which on active deployments means hundreds or thousands of calls per day. This makes unlimited access not just convenient but economically necessary for serious deployments.

Provider Configuration in openclaw.json

OpenClaw's model configuration lives in ~/.openclaw/openclaw.json under the models.providers block. Each provider entry requires a name, api field (MUST be set to 'anthropic-messages' explicitly for Claude — it does not default), baseUrl pointing to your gateway, and apiKey for authentication. The api field controls which request format OpenClaw uses.

Set baseUrl to https://unlimited.aiprimetech.io (root host, no /v1 — the anthropic-messages handler appends the correct path). For apiKey, you can use direct values or environment variable interpolation with ${ENV_VAR} syntax. The interpolation is useful for keeping secrets out of the config file: set apiKey to '${UNLIMITED_API_KEY}' and export the variable in your shell or systemd unit.

You can also specify custom headers in the provider configuration. Use the headers field to pass anthropic-beta flags or custom routing headers. For example, headers: {'anthropic-beta': 'max-tokens-3-5-sonnet-2024-07-15'} enables extended output for supported models. On the unlimited gateway, standard headers work without modification.

Model Entries and the api Field Requirement

A critical gotcha in OpenClaw configuration: the api field in each model entry MUST be explicitly set to 'anthropic-messages'. If omitted, OpenClaw defaults to a generic completion format that is incompatible with Claude. This causes cryptic errors that look like connection failures but are actually format mismatches. Always include api: 'anthropic-messages' in every Claude model entry.

Define model entries under models.models in openclaw.json. Each entry references a provider by name and specifies the model ID. Create entries for each Claude variant: claude-sonnet-4-5 as the default for most channels, claude-opus-4-6 for channels that need deeper reasoning, and claude-haiku-4-5 for high-volume channels where speed matters more than depth.

Assign models to channels in the channel configuration. Each channel can use a different model — a customer support channel might use Sonnet for balanced responses, a technical channel might use Opus for complex explanations, and a notifications channel might use Haiku for quick acknowledgments. On unlimited, assign based on quality needs without cost considerations.

Hub-and-Spoke Gateway on Port 18789

The OpenClaw gateway typically runs on port 18789 (configurable in openclaw.json under server.port). It exposes a REST API that channel connectors use to submit messages and receive responses. The gateway handles prompt construction, model selection, conversation history management, and response streaming internally.

Deploy the gateway on a VPS with reliable uptime — it needs to be running 24/7 for channels to remain responsive. Use systemd or Docker to ensure automatic restart on crashes. The process is lightweight in CPU and memory; the bottleneck is always the upstream API call latency rather than local processing. A small VPS (1 CPU, 1 GB RAM) handles dozens of concurrent channels without issue.

The gateway maintains conversation histories in memory (configurable persistence to disk or Redis). Each active conversation across all channels has its own growing context. With 50 channels and multiple active users per channel, the gateway may maintain hundreds of concurrent conversation states. This context management is automatic — old conversations are pruned based on configurable TTL settings.

Skills Injection and System Prompt Management

OpenClaw's skills system injects capability-specific instructions into the system prompt for every request. Skills are defined as text files in the skills directory and can be assigned to specific channels or applied globally. Each skill adds context that helps Claude respond appropriately for that channel's purpose — customer support tone, technical documentation style, specific domain knowledge.

Every skill adds tokens to every request on every channel it is assigned to. A channel with five active skills might add 2,000-5,000 tokens to each request's system prompt before any conversation history is included. Across fifty channels with various skill configurations, the total skill overhead per day is substantial. On unlimited, this is a non-issue — write comprehensive skills without worrying about per-request cost.

Skills can include dynamic content through template variables. OpenClaw supports injecting user information, channel context, time-of-day, and custom variables into skill text. This dynamic injection happens at request time, ensuring skills always contain current information. The flexibility enables sophisticated per-channel behavior without complex routing logic.

Channel Configuration and Scaling

Each channel in OpenClaw is configured in the channels section of openclaw.json or in separate channel config files. A channel entry specifies the platform type (telegram, discord, slack, web, custom), authentication credentials for that platform, the model to use, assigned skills, and conversation management settings (history length, TTL, persona).

Scaling is linear: each new channel adds one more open inference endpoint. Adding a Telegram bot adds one channel. Adding a Discord server with multiple monitored channels might add ten. Each monitored Discord channel is a separate conversation stream with independent context. A large OpenClaw deployment with Discord, Telegram, Slack, and web widgets can easily have 50-100 active inference endpoints.

On per-token billing, scaling channels means scaling costs directly. Each new channel adds proportional API expense based on its message volume. On unlimited, you can scale channels freely up to fair-use rate limits. Add new platforms, new bots, new widgets — the flat rate covers all of them. The only constraint is the per-minute rate limit, which is generous enough for most multi-channel deployments.

Troubleshooting OpenClaw Deployments

The number one configuration error is forgetting api: 'anthropic-messages' in model entries. Without this field, OpenClaw sends requests in the wrong format and receives unintelligible errors from the API. If you see response parsing failures or unexpected 400 errors, check the api field first. It must be explicitly set — there is no correct default for Claude models.

If specific channels fail while others work, the issue is usually channel-level model assignment pointing to a model entry that does not exist or has a typo. OpenClaw does not validate model references at startup — it fails at request time when the channel tries to use the misconfigured model. Check that every channel's model reference matches an existing models.models entry name exactly.

For rate limit errors under heavy multi-channel load, remember that all channels share the same API key and rate limits. If fifty channels are all active simultaneously during peak hours, the combined request rate might exceed fair-use limits. The gateway handles 429 responses by queuing and retrying, which adds latency but does not lose messages. For very high-volume deployments, contact AI Prime Tech about increased rate allocations.

// ~/.openclaw/openclaw.json
{
  "models": {
    "providers": {
      "unlimited": {
        "api": "anthropic-messages",
        "baseUrl": "https://aiprimetech.io",
        "apiKey": "${UNLIMITED_API_KEY}"
      }
    },
    "models": {
      "sonnet": { "provider": "unlimited", "model": "claude-sonnet-4-5" },
      "opus":   { "provider": "unlimited", "model": "claude-opus-4-6" },
      "haiku":  { "provider": "unlimited", "model": "claude-haiku-4-5" }
    }
  },
  "server": { "port": 18789 }
}

# IMPORTANT: api: "anthropic-messages" is REQUIRED
# Without it, OpenClaw uses wrong request format

Frequently asked questions

Why must I set api to anthropic-messages explicitly?
OpenClaw does not default to any specific API format. Without api: 'anthropic-messages', it uses a generic completion format incompatible with Claude's Messages API. This causes request failures that look like connection errors but are actually format mismatches. Always set it explicitly for every Claude model entry.

How many channels can OpenClaw handle on unlimited?
There is no hard channel limit from the gateway side. The practical constraint is the fair-use rate limit — all channels share one API key. Most deployments with 50-100 channels stay well within limits during normal usage. During traffic spikes, the gateway queues excess requests and retries after the rate window resets.

Does each channel maintain separate conversation history?
Yes. Each channel and each user within a channel has independent conversation context. The gateway manages all histories in memory with configurable TTL. A deployment with 50 channels and multiple users per channel maintains hundreds of concurrent conversation states.

Can I use environment variable interpolation for the API key?
Yes. Set apiKey to '${ENV_VAR_NAME}' in openclaw.json and OpenClaw resolves it from the process environment at startup. This keeps secrets out of config files — useful for Docker deployments where secrets are injected via environment.

What happens if the gateway process crashes?
All channels disconnect and messages are lost until restart. Use systemd (Restart=always) or Docker (restart: unless-stopped) to ensure automatic recovery. Conversation histories stored only in memory are lost on crash — enable disk or Redis persistence for important deployments.

Start using Claude in minutes

Get an API key — no Anthropic account or waitlist required.

Get your API key

AI Prime Tech is an independent API gateway. It is not affiliated with, endorsed by, or a reseller of Anthropic. Claude and related model names are trademarks of their respective owners.