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

# OpenClaw

> Run OpenClaw on RedPill through Private AI Proxy, or configure it by hand.

OpenClaw speaks Chat Completions. Private AI Proxy configures it automatically.

## With Private AI Proxy

1. Install [Private AI Proxy](/get-started/private-ai-proxy), sign in, and turn on **Protected**.
2. On the **Agents** screen, connect **OpenClaw**.
3. Restart OpenClaw; it reads the native-host provider and local token on start.

The app writes a native-host provider into OpenClaw's gateway configuration with an agent-scoped
token for its local API, and restores the file when you disconnect or stop Protected.

From the CLI, the same connection is:

```bash theme={null}
pap agents connect openclaw
```

## Without the Proxy

Merge a named provider into the gateway configuration and keep your existing agent, channel, tool,
and provider settings. Export the key where the OpenClaw gateway process can read it.

```bash theme={null}
export REDPILL_AI_API_KEY="YOUR_API_KEY"
```

```json5 ~/.openclaw/openclaw.json theme={null}
{
  agents: { defaults: { model: { primary: "redpill/z-ai/glm-5.2" } } },
  models: {
    mode: "merge",
    providers: {
      redpill: {
        baseUrl: "https://api.redpill.ai/v1",
        apiKey: "${REDPILL_AI_API_KEY}",
        api: "openai-completions",
        models: [
          { id: "z-ai/glm-5.2", name: "GLM 5.2", reasoning: true, input: ["text"],
            contextWindow: 1048576, maxTokens: 131072 },
        ],
      },
    },
  },
}
```

This changes the main model loop only; image, speech, embedding, search, and browser providers stay
separate. This path does not verify ACI locally. For confidential-only routing, use an
`is_tee: true` model with `https://tee.redpill.ai/v1`. See
[Verified ACI clients](/guides/verified-aci-client).

## Check the connection

Run `openclaw config validate` and `openclaw models list`, confirm the RedPill model is listed, then
run one harmless tool task.

## Troubleshooting

| Symptom                    | Check                                                                               |
| -------------------------- | ----------------------------------------------------------------------------------- |
| OpenClaw ignores the Proxy | Confirm **Connected** in the app and that Protected is on, then restart OpenClaw.   |
| Configuration is rejected  | Run `openclaw config validate` and preserve JSON5 syntax.                           |
| Key is unavailable         | Export `REDPILL_AI_API_KEY` for the gateway process, not only an interactive shell. |

## References

* [OpenClaw model providers](https://docs.openclaw.ai/concepts/model-providers)
* [OpenClaw configuration](https://docs.openclaw.ai/gateway/configuration)
* [RedPill model catalog](/api-reference/models)
