Skip to main content
OpenClaw is an advanced agent framework. Configure it to use Codex-LB for account pooling and centralized usage tracking.

Endpoint

OpenClaw uses the standard OpenAI-compatible /v1 endpoint.

Configuration

Edit your OpenClaw config file at ~/.openclaw/openclaw.json:
Use this configuration when API key authentication is disabled (default):
~/.openclaw/openclaw.json
When API key auth is disabled, OpenClaw still requires an apiKey field. Any string value works (e.g., "dummy").

Configuration Fields

Model Configuration

Define all models available in your Codex-LB instance:
You can reference these models in agent configurations:

Provider Modes

OpenClaw supports different provider modes:

Verify Configuration

Test your setup:
Verify in the Codex-LB dashboard:
  1. Open http://localhost:2455
  2. Check Dashboard for usage metrics
  3. Confirm requests are being logged under the correct API key

Troubleshooting

Ensure Codex-LB is running:
If using Docker:
API key auth is enabled but your key is missing or invalid:
  1. Verify the environment variable is set:
  2. Check the key is valid in the dashboard
  3. Ensure the apiKey field uses ${CODEX_LB_API_KEY} syntax
  4. Restart OpenClaw after setting the environment variable
If you see this when auth is disabled:
  1. Ensure apiKey is set to any string (e.g., "dummy")
  2. OpenClaw requires the field even when auth is disabled
If codex-lb doesn’t show up:
  1. Verify JSON syntax is correct (no trailing commas)
  2. Check OpenClaw logs for config parsing errors:
  3. Ensure mode is set correctly (merge or replace)
The requested model isn’t available:
  1. Check available models:
  2. Verify the model ID matches exactly (case-sensitive)
  3. Ensure at least one account supports the model
  4. Update the models array to include the correct ID
If agents aren’t using Codex-LB:
  1. Check the primary model is prefixed with codex-lb/
  2. Verify agent-specific configs don’t override with other providers
  3. Use openclaw config show to debug resolved configuration

Advanced Configuration

Per-Agent Models

Configure different models for different agent types:

Environment-Specific Configs

Use different configs for development vs. production:
Reference in config:

Remote Access

If Codex-LB is running on a different machine:
When exposing Codex-LB remotely:
  • Always enable API key authentication
  • Use HTTPS with a reverse proxy (nginx, Caddy)
  • Configure firewall rules to restrict access
  • See Production Deployment

Next Steps

API Keys

Create and manage API keys for authentication

Rate Limiting

Configure rate limits per key or account

Chat Completions API

Explore the /v1/chat/completions endpoint

Usage Tracking

Monitor OpenClaw usage in the dashboard