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

# OpenClaw

> Connect OpenClaw to PipeLLM with a custom provider

For routing rules, see [Routing & Protocols](/guides/routing-protocols). For
available model IDs, see [List Models](/api-reference/list-models).

OpenClaw supports custom providers in `~/.openclaw/openclaw.json`. For PipeLLM,
the simplest broad-coverage setup is an OpenAI-compatible custom provider that
points at PipeLLM's OpenAI converter route.

## Recommended Route

```text theme={null}
https://api.pipellm.ai/openai/v1
```

If you specifically want Anthropic Messages semantics, OpenClaw can also target
`https://api.pipellm.ai/anthropic` with `api: "anthropic-messages"`.

## Fastest Setup

Use the onboarding wizard:

1. Run `openclaw onboard`
2. Choose `Custom Provider`
3. Choose `OpenAI-compatible`
4. Set base URL to `https://api.pipellm.ai/openai/v1`
5. Paste your PipeLLM API key
6. Enter a model ID such as `claude-sonnet-4-6`, `gpt-4o`, or
   `gemini-2.5-pro`

## Manual Config

OpenClaw uses JSON5, so comments and trailing commas are allowed.

```json5 theme={null}
{
  env: {
    PIPELLM_API_KEY: "your-pipellm-api-key",
  },
  agents: {
    defaults: {
      model: {
        primary: "pipellm/claude-sonnet-4-6",
      },
      models: {
        "pipellm/claude-sonnet-4-6": {
          alias: "Claude Sonnet 4.6",
        },
        "pipellm/gpt-4o": {
          alias: "GPT-4o",
        },
        "pipellm/gemini-2.5-pro": {
          alias: "Gemini 2.5 Pro",
        },
      },
    },
  },
  models: {
    mode: "merge",
    providers: {
      pipellm: {
        api: "openai-completions",
        baseUrl: "https://api.pipellm.ai/openai/v1",
        apiKey: "${PIPELLM_API_KEY}",
        models: [
          { id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
          { id: "gpt-4o", name: "GPT-4o" },
          { id: "gemini-2.5-pro", name: "Gemini 2.5 Pro" },
        ],
      },
    },
  },
}
```

## Notes

* `model.primary` uses the `provider/model` format in OpenClaw.
* `models.providers.<id>.api` controls the protocol adapter. For PipeLLM's
  recommended setup, use `openai-completions`.
* If you later want Anthropic-compatible routing instead, switch the provider to
  `api: "anthropic-messages"` and set `baseUrl` to
  `https://api.pipellm.ai/anthropic`.

## Related Docs

<Columns cols={4}>
  <Card title="Developer Tools" icon="terminal" href="/integrations/overview">
    Compare supported coding assistants
  </Card>

  <Card title="OpenAI Converter" icon="shuffle" href="/converter/openai-format">
    Keep OpenAI-compatible format across providers
  </Card>

  <Card title="WebSearch npm Package" icon="box" href="/websearch/npm-package">
    Add PipeLLM WebSearch tools to OpenClaw
  </Card>

  <Card title="OpenClaw Config Docs" icon="book" href="https://docs.openclaw.ai/gateway/configuration-reference">
    Official OpenClaw configuration reference
  </Card>
</Columns>
