2026.3.8+).
Prerequisites
- Node.js ≥ 22 — recommended via nvm
- A CometAPI account with an active API key — get yours here
Get your CometAPI API key
Install or update OpenClaw
Recommended — use the official installer:Or install via npm:Then run the setup wizard once:During onboarding, choose Skip in the Model/Auth step if you want to configure CometAPI manually. After onboarding, confirm the gateway is running:
Store your CometAPI key
Write your key to
~/.openclaw/.env so it is available to the daemon without being hardcoded in config files:If you already inject
COMETAPI_KEY through your shell, service manager, or a secrets workflow, skip this step — the config below uses $\{COMETAPI_KEY\} regardless of how the variable is set.Configure CometAPI providers
CometAPI supports four API formats. Add one or more provider blocks to
You can keep only the providers you need, or keep all four to route between formats using
~/.openclaw/openclaw.json:| Provider | API Format | Endpoint called | Base URL |
|---|---|---|---|
cometapi-openai | openai-completions | POST /v1/chat/completions | https://api.cometapi.com/v1 |
cometapi-openai-responses | openai-responses | POST /v1/responses | https://api.cometapi.com/v1 |
cometapi-claude | anthropic-messages | POST /messages | https://api.cometapi.com |
cometapi-google | google-generative-ai | POST /v1beta/... | https://api.cometapi.com/v1beta |
provider/model references.Replace each your-...-model-id placeholder with a current model ID from the CometAPI Models page that matches the provider block.Use
cometapi-openai-responses (api: "openai-responses") for models that require the OpenAI Responses API. Use cometapi-openai (api: "openai-completions") for models on the classic Chat Completions path. Both share the same baseUrl (https://api.cometapi.com/v1); the only difference is which downstream endpoint OpenClaw calls.The
auth-profiles.json file is not required for this setup. Provider keys are resolved from models.providers.*.apiKey via the $\{COMETAPI_KEY\} env var. auth-profiles.json is only needed if you want per-profile credential rotation across multiple keys.Restart and verify
Restart the gateway after adding Then run diagnostics:A successful setup looks like:
.env or changing provider config:openclaw models statusresolves the primary model tocometapi-claude/your-claude-model-idwith no missing-auth warnings for CometAPI providersopenclaw models list --provider cometapi-claudelists your configured modelsopenclaw doctorreports no config or auth errors for CometAPI providers

Clean reinstall (optional)
Clean reinstall (optional)
If you are fixing a broken older setup, stop the gateway, remove This removes all local config, sessions, logs, auth state, and workspaces. Then follow Steps 3–5 again.
~/.openclaw, then rerun onboarding before applying the CometAPI config:
