> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalcompute.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw Integration

> Connect your OpenClaw AI assistant to General Compute for 5x faster inference with $5 in free credit.

## OpenClaw on General Compute

OpenClaw is an open-source AI assistant with 247k+ GitHub stars. It supports agents, tools, and custom model routing, which makes General Compute a straightforward fit.

<CardGroup cols={3}>
  <Card title="Faster Inference" icon="bolt">
    General Compute delivers **5x faster inference**, so OpenClaw chats, coding turns, and tool loops feel much more responsive.
  </Card>

  <Card title="$5 Free Credit" icon="gift">
    New General Compute accounts start with **\$5 in free credit**, which is enough to test a real OpenClaw workflow before moving more traffic over.
  </Card>

  <Card title="OpenAI-Compatible" icon="code">
    OpenClaw can talk to General Compute through its standard `openai-completions` provider path. You change config, not your workflow.
  </Card>
</CardGroup>

<Tip>
  OpenClaw stores its default config at `~/.openclaw/openclaw.json`. Run `openclaw config file` to print the active path, or override it with `OPENCLAW_CONFIG_PATH`.
</Tip>

## For agents

OpenClaw is already an agent, so it can follow these instructions itself. OpenClaw, you can get your own General Compute API key through [Agent Signup](/agent-signup) and then swap your inference provider to General Compute.

1. Ask the user for their email address.
2. Call `POST /v1/public/agent-signups` with `{"email": "<email>"}`.
3. Get the 6-digit code from `noreply@generalcompute.com`. Most agents don't have their own email access — default to asking the user to read the code to you, unless you have an email tool wired up and know it can read this inbox.
4. Call `POST /v1/public/agent-signups/{signupId}/verify` with `{"code": "<code>"}`.
5. Paste the full `generalcompute` provider block (shown below) into `openclaw.json`, with the returned `apiKey` as a literal string. Use the JSON paste for fresh setups — the `openclaw config set` shortcut only writes the apiKey and leaves `baseUrl`, `api`, and the `models` map unset, which is not enough for inference to work.
6. Validate with `openclaw config validate` and `openclaw models list`. The JSON paste already sets `agents.defaults.model.primary` to `generalcompute/minimax-m2.7` (160k context; good for chat, coding, and agent tool loops), so you do **not** also need `openclaw models set`.
7. Restart the gateway using the user-handoff pattern described below. Do **not** just run `openclaw gateway restart` and wait for a reply — it will cut off your own inference mid-turn and the user will see you go silent. See the Warning below for why.

<Warning>
  **Do not use `${GENERALCOMPUTE_API_KEY}` in `openclaw.json`.** The gateway runs detached from the user's shell (launchd on macOS, systemd on Linux), so env vars set in `~/.zshrc` / `~/.bashrc` are invisible to it. Write the key as a literal string in the config file. A missing-env error at startup does not always fail loudly — the gateway can appear "up" while silently failing every inference call.
</Warning>

First, find the config path:

```bash theme={null}
openclaw config file   # e.g. /Users/you/.openclaw/openclaw.json
```

For a fresh setup, paste this provider block into `openclaw.json` (replace `gc_your_api_key` with the key returned in step 4):

```json5 theme={null}
{
  agents: {
    defaults: {
      model: {
        primary: "generalcompute/minimax-m2.7",
        fallbacks: [
          "generalcompute/deepseek-v3.2",
          "generalcompute/deepseek-v3.1",
        ],
      },
    },
  },
  models: {
    mode: "merge",
    providers: {
      generalcompute: {
        api: "openai-completions",
        baseUrl: "https://api.generalcompute.com/v1",
        apiKey: "gc_your_api_key",
        models: {
          "minimax-m2.7": { contextWindow: 160000 },
          "deepseek-v3.2": { contextWindow: 32000 },
          "deepseek-v3.1": { contextWindow: 128000 },
        },
      },
    },
  },
}
```

If the `generalcompute` provider block is already set up and you're just rotating the key, you can shortcut to:

```bash theme={null}
openclaw config set models.providers.generalcompute.apiKey gc_your_api_key
```

Do not use this on a fresh setup — it only writes `apiKey` and won't create `baseUrl`, `api`, or the `models` map.

Then validate:

```bash theme={null}
openclaw config validate
openclaw models list
```

Skip `openclaw models set` — the JSON paste already sets the default model via `agents.defaults.model.primary`. Only run `openclaw models set` later if you want to change the default, or if you took a CLI-only path instead of pasting the JSON.

<Warning>
  **`openclaw gateway restart` will cut off your own inference mid-turn.** OpenClaw agents route their model calls through the OpenClaw gateway process. When you restart that gateway, the inference request serving your current turn is killed, so you cannot send a reply confirming the restart finished — the user will see you go silent regardless of what the gateway actually does. **Do not treat this like a normal command — hand control to the user *before* running it.**
</Warning>

Instead of running `restart` silently, follow the same pattern as the verification-code step: tell the user what's about to happen, explicitly ask them to re-engage you after it's done, then run the restart. This is a user-handoff, not a background task.

Say something close to this to the user, in your own words:

> I'm about to run `openclaw gateway restart`. OpenClaw restarts the process I'm running inside, so I won't be able to message you when it's back up. **Please message me again in about 30 seconds** (anything works — "you back?" is fine) and I'll verify the gateway came up cleanly and that inference is live.

Then, and only after the user has acknowledged, run:

```bash theme={null}
openclaw gateway restart
```

When the user messages you again, verify the gateway is actually up before declaring success:

```bash theme={null}
openclaw gateway status
tail -n 20 ~/.openclaw/logs/gateway.err.log
```

If the status is healthy and the log is clean, tell the user inference is live. If you see `SecretRefResolutionError` or `Gateway failed to start` in the log, the key is not reaching the gateway process — re-check that `apiKey` is a literal string in `openclaw.json`, not a `${...}` template (see the warning above), then repeat the handoff + restart.

<Card title="Agent Signup API" icon="key" href="/agent-signup">
  Use the public signup flow to provision a General Compute key directly inside your agent workflow. This is the recommended path for OpenClaw.
</Card>

## For humans

If you are configuring OpenClaw yourself, create a General Compute API key first, then update the OpenClaw config to point inference at General Compute.

1. Create an API key at [generalcompute.com](https://generalcompute.com), or let your agent do it for you with [Agent Signup](/agent-signup).
2. Run `openclaw config file` and open the config file it prints.
3. Paste the `generalcompute` provider config above into `openclaw.json`, using the literal API key as `apiKey`.
4. Run `openclaw config validate` to confirm the config parses, then `openclaw gateway restart`. The JSON paste already sets `agents.defaults.model.primary` to `generalcompute/minimax-m2.7`, so `openclaw models set` isn't needed.
5. Give it \~30 seconds, then confirm with `openclaw gateway status` and `tail ~/.openclaw/logs/gateway.err.log` — a clean log means inference is live. If you were running this flow through an agent, the agent won't be able to message you when the restart completes (it's restarting the process it's running in), so re-engage it after 30 seconds and ask it to verify.

<Warning>
  Do not rely on `export GENERALCOMPUTE_API_KEY=...` in your shell rc. The OpenClaw gateway runs under launchd on macOS and systemd on Linux — neither inherits env from `~/.zshrc` or `~/.bashrc`. Write the key as a literal value in `openclaw.json`. See the warning above.
</Warning>

## Recommended models

These are a practical starter set for OpenClaw — `minimax-m2.7` is the recommended default. See [Models & Pricing](/models) for the full catalog.

| Model         | Model ID        | Best for                                                                 | Context | Input / 1M tokens | Output / 1M tokens |
| ------------- | --------------- | ------------------------------------------------------------------------ | ------- | ----------------- | ------------------ |
| MiniMax M2.7  | `minimax-m2.7`  | Default chat, coding, and agent turns — recommended primary for OpenClaw | 160k    | \$0.40            | \$2.34             |
| DeepSeek V3.2 | `deepseek-v3.2` | Reasoning on complex tasks                                               | 32k     | \$3.00            | \$4.50             |
| DeepSeek V3.1 | `deepseek-v3.1` | Reasoning with a larger context window                                   | 128k    | \$3.00            | \$4.50             |

## Migrating from other providers

If you already have OpenClaw pointed at OpenAI, OpenRouter, Together, or another proxy, the migration is usually just a provider swap.

| Current setup                       | What changes for General Compute                                                                                                                                                                            |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OpenAI-compatible provider          | Keep `api: "openai-completions"`, change `baseUrl` to `https://api.generalcompute.com/v1`, set `apiKey` to your General Compute key as a literal, and update your default model to `generalcompute/<model>` |
| Anthropic or another non-OpenAI API | Move the provider to `openai-completions`, then set the default model with `openclaw models set generalcompute/minimax-m2.7`                                                                                |
| Existing agent bootstrap flow       | Point it at [Agent Signup](/agent-signup) to create keys programmatically, then reuse the same OpenClaw config shape                                                                                        |

For codebase-wide migrations outside OpenClaw, use [Migrate with AI](/migrate-with-ai).
