Back to guides
API providers·September 17, 2026·6 min read

Best API for Codex: compare model prices and provider routes

Choose the model and account route first, then compare real prices for the billed usage your coding work needs.

Last reviewed on .

The best API for Codex depends on your model and workflow. For low-cost local work, compare a smaller model on a Responses-compatible API. For OpenAI account features, keep the official account route on your shortlist. Kunavo is a concrete option for lower token rates, OpenRouter offers a broad model market, and direct OpenAI keeps API procurement with the model vendor. The best purchase depends on the model you will actually use.

Compare the routes you can buy

RouteGood fitWhat you pay for
ChatGPT sign-inIncluded Codex usage and required account featuresA plan and any additional usage; not an API token bundle
OpenAI APIDirect vendor billing and API project controlsSelected model usage at the applicable API rate
Kunavo APILocal tasks with selected lower-rate models and one gateway accountBillable tokens at Kunavo's catalog rates
OpenRouterComparing models and provider routes from one accountChosen route's token price plus applicable platform fees
Local model runtimeA local-model experiment on hardware you already haveHardware, electricity, and setup; no hosted API token invoice

Codex's authentication guide separates account access from API access. For a free start, check your available ChatGPT plan access; a local runtime is another route, with a different model and hardware requirement. Neither is a free copy of a paid flagship API.

Same-model prices you can compare

USD per million tokens, standard uncached input and output. External prices are the September 17, 2026 snapshot; Kunavo prices below read from the live catalog. Caching, long-context tiers, taxes, and additional tool charges are outside this table.

Model and routeInput / 1MOutput / 1MAdditional fee note
GPT-5.6 Luna — OpenAI$0.20$1.20Direct API rate
GPT-5.6 Luna — Kunavo$0.07$0.42See billing at checkout
GPT-5.6 Sol — OpenAI$4.00$20.00Current promotional rate
GPT-5.6 Sol — Kunavo$2.00$12.00See billing at checkout
GPT-5.6 Sol — OpenRouter$2.00$10.00Listed promotion; PAYG platform fee 5.5%

Sources: OpenAI's Luna and Sol pages, OpenRouter's Sol listing and platform pricing, and Kunavo pricing. OpenAI says its Sol promotion lasts at least through November 21, 2026; recheck promotions when purchasing.

What a fixed amount of billed usage costs

For 200,000 uncached billed input tokens and 20,000 billed output tokens, Luna is $0.0640 through OpenAI and $0.0224 through Kunavo. The same billed-token quantities on Sol are $1.2000 direct, $0.6400 on Kunavo, or $0.6000 on OpenRouter before its platform fee.

This is a rate comparison, not measured task savings. Providers can report different billable input for the same visible prompt; Kunavo GPT routes can include provider-added context in reported input. Use the billed usage in the dashboard for the final comparison. A lower rate only saves money when the complete accepted task also costs less.

Kunavo's catalog estimate is not a price ceiling. Its billing calculation charges the higher of the catalog total and upstream cost multiplied by the model's markup factor. Check the final usage entry when comparing providers.

Include the first payment, caching, and long prompts

Kunavo's smallest prepaid top-up is $10; no subscription is required and the balance does not expire. A few-cent task uses part of that balance, rather than reducing the first payment to a few cents. OpenRouter's minimum credit purchase is $5. Its standard PAYG card fee is 5.5%, with a $0.80 minimum per top-up: $5 of credit costs $5.80 before tax. Charge that funding fee once in your comparison, not once per request.

For repeated repository context, Sol's direct OpenAI cache-read rate is $0.40 per million tokens; Kunavo's catalog rate is $0.20. Both bill cache writes at 1.25 times fresh input. Compare fresh input, writes, hits, and output separately: a large input total is not necessarily all full-price input, and a conversation does not guarantee cache hits.

Sol requests exceeding 272,000 input tokens enter a different price tier on direct OpenAI and Kunavo: the entire request uses 2 times the input rate, including cached input, and 1.5 times the output rate. If your sessions cross that threshold, price the long request instead of extending the short-request table. OpenAI's model pricing and Kunavo's billing units document the tier. Check the selected OpenRouter route separately.

Choose a model tier, then a provider

For a narrow edit or explanation, Luna is the lower-rate candidate in this table. If the task needs a stronger model, compare Sol across providers rather than keeping Luna merely because it is cheaper per token. OpenRouter's listed Sol output rate is lower than Kunavo's in this snapshot. Kunavo's Luna rate is lower than direct OpenAI's; those are specific comparisons, not a claim to be cheapest everywhere.

If you already have usable plan allowance, spend that deliberately before buying a second service for the same job. For recurring API work, compare one normal month including unsuccessful attempts and review corrections. See Codex pricing for the plan-versus-API decision.

Connect the API you choose

Codex requires the Responses provider protocol. OpenRouter publishes its own Codex setup. For Kunavo, create a key and use the user-level provider configuration:

A lower-rate model through Kunavo
# User-level ~/.codex/config.toml
model = "gpt-5-6-luna"
model_provider = "kunavo"

[model_providers.kunavo]
name = "Kunavo"
base_url = "https://api.kunavo.com/v1"
env_key = "KUNAVO_API_KEY"
wire_api = "responses"

Create a Kunavo account, supply KUNAVO_API_KEY through your local credential setup, and follow the complete Codex integration. Run a small change with a passing test, then inspect both the diff and the bill before scaling up.

FAQ

What is the cheapest API for Codex?

There is no single lowest price across all models and providers. In this comparison, Kunavo lists GPT-5.6 Luna at $0.07 input and $0.42 output per million tokens. For Sol, OpenRouter's checked promotional rate has a lower output price than Kunavo, before its platform fee. Choose the model and billing terms first.

Is a Codex API key cheaper than a ChatGPT plan?

It depends on the included usage you would otherwise use, the API workload, and the features you need. A paid plan with remaining allowance can have no additional charge for the next eligible task. API access introduces its own bill; compare a month of accepted work rather than a flat plan price against one token rate.

Will any OpenAI-compatible API work with Codex CLI?

Codex's custom-provider configuration uses the Responses protocol. A service offering only Chat Completions is not enough. Confirm the exact model, streaming, and tool workflow on the provider's Codex integration path.

Does buying API credit unlock Codex cloud?

An API provider balance pays for requests on that provider's route. It does not grant OpenAI cloud access or replenish ChatGPT plan usage. Choose the account route required for the features you plan to use.

External prices and official documentation checked September 17, 2026. Rates do not establish equal task quality, latency, or total usage.