Using Downsizing with Codex CLI
Route Codex traffic through Downsizing in seconds using the CLI.
Prerequisites
Install the Downsizing CLI — see the CLI guide if you haven't already.
Link Codex (Recommended)
Link Codex to Downsizing:
ds link codexThe CLI writes the Downsizing provider block to ~/.codex/config.toml and sets it as your active provider.
Manual Setup
If you prefer to configure manually, add the following to ~/.codex/config.toml:
model_provider = "downsizing"
[model_providers.downsizing]
name = "downsizing"
base_url = "https://api.downsizing.dev/YOUR_INFERENCE_ID/openai/v1"
requires_openai_auth = true
[model_providers.downsizing.http_headers]
x-downsizing-secret = "dws_YOUR_API_KEY"Find your Inference ID and API key on the Inference API page. Note that model_provider and model_providers are only respected in the global ~/.codex/config.toml — Codex ignores these keys in project-local config files.
Verify
Run a quick one-shot query to confirm traffic is routing through Downsizing:
codex exec "hello"If Codex responds, the provider is correctly configured. You can also check your savings dashboard to see the request appear in your usage metrics.
Unlinking
To remove Downsizing from Codex and restore your original settings:
ds unlink codexSpot an error or something not working? Tell us on Discord or email docs@downsizing.dev.