LiteLLM is an open-source LLM gateway that provides a unified API to 100+ model providers. Route OpenClaw through LiteLLM to get centralized cost tracking, logging, and the flexibility to switch backends without changing your OpenClaw config.Documentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
Quick start
- Onboarding (recommended)
- Manual setup
Configuration
Environment variables
Config file
Advanced configuration
Image generation
LiteLLM can also back theimage_generate tool through OpenAI-compatible
/images/generations and /images/edits routes. Configure a LiteLLM image
model under agents.defaults.imageGenerationModel:
http://localhost:4000 work without a global
private-network override. For a LAN-hosted proxy, set
models.providers.litellm.request.allowPrivateNetwork: true because the API key
will be sent to the configured proxy host.
Virtual keys
Virtual keys
Create a dedicated key for OpenClaw with spend limits:Use the generated key as
LITELLM_API_KEY.Model routing
Model routing
LiteLLM can route model requests to different backends. Configure in your LiteLLM OpenClaw keeps requesting
config.yaml:claude-opus-4-6 — LiteLLM handles the routing.Viewing usage
Viewing usage
Check LiteLLM’s dashboard or API:
Proxy behavior notes
Proxy behavior notes
- LiteLLM runs on
http://localhost:4000by default - OpenClaw connects through LiteLLM’s proxy-style OpenAI-compatible
/v1endpoint - Native OpenAI-only request shaping does not apply through LiteLLM:
no
service_tier, no Responsesstore, no prompt-cache hints, and no OpenAI reasoning-compat payload shaping - Hidden OpenClaw attribution headers (
originator,version,User-Agent) are not injected on custom LiteLLM base URLs
For general provider configuration and failover behavior, see Model Providers.
Related
LiteLLM Docs
Official LiteLLM documentation and API reference.
Model selection
Overview of all providers, model refs, and failover behavior.
Configuration
Full config reference.
Model selection
How to choose and configure models.