EN ▾
Get API key

Uncensored API for lawful adult content

Gemma API Cost: What You Really Pay per Token

The gemma api cost you pay depends on who hosts the model, because Gemma is open weight and prices are set by each provider. This article shows how to compute any bill from token counts, then works through real examples at $0.15 per 1M input and $0.50 per 1M output.

Updated

Balance scale weighing glowing token blocks against coins, representing per-token API pricing

Key points

  • Every hosted language model bills the same way: input tokens times one rate plus output tokens times another.
  • Output tokens usually cost more than input tokens; here the ratio is $0.50 to $0.15.
  • A 2,000-token prompt with a 500-token reply costs $0.00055 on this endpoint.
  • Check any provider's current pricing page before budgeting; do not rely on numbers in a blog post.

The formula behind every bill

Gemma weights are free to download, so the cost of a Gemma API is really the cost of someone running GPUs for you. Providers recover that cost per token, and each one picks its own rates. I will not quote other providers' prices here, because they change and a stale number is worse than none. Open the pricing page of any host you are considering and plug its two rates into the formula below.

def cost_usd(input_tokens, output_tokens, in_rate, out_rate):
    # rates are dollars per 1,000,000 tokens
    return input_tokens / 1_000_000 * in_rate + output_tokens / 1_000_000 * out_rate

# This endpoint (https://api.gemmansfw.top/v1, model "uncensored"): $0.15 in, $0.50 out
print(cost_usd(2_000, 500, 0.15, 0.50))   # 0.00055

That is the whole model. Everything else in this article is about getting realistic token counts to feed into it, because the rates are the easy part and the counts are where budgets go wrong.

Where the rates on this site land

This site is not a Gemma host. It runs a different open-weight model, one tuned to answer without content refusals for lawful adult use, and you call it with the model ID uncensored. The rates are flat: $0.15 per 1M input tokens and $0.50 per 1M output tokens. There is no subscription, no minimum monthly spend, and credit never expires. Failed or refused requests are not charged.

Because the rates are public and simple, they make a clean base for the examples. If you are comparing against a Gemma host, run the same examples with that host's rates and compare the totals instead of the headline numbers. The details are on the pricing page.

Worked examples with exact arithmetic

All figures below use $0.15 per 1M input tokens and $0.50 per 1M output tokens. The math is shown so you can redo it.

One chat turn

A prompt of 2,000 tokens and a reply of 500 tokens. Input: 2,000 / 1,000,000 x $0.15 = $0.00030. Output: 500 / 1,000,000 x $0.50 = $0.00025. Total: $0.00055.

A thousand of those

1,000 x $0.00055 = $0.55. So a small bot that handles a thousand questions a day, at this size, spends about 55 cents a day.

A long roleplay session

Chat apps resend the whole history each turn, so input grows. Suppose a session runs 50 turns, the prompt averages 6,000 tokens and each reply is 300 tokens. Input: 50 x 6,000 = 300,000 tokens, which is 0.3 x $0.15 = $0.045. Output: 50 x 300 = 15,000 tokens, which is 0.015 x $0.50 = $0.0075. Total: $0.0525, about five cents for the whole evening.

Filling the context window

The window is 100,000 tokens. Send 90,000 tokens of source material and get 4,000 back. Input: 0.09 x $0.15 = $0.0135. Output: 0.004 x $0.50 = $0.002. Total: $0.0155. A full-document summary costs about a cent and a half.

A month of steady traffic

An app serves 3,000 requests a day, each with 1,500 input and 400 output tokens. Daily input: 4,500,000 tokens x $0.15 per 1M = $0.675. Daily output: 1,200,000 tokens x $0.50 per 1M = $0.60. Daily total: $1.275. Over 30 days: $38.25.

Where the money actually goes

In the month example, input is $0.675 a day and output is $0.60 a day, nearly even, even though the app sends almost four times more input than it receives. That is because output tokens cost $0.50 per 1M against $0.15, a ratio of about 3.3 to 1. The takeaway is practical: long replies hurt more than long prompts.

  • Cap replies when you can. max_tokens is optional here, but setting it keeps a rambling response from costing five times what you expected.
  • Trim history. In chat, input is the sum of every earlier turn. Drop or summarize old turns once a conversation passes a few thousand tokens.
  • Keep system prompts tight. A 1,500-token system prompt sent on every call adds up: over 10,000 calls it is 15M tokens, or $2.25 at $0.15 per 1M.
  • Avoid retry storms. A 429 means your request was rejected before generation, so no reply was produced, but a loop that hammers the endpoint wastes your own time. Back off for the Retry-After value.

Questions to ask any host before you compare prices

Two hosts with the same headline rates can produce different bills. Before you pick one, find answers to these, in the provider's own docs rather than in a review:

  1. Is the rate per input and output token, or one blended rate? A blended rate hides the output multiplier and makes chat workloads look cheaper or dearer than they are.
  2. What is the context limit, and is it shared? Here the 100,000-token window covers prompt plus completion together, so a very long prompt leaves less room for the reply.
  3. Are failed requests billed? On this endpoint they are not, which matters when you retry on errors.
  4. Does credit expire, and is there a monthly minimum? Prepaid credit that never expires suits irregular traffic, because a quiet month costs nothing.
  5. What are the concurrency and request limits? Cheap tokens do little for you if a limit of two at a time throttles your app. A full key here gets 8 at once and 300 per minute.
  6. Does the model refuse what you need? A refusal still costs you a round trip and a retry in your own code, even if the host does not charge for it.

Run the same three or four of your real prompts on each candidate and log the token counts. A day of measured numbers beats any pricing table, including the one on this site.

Measure your own tokens instead of guessing

Every response includes a usage object with prompt and completion token counts, so you do not need to estimate after the fact. Log it and price it with the function above. The response also carries an X-Balance-USD header, which shows what is left in your account after the call.

from openai import OpenAI

client = OpenAI(base_url="https://api.gemmansfw.top/v1", api_key="YOUR_KEY")

raw = client.chat.completions.with_raw_response.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Summarize the plot of a heist story in 3 lines."}],
)
resp = raw.parse()
u = resp.usage
spent = u.prompt_tokens / 1e6 * 0.15 + u.completion_tokens / 1e6 * 0.50
print(u.prompt_tokens, u.completion_tokens, round(spent, 6))
print("balance:", raw.headers.get("X-Balance-USD"))

For a rough budget before you have data, a common rule of thumb is that one token is a bit under one English word, so 1,000 tokens is a few paragraphs. Treat that as a guess and replace it with logged numbers within the first day.

Top-ups, bonuses and the free trial

Credit is prepaid. You can add any whole amount from $20 to $500, and larger top-ups come with a bonus: 5% from $50, 10% from $100 and 15% from $200. In dollars, that means $50 becomes $52.50, $100 becomes $110 and $200 becomes $230. Payment is in crypto, USDT on TRC20 or USDC on Base.

At the one-turn size above, $20 of credit covers about 36,000 requests, since $20 / $0.00055 is roughly 36,363. The month of steady traffic at $38.25 fits inside a $50 top-up with its bonus, which gives $52.50.

To test before you spend anything, claim the trial: $0.50 with one click on the key page after sign-up, one per person, valid for 7 days. At $0.00055 a turn that is about 900 requests, enough to judge quality on your own prompts. Trial keys run at 2 concurrent requests and 60 per minute. Start at the API key page. If you are still working out how this endpoint relates to Gemma, see Gemma 4 API, how it works and alternatives, and the client setup is covered in the API docs.

Questions and answers

Is Gemma itself free?

The weights are published for download under their licence, so running it yourself has no per-token fee. Hosted access costs whatever the provider charges, and you should check their current pricing page.

Why do output tokens cost more than input tokens?

Generating each output token takes a full pass through the model, while input is processed in bulk. Most providers price them separately, and here the rates are $0.15 and $0.50 per 1M.

Do refused or failed requests cost anything?

No. On this endpoint failed or refused requests are not charged.

Does unused credit expire?

No. Prepaid credit never expires, and there is no subscription.

Your key is one form away

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

Get API key