Documentation Index
Fetch the complete documentation index at: https://docs.clearmaas.com/llms.txt
Use this file to discover all available pages before exploring further.
Codex CLI is OpenAI’s official command-line coding agent. Connect it to ClearMaas via a custom provider in config.toml or environment variables.
Prerequisites
- Codex CLI installed (
npm install -g @openai/codex or via installer)
- A ClearMaas API key starting with
sk-
Quick setup via environment variables
The fastest way to get started:
export OPENAI_API_KEY="sk-..."
export OPENAI_BASE_URL="https://api.clearmaas.com/v1"
codex
(Older Codex versions may recognize OPENAI_API_BASE instead of OPENAI_BASE_URL �?set whichever your version expects.)
Setup via config.toml
For persistent configuration, create ~/.config/codex/config.toml:
model_provider = "clearmaas"
[model_providers.clearmaas]
name = "ClearMaas"
base_url = "https://api.clearmaas.com/v1"
env_key = "OPENAI_API_KEY"
Then set the API key in your environment:
export OPENAI_API_KEY="sk-..."
Adding a second provider (Anthropic)
You can define multiple providers and switch between them:
model_provider = "clearmaas"
[model_providers.clearmaas]
name = "ClearMaas"
base_url = "https://api.clearmaas.com/v1"
env_key = "OPENAI_API_KEY"
[model_providers.anthropic]
name = "Anthropic Direct"
base_url = "https://api.anthropic.com/v1"
env_key = "ANTHROPIC_API_KEY"
Switch providers with the -c CLI flag:
codex -c model_provider='"anthropic"' "Explain this function"
Choosing a model
Set the default model in config.toml:
model = "anthropic/claude-sonnet-4.6"
Or override per-invocation:
codex -c model='"openai/gpt-4o-mini"' "Refactor this module"
Available prefixes for routing to different providers:
| Prefix | Example model ID |
|---|
openai/ | openai/gpt-4o-mini |
anthropic/ | anthropic/claude-sonnet-4.6 |
google/ | google/gemini-2.5-pro |
deepseek/ | deepseek/deepseek-chat |
grok/ | grok/grok-4-fast-reasoning |
qwen/ | qwen/qwen3.6-plus |
kimi/ | kimi/kimi-k2.6 |
If your ClearMaas setup requires additional headers:
[model_providers.clearmaas]
name = "ClearMaas"
base_url = "https://api.clearmaas.com/v1"
env_key = "OPENAI_API_KEY"
[model_providers.clearmaas.http_headers]
X-Custom-Header = "value"
Verification
export OPENAI_API_KEY="sk-..."
export OPENAI_BASE_URL="https://api.clearmaas.com/v1"
codex "Hello, what model are you using?"
Check your ClearMaas dashboard to confirm the request was routed.
See also