Skip to main content

OpenClaw

OpenClaw is an AI coding agent with support for custom OpenAI-compatible providers, fallback chains, and messaging gateway mode (Discord, Slack, Telegram, etc.).
AnyAPI is not a bundled provider in OpenClaw. You wire it in as a custom OpenAI-compatible provider under models.providers. Once registered, OpenClaw addresses models as anyapi/<vendor>/<model> (your provider ID prefix + the upstream model ID).
OpenClaw uses JSON5 at ~/.openclaw/openclaw.json — unquoted keys, trailing commas, and // comments are all valid.

Quick Start

The fastest path is the non-interactive onboarding wizard:
This registers a custom provider with baseUrl: https://api.anyapi.ai/v1, stores the API key as an env reference, and sets openai/gpt-4o as the default model. Then start OpenClaw:
Prefer interactive setup? Run openclaw onboard without flags to walk through provider, URL, key, and model selection step by step.

Manual Configuration

Edit ~/.openclaw/openclaw.json directly for full control:
Restart OpenClaw for changes to take effect:

Model Reference Format

OpenClaw composes model refs as <provider-id>/<upstream-model-id>. With provider ID anyapi:
  • anyapi/openai/gpt-4o — correct
  • anyapi/anthropic/claude-sonnet-4.6 — correct
  • openai/gpt-4o — won’t route through the anyapi provider
  • gpt-4o — missing vendor prefix, AnyAPI returns HTTP 400
The id field inside models.providers.anyapi.models[] is the upstream ID sent to AnyAPI (e.g. openai/gpt-4o). The anyapi/ prefix is added by OpenClaw based on your provider ID. Browse all available models at anyapi.ai/ai-models or query the API:

Configuration Examples

Advanced Configuration

Set per-model defaults via agents.defaults.models:
Enrich model entries to enable image inputs and set context windows:
OpenClaw won’t infer image capability for custom providers automatically — declare it explicitly.
Add request headers for tracking:
For multi-account setups, OpenClaw supports auth profiles. Store a key in OS keychain:

CLI Reference

Troubleshooting

OpenClaw rejects unknown keys. Use the canonical field names:
  • baseUrl (camelCase, not baseURL)
  • apiKey (object or ${VAR} template, not apiKeyEnvVar)
Validate with openclaw config validate.
The apiKey reference doesn’t resolve.
  1. Confirm the env var is set: echo $ANYAPI_API_KEY
  2. Confirm the apiKey block points to it:
  3. Restart OpenClaw — env changes don’t apply to a running daemon.
Your key is invalid, expired, or revoked.
  1. Validate the key at dash.anyapi.ai
  2. Test directly:
The model ID is unknown or missing the vendor prefix.
  1. List the catalog: curl -H "Authorization: Bearer $ANYAPI_API_KEY" https://api.anyapi.ai/v1/models
  2. Use vendor/model form (e.g. openai/gpt-4o, not bare gpt-4o)
  3. Confirm the model is listed under models.providers.anyapi.models[] in your config
Set baseUrl to exactly https://api.anyapi.ai/v1 — no trailing slash, no /chat/completions suffix (OpenClaw appends that).
Check usage at dash.anyapi.ai, upgrade your plan, or add fallbacks to spread load.

Best Practices

  1. Store keys as env refs, not plaintext — prefer secret-input-mode ref during onboarding
  2. Configure fallbacks across different vendors for cross-provider resilience
  3. Set timeoutMs for slow models — reasoning models like openai/o3 can take minutes
  4. Pin model capability metadata — declare input: ["text", "image"] explicitly for vision models
  5. Always use vendor/model format — bare names return HTTP 400
  6. Monitor usage at dash.anyapi.ai

Support