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.
Add the provider
Export the project key
export INFERENCE_API_KEY="inf_sk_..."The OpenClaw gateway process must receive this environment variable whenever it starts.
Merge the provider configuration
Add this provider under
models.providersinopenclaw.json. Preserve every existing provider and agent setting.{ 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: 262144, maxTokens: 128000, }, ], }, }, }, }The structured
apiKeyvalue is an OpenClaw environment SecretRef, so the raw key is resolved at runtime rather than stored in the configuration.Verify the provider
openclaw models list --provider inference-net openclaw models statusSelect
inference-net/glm-5.2, send a prompt, and check Usage.
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. 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
- Use
api: "openai-completions"for Fast Inference chat completions. - Keep
mode: "merge"unless you intend to replace the full provider catalog. - Run
openclaw models statusin the same environment as the gateway process. - Inspect agent-level
models.jsonif it overrides the configured base URL.