# OpenClaw (https://inference.net/docs/integrations/openclaw)

OpenClaw supports custom OpenAI-compatible providers under `models.providers`.
The released `fast` CLI does not yet include an OpenClaw adapter, but OpenClaw's
native provider and SecretRef contracts provide a verified manual setup.

<Callout title="CLI adapter in preview" tone="warning">

Do not run `fast openclaw on` yet. The manual configuration below is managed by
OpenClaw and must be reverted manually.

</Callout>

## Add the provider

<Steps>
  <Step title="Export the project key">

```bash
export INFERENCE_API_KEY="inf_sk_..."
```

The OpenClaw gateway process must receive this environment variable whenever it
starts.

  </Step>
  <Step title="Add model provider">

Add `inference-net` to `models.providers` in `~/.openclaw/openclaw.json` (run
`openclaw config file` to print the active path on your machine). It should
look something like this:

```json5
{
  models: {
    mode: "merge",
    providers: {
      "inference-net": {
        baseUrl: "https://api.inference.net/v1",
        api: "openai-completions",
        apiKey: {
          source: "env",
          provider: "default",
          id: "INFERENCE_API_KEY",
        },
        models: [
          {
            id: "glm-5.2",
            name: "GLM 5.2",
            input: ["text"],
            contextWindow: 1048576,
            maxTokens: 943718,
          },
        ],
      },
    },
  },
}
```

Merge this into your existing configuration — preserve every existing provider
and agent setting. The structured `apiKey` value is an OpenClaw environment
SecretRef, so the raw key is resolved at runtime rather than stored in the
configuration.

  </Step>
  <Step title="Verify the provider">

```bash
openclaw models list --provider inference-net
openclaw models status
```

Select `inference-net/glm-5.2`, send a prompt, and check
[Usage](/dashboard/usage/).

  </Step>
</Steps>

## Add more models

Every custom model must be registered in the provider's `models` array. Copy
the ID and capability information from the [model catalog](/models/). Mark image
input only for a model that actually supports it.

OpenClaw merges custom providers by default. An agent-specific `models.json`
can override non-empty provider values, so inspect that file if a different
base URL remains active.

## Revert the manual setup

Remove only `models.providers.inference-net` and any agent default that references
`inference-net/*`. Keep the environment key if another tool still uses it;
otherwise remove it from the service environment. Restart the OpenClaw gateway.

## Troubleshooting

- **Chat completions fail against Inference.net** — use
  `api: "openai-completions"`.
- **Other providers disappeared from the catalog** — `mode: "replace"`
  replaces the full provider catalog; keep `mode: "merge"` unless you intend
  that.
- **`openclaw models status` disagrees with the running gateway** — run it in
  the same environment as the gateway process.
- **An agent ignores the configured base URL** — inspect agent-level
  `models.json`, which can override it.