EN ▾
Get API key

Grok 4 API Pricing vs Pay-Per-Token Uncensored

Searching for grok 4 api pricing usually means one thing: you want to know what your workload will cost. I cannot quote xAI's rates for you, but I can give you the formula, exact costs at our rates, and a checklist for reading any pricing page.

Updated

Balance scale weighing small input token cubes against larger output token cubes

Key points

  • xAI sets and changes the Grok rates, so read their pricing page for the current numbers.
  • Our rates are $0.15 per 1M input tokens and $0.50 per 1M output tokens, prepaid, with no subscription.
  • Output tokens cost 3.33 times as much as input tokens here, so long replies drive the bill.
  • A growing chat history is the hidden cost: resending it every turn is most of the input.

How to compare Grok pricing honestly

Any comparison of grok 4 api pricing has two sides, and only one of them is mine to fill in. xAI publishes its own rates and can change them, and the same goes for every vendor I could name. I will not paste numbers from memory that may be stale by the time you read this. Open their pricing page, copy the input rate and the output rate per 1M tokens, and plug them into the formula below next to ours.

What I can state precisely is this service. It is an OpenAI-compatible API for one open-weight model (model ID uncensored), run by an independent provider, and it is not xAI's API. It costs $0.15 per 1M input tokens and $0.50 per 1M output tokens, billed from prepaid credit. There is no subscription, credit never expires, and failed or refused requests are not charged.

The rest of this article is the arithmetic. If you want the shorter version of our rates, the pricing page has it.

The formula and a script to run it

Every token-priced API works the same way. Cost per request equals input tokens divided by a million times the input rate, plus output tokens divided by a million times the output rate. Two rates, two token counts.

This script takes both vendors' rates as arguments, so you can fill in the other side from their pricing page. Ours are set as defaults.

def cost(tokens_in, tokens_out, rate_in=0.15, rate_out=0.50):
    # rates are dollars per 1M tokens
    return tokens_in / 1_000_000 * rate_in + tokens_out / 1_000_000 * rate_out

# Ours, using the defaults
print(cost(2_000, 500))            # 0.00055

# Another vendor: copy the two rates from their current pricing page
OTHER_IN, OTHER_OUT = None, None   # fill these in
if OTHER_IN is not None:
    print(cost(2_000, 500, OTHER_IN, OTHER_OUT))

To measure real token counts instead of guessing, read the usage block in each response. The API returns prompt and completion token counts, and with streaming the usage arrives at the end of the stream. Log those two numbers per request for a day and you have an honest basis for any budget.

What common workloads cost at our rates

Here are five workloads computed exactly from $0.15 and $0.50 per 1M tokens. Use them as anchors and scale to your own traffic.

WorkloadInput / output tokensMathCost
Chat reply2,000 / 500$0.00030 + $0.00025$0.00055
Roleplay turn, long history20,000 / 400$0.00300 + $0.00020$0.00320
Summarise a long document60,000 / 1,500$0.00900 + $0.00075$0.00975
Full window call95,000 / 5,000$0.01425 + $0.00250$0.01675
Classify 10,000 short texts500 / 20 each10,000 x ($0.000075 + $0.00001)$0.85

Check one row by hand. The document summary: 60,000 x 0.15 / 1,000,000 = $0.009, and 1,500 x 0.50 / 1,000,000 = $0.00075, which is $0.00975 in total. Even the largest call here, using nearly the whole 100,000-token window, costs under two cents.

A monthly example for a small product: 100,000 requests at 3,000 input and 600 output tokens each is 300M input tokens ($45) plus 60M output tokens ($30), a total of $75.

Why output tokens move the bill

The output rate is $0.50 against $0.15 for input, a ratio of 3.33 to 1. A request with 1,000 tokens in and 1,000 out costs $0.00015 for the input and $0.00050 for the output, so output is three quarters of the total. For creative writing, where you ask for long scenes, that is the line to watch.

Three habits keep it in check. Set max_tokens when you want a hard ceiling on a reply, since it is optional and otherwise the completion can use the rest of the window. Ask for the length you need in the prompt ("about 150 words"). And stop generation at a known marker with the stop parameter when you only need one section of a longer format.

When you compare vendors, also check how each one counts output. If a model produces reasoning tokens before its visible answer, ask whether those are billed as output. That detail can change a comparison more than the headline rate.

The hidden cost: resending chat history

Chat APIs are stateless. Each turn you resend the system prompt and the whole conversation so far, and all of it is billed as input. For a long roleplay or companion chat, input quickly becomes most of your tokens.

Take a 30-turn conversation with a 1,000-token system prompt, where each turn adds 200 tokens from the user and 300 from the model. The input on turn k is 1,000 + 500 x (k - 1) + 200 tokens. Summed over 30 turns that is 30 x 1,200 + 500 x 435 = 253,500 input tokens, against 9,000 output tokens.

  • Input: 253,500 x 0.15 / 1,000,000 = $0.038025
  • Output: 9,000 x 0.50 / 1,000,000 = $0.0045
  • Total: about $0.0425 for the whole conversation

Input is nearly nine tenths of that bill. The fix is to trim or summarise old turns once the history gets long, and to keep the system prompt short. The quickstart shows the message format, and a rolling summary of old turns cuts this cost with little loss of continuity.

Rough fits: which workload suits which price shape

Pricing is not only a number, it is a shape. A service with a low input rate and a higher output rate suits some jobs better than others, and you can see it by looking at the ratio of input to output tokens in your own traffic.

  • Input-heavy jobs such as classification, extraction and question answering over documents. You send a lot and get a little back. At $0.15 per 1M input tokens, 1M tokens of documents costs $0.15 to read, and the short answers add very little.
  • Balanced jobs such as chat and customer replies. Input and output are within a few times of each other, and history decides the split.
  • Output-heavy jobs such as story generation, where a short prompt produces a long scene. Here 1M output tokens costs $0.50, and that is the number to compare first.

Count your own ratio before comparing. A team that generates mostly long fiction should weigh the output rate most. A team that runs extraction should weigh the input rate. Comparing only the cheaper of the two headline numbers is how people end up surprised by an invoice.

One more check is worth doing at small scale: run the same 100 real prompts through both candidates and compare quality as well as cost. A cheaper model that needs two attempts per answer is not cheaper, and a refusal that you have to rewrite around costs your time even when the API does not charge for it.

Top-ups, bonuses and what credit covers

You add credit in any whole amount from $20 to $500, paid in USDT on TRC20 or USDC on Base. Bonuses apply to larger top-ups: 5% from $50, 10% from $100 and 15% from $200.

Top-upBonusCreditChat turns at $0.00055
$20none$20.00about 36,000
$505%$52.50about 95,000
$10010%$110.00200,000
$20015%$230.00about 418,000

If you want to test before you commit, new users can claim $0.50 of trial credit with one click on the API key page, valid for 7 days and without payment details. That covers about 900 chat turns of the first row.

A checklist for reading any pricing page

With xAI, with us or with anyone else, run through these points before you commit a budget.

  1. Input and output rates, both per 1M tokens. Make sure the units match.
  2. Whether a discounted rate exists for repeated prompt prefixes, and what the conditions are.
  3. Minimum top-up or subscription fee, and whether unused credit expires.
  4. Whether refused or failed requests are billed.
  5. Rate limits and concurrency on the tier you will actually use.
  6. Context window size, since a bigger window lets you send more per call and so spend more per call.
  7. Whether the content you plan to generate is allowed under the provider's usage policy.

On our side the answers are: no subscription, credit never expires, failed and refused requests are free, a full key allows 8 concurrent requests and 300 per minute, and the window is 100,000 tokens. xAI's answers are theirs to publish, and the sensible move is to read them side by side before you build.

Questions and answers

What does the Grok API cost per million tokens?

That is set by xAI and can change, so check their current pricing page. Our own rates are $0.15 per 1M input tokens and $0.50 per 1M output tokens.

Is your API the same as xAI's Grok API?

No. It serves one open-weight model run by an independent provider, tuned to answer without content refusals for lawful adult use. It is not Grok and not a router across vendors.

Am I charged for failed or refused requests?

No. Failed or refused requests are not charged, and you can check your balance in the X-Balance-USD response header.

Is there a monthly fee or minimum spend?

There is no subscription. You top up any whole amount from $20 to $500, and the credit never expires.

How can I estimate cost before I build?

Multiply your expected input and output tokens by the two rates, or log the usage block from a day of test requests and scale it up.

Your key is one form away

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

Get API key