NewHow we catch a seller listing the wrong model, and refund you if one does.

How do I use Codex CLI with my own API key and provider?

Codex CLI can use a custom model provider: a model_providers entry in ~/.codex/config.toml with base_url, env_key (the environment variable that holds the key) and wire_api. For MartLLM, base_url is https://api.martllm.com/v1 and wire_api is "responses". On November 20, 2026, one MartLLM key reached 34 OpenAI models and the rest of the catalog, billed per token from prepaid credit. The full file is at martllm.com/docs/codex. A request that fails is not billed.

Prices as of November 20, 2026, 11:00 UTC. This page is rebuilt every hour.

ModelInput / 1M tokensOutput / 1M tokensBelow list price
GPT-6.1 Sol$0.0608$0.304297%
GPT-6 Luna$0.00299$0.01597%
GPT-6.2 Sol$0.1595$0.797492%
GPT-5.4$0.2698$1.618589.2%
OpenAI: GPT-6.1 Terra$0.0461$0.230795.4%
GPT-6 Astra$0.2084$1.042297.9%
GPT-5.5$1.25$7.5075%
GPT-4o Mini$0.0261$0.104582.6%
GPT-5.6 Luna$0.02$0.1290%
GPT-6.2 Astra Pro$6.384$31.9220.2%
GPT-5.4 Mini$0.073$0.437990.3%
GPT-6.2 Astra$1.2184$6.091984.8%
GPT-5.6 Terra Pro$1.2219$7.331638.9%
GPT-4o$0.2163$0.86591.4%
GPT-6 Sol$0.0414$0.20797.9%
GPT-6.2 Sol Pro$1.596$7.9820.2%
GPT 5.4 Nano$0.0324$0.202783.8%
GPT-5.5 Pro$6.114$36.68479.6%
OpenAI: GPT-6.1 Terra Pro$0.798$3.9920.2%
GPT 5 Mini$0.0484$0.386980.7%

MartLLM: the price a request is billed at now, no fee added. Other prices from each provider's public price list: Codex configuration reference · every model and price →

More questions

Where does the provider entry go?

In the user-level file ~/.codex/config.toml. Codex ignores provider definitions in a project’s own .codex/config.toml.

Can Codex CLI use models that are not from OpenAI?

Yes. Through MartLLM the Responses API serves the other chat models in the catalog too; set the model id in the Codex config.