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.