Get API key

Codex API Pricing: Pay-Per-Token Rates and Examples

If you searched for codex api pricing, note first that this site is an independent, OpenAI-compatible text API, not OpenAI's Codex. Here is exactly what ours costs: $0.15 per 1M input tokens and $0.50 per 1M output tokens, billed from prepaid credit.

Updated

Isometric scale weighing small input tokens against larger output tokens, illustrating pay-per-token pricing

Key points

  • Input tokens cost $0.15 per 1M, output tokens $0.50 per 1M.
  • A typical chat request of 2,000 tokens in and 500 out costs $0.00055.
  • Top-ups run from $20 to $500, with +5%, +10% or +15% bonus credit on larger ones.
  • Failed or refused requests are not charged, and credit never expires.

The short answer

There is one model, one price list and no subscription. You add credit, send requests, and each response deducts its token usage from your balance. Nothing renews and nothing is billed on a schedule.

ItemRate
Input tokens (your prompt)$0.15 per 1M
Output tokens (the model's reply)$0.50 per 1M
Failed or refused requestsNot charged
Credit expiryNever

If you are comparing against OpenAI's own Codex or any other vendor, check their current pricing pages rather than trusting a number quoted in someone else's article. This page only covers what we charge. The full table lives on the pricing page, and the endpoint details are in the API docs.

What one request costs, with the math

A price per million tokens is hard to feel until you apply it to a real call. The formula is simple: input tokens times 0.15, plus output tokens times 0.50, all divided by 1,000,000.

A short chat turn

Say a request carries 2,000 input tokens (a system prompt plus a few messages) and returns 500 output tokens.

  • Input: 2,000 x $0.15 / 1,000,000 = $0.0003
  • Output: 500 x $0.50 / 1,000,000 = $0.00025
  • Total: $0.00055

At that size, $20 of credit covers about 36,000 requests (20 / 0.00055 is roughly 36,363).

A coding request with a lot of context

Now a request that sends 50,000 tokens of file contents and gets 2,000 tokens back.

  • Input: 50,000 x $0.15 / 1,000,000 = $0.0075
  • Output: 2,000 x $0.50 / 1,000,000 = $0.0010
  • Total: $0.0085

A request that fills the window

The context window is 100,000 tokens, prompt and completion together. Fill it with 90,000 tokens in and 10,000 out and you pay $0.0135 for the input plus $0.0050 for the output, which is $0.0185. Even a maxed-out call costs under two cents.

Why output costs more than input

Output tokens are priced at $0.50 per 1M against $0.15 for input, a ratio of roughly 3.3 to 1. That shapes how you should think about spend. A long prompt is cheap. A long answer is not free. If you have a choice between sending more context and asking for a longer reply, the context is the cheaper side of the bill.

Two habits follow from this. First, cap replies you do not need long: set max_tokens when your task has a natural ceiling, such as a classification label or a one-paragraph summary. It is optional on this API, since a completion can use whatever is left of the window, so leaving it unset on a chatty task can cost more than you expect. Second, use stop sequences to end generation as soon as you have what you came for.

Top-ups and bonus credit

You can add any whole dollar amount from $20 to $500. Larger top-ups get bonus credit on top:

You payBonusCredit you receive
$20 to $49nonesame as you pay
$50+5%$52.50
$100+10%$110.00
$200+15%$230.00
$500+15%$575.00

You can pay by card (Visa, Mastercard, Apple Pay, Google Pay) or with crypto (USDT on TRC20, USDC on Base). The bonus is real extra credit: $50 gives you $2.50 more, $100 gives $10 more, and $200 gives $30 more. On the $200 tier you receive $230, so the effective output rate drops from $0.50 to about $0.43 per 1M tokens (200 / 230 x 0.50). Because credit never expires, a bigger top-up is not a gamble on usage: whatever you do not spend this month is still there next month. If you are not sure how much you will use, start at $20 and move up once you have a real usage number.

What a month of usage looks like

Here are three usage patterns, all priced with the rates above. They are examples built from round numbers, not measurements of any real customer.

A small chat app

1,000 requests a day for 30 days is 30,000 requests. At the $0.00055 chat-turn size from earlier, that is 30,000 x $0.00055 = $16.50 for the month.

A growing conversation

Chat history is resent on every turn, so input grows as the conversation does. Take a 20-turn conversation with a 500-token system prompt, where each turn adds 150 user tokens and 350 reply tokens. Turn 1 sends 650 input tokens, turn 2 sends 1,150, and so on up by 500 each time. Across all 20 turns that is 108,000 input tokens and 7,000 output tokens.

  • Input: 108,000 x $0.15 / 1,000,000 = $0.0162
  • Output: 7,000 x $0.50 / 1,000,000 = $0.0035
  • Whole conversation: $0.0197

Two cents for twenty turns. If you want to see your own numbers, the response includes a usage block, and the X-Balance-USD header shows your remaining balance after every call.

A coding assistant in an editor

A request with 8,000 input tokens and 1,000 output tokens costs $0.0012 + $0.0005 = $0.0017. One hundred of those a day over 22 working days is 2,200 requests, or $3.74. If you use an editor for this, the coding API page covers the setup.

Trying it before you pay

New users can claim $0.50 of trial credit with one click on the API key page after sign-up. It is one per person, it lasts 7 days, and it needs no card. You can sign up with Google or with an email and password.

At the chat-turn size above, $0.50 is enough for about 909 requests (0.50 / 0.00055). That is plenty to check that your client connects, that streaming works and that tool calls come back in the shape you expect. Trial keys are limited to 2 concurrent requests and 60 requests per minute, while a full key gets 8 concurrent and 300 per minute. Get started from the API key page.

Ways to keep the bill small

  • Trim history. Because input is resent each turn, dropping old messages or summarising them is the biggest saving in long chats.
  • Keep the system prompt tight. A 1,500-token prompt on 10,000 requests is 15 million input tokens, or $2.25.
  • Cap replies. Use max_tokens and stop where the task allows it.
  • Watch retries. A 429 means you hit a rate limit or concurrency cap. Back off and retry rather than firing the same request in a loop.
  • Read the headers. X-Balance-USD comes back on each response, so you can alert yourself when credit runs low.

Prompts are not used for training, and you only pay for requests that succeed. One more habit pays off quickly: log the token counts from the usage block of each response next to the feature that made the call. After a week you will know which part of your product spends the most, and that is nearly always a different part from the one you guessed. Fixing the top one or two usually matters more than shaving a few tokens everywhere.

Questions and answers

Is there a subscription or monthly minimum?

No. You pay as you go from prepaid credit, and the credit never expires. The smallest top-up is $20.

Does this have the same pricing as OpenAI's Codex?

This is an independent service running an open-weight model, so its prices are its own. For OpenAI's pricing, check their current pricing page.

Am I charged when a request fails?

No. Failed or refused requests are not charged. You pay only for tokens on requests that complete.

How far does $20 go?

At 2,000 input and 500 output tokens per request, each call costs $0.00055, so $20 covers roughly 36,000 requests.

Can I pay with a card?

Yes. You can pay by card (Visa, Mastercard, Apple Pay, Google Pay) or with USDT on TRC20 or USDC on Base.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key