Downsizing logodownsizing
Documentation

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:

bash
ds link codex

The 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:

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:

bash
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:

bash
ds unlink codex

Spot an error or something not working? Tell us on Discord or email docs@downsizing.dev.