Downsizing logodownsizing
Downsizing logodownsizing
Documentation

Using Downsizing with Codex CLI

Route Codex traffic through Downsizing in seconds using the CLI.


Prerequisites

Before linking Codex, either attach a credit card or connect your OpenAI subscription so Downsizing. We also recommend to use CLI, check the CLI guide to install.

Link Codex (Recommended)

With your OpenAI subscription connected, link Codex to route traffic through 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 in the Downsizing dashboard. 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