How AI API Pricing Actually Works: Tokens, Credits, and Per-Second Video

AI APIs run four different meters on one bill. How each modality is priced, and how to estimate a feature before you build it.

How AI API Pricing Actually Works: Tokens, Credits, and Per-Second Video

AI API pricing confuses people because there isn't one meter — there are four. Text bills by the token, images bill by the image, video bills by the second, and audio is often bundled with the video it accompanies. A price list that reads "$5 per million" next to "₫795 per image" next to "₫2,120 per second" isn't inconsistent; it's four different products sharing one invoice. This guide explains each unit, shows how to estimate a feature's cost before you build it, and covers the billing mechanics — credits, limits, and what happens when you run out.

Four meters, one bill

Start here, because most pricing guides only explain the first row and leave you to guess the rest.

Modality Billed by What moves the price
Text Tokens, quoted per 1 million Prompt length, response length, model tier
Images Per image Resolution and model tier
Video Per second of output Resolution, model tier, duration
Audio Per unit generated — often bundled with video Model, and whether audio is included

The practical consequence: you cannot compare a text model to a video model on price, and you shouldn't try. What you can do is estimate each feature separately, in its own unit, and add up the totals.

Tokens, and why output costs more

A token is the unit of text a model reads and writes — usually a sub-word fragment rather than a whole word. In English, one token averages about four characters, or roughly 0.75 of a word, so 1,000 tokens is around 750 words. That ratio is the one number worth memorizing, because every text estimate starts from it.

Prices are quoted per million tokens and split in two: input (what you send) and output (what the model generates). Output almost always costs more — commonly three to five times more.

That split isn't arbitrary. Generating each output token requires a full forward pass through the model, while reading input is comparatively cheap compute. You're paying for work done, and generation is the expensive half.

Two things follow immediately:

  • Response length is your main cost lever, not prompt length. Halving a long answer saves more than halving a long prompt.
  • A verbose model can cost more than a pricier concise one. Compare per-request cost on your real prompts, not per-million rates on a spec sheet.

Across the market, published rates span roughly $0.05 to $75 per million tokens, with most production work in the $0.50–$15 band and frontier models at the top end. A 1,000× spread means model choice, not prompt micro-optimization, is where the money is.

Estimating a feature before you build it

Work in cost per action, then multiply. Say you're adding a summarizer: a 2,000-word document in, a 200-word summary out.

  1. Convert to tokens. 2,000 words ÷ 0.75 ≈ 2,670 input tokens. 200 words ÷ 0.75 ≈ 270 output tokens.
  2. Apply both rates separately. Input tokens at the input price, output at the output price. Don't blend them — the 3–5× gap makes a blended number wrong.
  3. Add the invisible input. Your system prompt goes with every request. A 500-token system prompt on 10,000 calls is 5M input tokens you didn't plan for.
  4. Multiply by real volume, then add a margin for retries.

For images and video the arithmetic is easier but the numbers are larger. Video billed per second means a 10-second clip costs ten times a 1-second one, and resolution multiplies on top — on the AVIS pricing page the per-second rate for a given video model rises substantially from 480p to 4K. Generating one 4K video can cost more than thousands of text requests. Budget them in different mental buckets.

Where the bill exceeds the estimate

Three things routinely surprise people.

Conversation history is re-sent every turn. In a chat feature, turn ten includes turns one through nine as input. Input grows with every message, so a long conversation's final request can cost many times its first. This is the most common reason a chat app's bill outruns its projection.

Retries bill again. A request that fails after the model generated output has still done the work. Retry it and you pay twice. This matters most for image and video, where a single generation is expensive. A client-side timeout doesn't cancel the work happening on the other end, so a "failed" request isn't necessarily a free one.

Prompt caching cuts the other way. When you repeatedly send the same prefix — a long system prompt, a fixed document — providers that support caching bill that cached input at a lower rate than fresh input. Structuring prompts with the stable part first is worth doing.

One clarification, since it trips people up: max_tokens caps how long a response may be, but you're billed for what's actually generated, not the ceiling. Setting it high doesn't cost more by itself. It can still count against throughput limits on some providers, which is a separate constraint from billing.

Credits, invoices, and running out

Two billing models exist: postpaid, where you use it now and get invoiced later, and prepaid credits, where you top up a balance that usage draws down.

AVIS uses prepaid credits. Per the top-up documentation, you add credits from the Credits & Billing page, usage across the API and toolkit draws from that balance, and payment goes through MoMo or VNPAY. A 10% VAT applies and is included in the purchase total, and you can request a VAT invoice as either a Company or an Individual — worth ticking if you need it for accounting, since it's optional at checkout.

Prepaid has a real advantage for a first project: your maximum possible loss is your balance. It also has a failure mode worth designing for — running out mid-operation. On AVIS that's explicit rather than mysterious: the errors reference returns 403 when the credit balance is zero or negative. That's a distinct code from a spend-limit 429, so your app can tell "the account is empty" apart from "this key hit its cap" and respond differently.

When comparing platforms, check what sits on top of the model's own price — platform fees, minimum spend, and tax treatment all vary, and the headline per-token number rarely includes them. Ask for the all-in figure.

Keeping control of spend

Two habits prevent almost every billing accident.

Cap each key, not just the account. AVIS lets you set daily, weekly, monthly, and total spend limits on an individual API key, and the API key guide recommends a separate key per app or environment. This is the highest-value five minutes in this article: give your development key a small daily cap, and a runaway loop while you're testing costs you that cap instead of your balance.

Measure per feature, not in aggregate. A single monthly total tells you nothing about which feature to optimize. The usage endpoint returns generation records carrying modality, model, usdCost, and durationMs, alongside /balance and /api-key lookups. Because rows are tagged by modality and key, you can attribute cost to a feature rather than guessing — and that attribution is what makes optimization decisions obvious.

FAQ

How much does an AI API cost for a small app? It depends far more on modality than on traffic. A text feature at modest volume often runs a few dollars a month; a video feature can exceed that in a single day, because video bills per second of output. Estimate each feature in its own unit before assuming.

What exactly is a token? The unit of text a model reads and writes, usually a sub-word fragment. About four characters or 0.75 words in English, so 1,000 tokens is roughly 750 words. Both your prompt and the response are counted.

Why do input and output have different prices? Generating each output token requires a full forward pass through the model, while reading input is cheaper compute. Output typically costs three to five times more.

Do failed or retried requests cost money? Often yes. If the model produced output before something failed, that work was done and billed. Retrying repeats the charge, which is why expensive image and video generations should be submitted once and polled rather than re-sent.

What happens if my balance hits zero? On a prepaid platform, requests stop. AVIS returns 403 when the balance is zero or negative — a different code from the 429 returned when an individual key hits its configured spend limit.

How do I lower an AI bill fastest? Send simple work to a cheaper model, then shorten responses. Model choice spans a far wider range than any prompt-level tweak, and response length outweighs prompt length because output is the expensive half.

Wrapping up

AI API pricing is four meters on one bill: tokens for text, per image, per second for video, and audio often bundled. Estimate each feature in its own unit, remember that output costs several times input, and account for conversation history and retries before you trust a projection. Then cap every key so a mistake costs a limit rather than a balance.

AVIS runs 300+ models across all four modalities on one prepaid balance and one API key, with per-key spend limits and per-request cost reporting — so what you spend, and on which feature, is visible rather than inferred.

Last updated: August 2026