EN ▾
Get API key
  1. NsfwImage Cc
  2. How Are LLM Tokens Priced? Worked Examples at $0.15/$0.50

How Are LLM Tokens Priced? Worked Examples at $0.15/$0.50

A balance scale weighing glowing token cubes against coins to illustrate per-token pricing

LLM APIs bill by the token, with separate rates for what you send and what the model writes back. Below is the mechanism, then real calculations using this API's prices.

Updated

  • You pay for input tokens and output tokens separately: $0.15 and $0.50 per 1M here.
  • Output costs 3.33 times as much per token as input, but chat history makes input the bigger bill in long sessions.
  • The usage field in every response gives exact counts, so you never need to guess after the fact.
  • Prepaid credit never expires, and failed or refused requests are not charged.

Key points

No card needed. After sign-up, claim $0.50 of free test credit with one click (once per person).

Get API key

The pricing model in four lines

If you are asking how are llm tokens priced, the short version is this. A token is a chunk of text, often a short word or part of a word. Each request has a count of input tokens (everything you send) and output tokens (everything the model generates). Providers multiply each count by a rate quoted per million tokens, then add the two amounts.

On this API the rates are $0.15 per 1M input tokens and $0.50 per 1M output tokens. You pay from prepaid credit, there is no subscription or minimum per request, and credit never expires. If a request fails or is refused, it costs nothing.

The formula you will use everywhere:

cost = input_tokens / 1,000,000 x 0.15 + output_tokens / 1,000,000 x 0.50

Other providers use the same structure with different numbers, so what follows applies when you compare. For their rates, check their current pricing pages rather than relying on a table that may be stale.

What counts as a token

A tokenizer splits text into pieces. Common English words are often one token, longer or rarer words are several, and punctuation and spaces attach to neighbours. As a rough planning rule for English, one token is about four characters, or three quarters of a word. So 1,000 words is in the region of 1,300 tokens. Text in other languages, source code and lists of numbers usually take more tokens for the same visible length.

Treat that rule as an estimate for budgeting only. The exact figure comes back in the usage object of each response, with prompt_tokens, completion_tokens and total_tokens. With streaming, usage arrives at the end of the stream.

What counts as input is wider than most people expect. It includes the system prompt, every earlier message you resend, tool definitions and the new user message. Nothing is remembered between requests on the server side, so a chat app resends the conversation each turn and pays for it each turn.

Worked example: one request

Take a request with a 1,200-token system prompt, an 800-token user message and a 500-token reply.

  • Input: 1,200 + 800 = 2,000 tokens. 2,000 / 1,000,000 x $0.15 = $0.0003.
  • Output: 500 tokens. 500 / 1,000,000 x $0.50 = $0.00025.
  • Total: $0.00055.

At that price, $1 of credit covers about 1,818 such requests (1 / 0.00055 = 1,818.18). The $0.50 trial credit covers about 909. A $20 top-up covers about 36,363.

Worked example: a chat that grows

This is where bills surprise people. Imagine a 30-turn conversation where the history grows. Suppose the average prompt across all turns is 4,000 tokens (system prompt plus accumulated messages) and the average reply is 300 tokens.

  • Input: 30 x 4,000 = 120,000 tokens. 0.12 x $0.15 = $0.018.
  • Output: 30 x 300 = 9,000 tokens. 0.009 x $0.50 = $0.0045.
  • Total: $0.0225 for the whole conversation.

Notice that input is $0.018 and output is only $0.0045. Even though output is the more expensive rate per token, the resent history makes input about 80 percent of this bill. Trimming or summarizing old turns saves more than asking for shorter replies.

The extreme case is a full context window. The window is 100,000 tokens, prompt plus completion. A request with a 100,000-token prompt and a 1,000-token reply costs 0.1 x $0.15 = $0.015 for input, plus 0.001 x $0.50 = $0.0005 for output, which is $0.0155. Even a maxed-out prompt costs a little over a cent and a half.

Measure it in your own code

Guessing is fine for a first budget. After that, read the usage and compute the cost per call. This snippet does it with the OpenAI Python SDK pointed at this API.

from openai import OpenAI

IN_RATE = 0.15 / 1_000_000   # dollars per input token
OUT_RATE = 0.50 / 1_000_000  # dollars per output token

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

resp = client.chat.completions.create(
    model="uncensored",
    messages=[
        {"role": "system", "content": "You write short prompt ideas for image tools."},
        {"role": "user", "content": "Give me five scene descriptions for a fantasy market at dusk."},
    ],
)

u = resp.usage
cost = u.prompt_tokens * IN_RATE + u.completion_tokens * OUT_RATE
print(u.prompt_tokens, u.completion_tokens, round(cost, 6))

The same figure is available without code. Each response carries an X-Balance-USD header, so you can watch the balance drop after a call. Add up a day of usage and you have your real cost per user, which is a better number than any estimate in an article.

Note that this service handles text only. If you build tools around image models, the text side (prompt writing, tagging, caption cleanup) is what this API prices; image generation itself is not part of it. The page on image prompts and myths goes through that split.

Ways to lower the bill

Because you now know where tokens go, you can cut them with intent.

  1. Shorten the system prompt. It is billed on every request. Trimming 500 tokens from a prompt sent 10,000 times saves 5,000,000 input tokens, which is $0.75.
  2. Window the history. Keep the last N turns plus a short summary instead of the whole log.
  3. Cap the output. max_tokens is optional, but setting it where short answers are enough stops rambling replies from costing extra.
  4. Use stop sequences. The stop parameter ends generation at a marker you choose.
  5. Batch small asks. Ten tiny requests each carrying a 1,000-token preamble cost far more than one request that asks for ten answers in a JSON list.

Check the arithmetic on item one: 500 x 10,000 = 5,000,000 tokens, divided by 1,000,000 is 5, times $0.15 is $0.75.

Comparing prices without fooling yourself

When you line up two providers, a single headline number can mislead. Use the same test job on each and compute the full cost. A fair comparison needs these inputs: tokens in, tokens out, how many calls a day, how much history you resend, and what share of calls fail or get refused. A provider that charges for refused requests costs more than its rate suggests if your content triggers refusals often; here they are not charged.

Then check the things a rate card hides: minimum purchase, expiry of unused credit, rate limits, whether a subscription is required, and how the model handles your actual content. A cheaper token is no bargain if the reply is a refusal you pay for or an answer you cannot use.

A simple spreadsheet works. One row per scenario, columns for input tokens, output tokens, requests per month, and the formula from the first section. Fill it for two or three providers using their current published rates, and the winner is usually obvious.

Top-ups, bonuses and where to look next

You fund an account with any whole amount from $20 to $500. Bonuses apply on the way in: +5% from $50, +10% from $100 and +15% from $200. A $100 top-up therefore gives $110 of credit, and $200 gives $230. Payment on this site is crypto only, USDT on TRC20 or USDC on Base.

New accounts can claim $0.50 of trial credit with one click on the key page, valid for 7 days and needing no card. See the pricing page for the current price list, the quickstart for the first request, and the key page to sign up with Google or with email and password.

Questions and answers

Are input and output tokens priced the same?

No. Here input is $0.15 per 1M tokens and output is $0.50 per 1M tokens. Most providers split the two, with output costing more.

How many tokens is 1,000 words?

Roughly 1,300 for ordinary English, but it varies by language and content. The usage field in the response gives the exact count.

Do I pay for failed requests?

No. Failed or refused requests are not charged, and prepaid credit does not expire.

Why is my chat costing more than I expected?

Each turn resends the earlier messages as input. Long histories make input tokens the larger part of the bill, so trim or summarize old turns.

Your key is one form away

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

Start with trial credit

Email and password, key on screen right away.