
Multi-Tenant Architecture: 3 Models & 8 Best Practices
Learn how multi-tenant architecture works, compare database isolation models, and explore six components & eight best practices for shared infrastructure.
What is a token in AI, and why does it affect your bill? Explore input and output tokens, API pricing, context limits, and hidden usage costs.
A 1,000-word document doesn't necessarily use 1,000 AI tokens. Add code, unusual words, or another language, and the count changes again. For anyone building with AI, those differences can affect API costs faster than expected.
We'll look at how language models count tokens, how token limits work, and what popular models charge, and we'll also cover ways to reduce unnecessary usage. The focus here is on language model tokens, separate from AI-related cryptocurrencies.
A token in AI is a small unit of text that a language model reads or generates, such as a word, part of a word, or punctuation mark. Before processing your prompt, a tokenizer splits the text into tokens and converts each into a numeric ID.
One word doesn't always equal one token, and the exact count depends on how the model's tokenizer breaks up the text.
A word counted as one token by one model could require several tokens in another.
Because token counts vary by model and text, actual tokenizer counts are more reliable than word-based estimates when tracking usage or calculating costs.
| Token type | Where it comes from | What it affects |
|---|---|---|
| Input tokens | User prompt | Initial usage count |
| Output tokens | Model response | Response size and cost |
| Reasoning tokens | Internal model processing | Hidden usage that increases total cost |
Reasoning tokens often remain invisible in the response but still increase total usage on complex requests. If your system does not track these counts accurately, limits fail, quotas drift, and pricing becomes inconsistent.
A token is about three-quarters of an English word on average. OpenAI's published rule of thumb puts 1 token at roughly 4 characters or ¾ of a word, and 100 tokens at roughly 75 words.
| Tokens | Approximate words | Roughly equal to |
|---|---|---|
| 100 | 75 | A short paragraph |
| 1,000 | 750 | A 1.5-page memo |
| 1 million | 750,000 | Several full-length novels |
Ratios based on OpenAI's published guidance for English text.
Treat the table as an estimate. Code, technical text, and non-English content produce more tokens for the same length, and each model's tokenizer counts differently. For exact numbers, OpenAI points you to its Tokenizer tool or the tiktoken library for the specific model.
Tokenization works by converting raw input into a sequence of integer IDs that the model can process. The tokenizer maps text into these IDs based on a fixed vocabulary tied to the model.
Each model uses its own tokenizer, so the same prompt can produce different token counts depending on the model you use. The difference shows up in how your system behaves:
Tokenization also applies to non-text inputs. Multimodal models convert images into patch tokens and audio into spectrogram or semantic tokens.
Each modality follows different counting rules. Your metering pipeline needs to handle these differences when a single request includes text, images, and tool outputs.
API access to language models is billed by the token, with providers typically quoting a per-million-token rate for input and a higher rate for output.
For applications generating long responses or running multiple model calls, those differences can add up quickly.
| Model | Provider | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|---|
| GPT-6 Astra | $10.00 | $50.00 | |
| Claude Opus 5.5 | $4.00 | $20.00 | |
| Claude Sonnet 5.5 | $2.00 | $10.00 | |
| Gemini 3.8 Flash | $0.75 | $3.75 |
Standard short-context API rates as of October 8, 2026. Sources include OpenAI, Anthropic, and Google. Google’s Gemini 3.8 Flash rates are scheduled to double on January 1, 2027, moving to $1.50 per million input tokens and $7.50 per million output tokens. Prices may change.
For perspective, 10,000 input tokens and 2,000 output tokens on GPT-6 Astra would cost $0.20 at these rates. Cached input, batch processing, and long-context requests may have different pricing, while agent workflows can generate several charges from one task.
Consumer subscriptions like ChatGPT Plus work differently, charging a recurring fee for access rather than billing each API token separately.
Explore our guides to token-based pricing and AI token cost for more on pricing, tracking, and controlling token consumption.
A context window is the maximum number of tokens a model can consider in one request. It covers the prompt, the conversation history, attached files, tool results, and the response. Google's Gemini 3.8 Flash, for example, supports a 1M-token context window.
The visible question is often the smallest part of what gets billed. A request grows well past what the user typed in 4 common ways:
Long prompts can also cross a pricing threshold. On Gemini 3.1 Pro, prompts above 200,000 tokens are billed at a higher input and output rate, and the higher rate applies to the whole request, including the tokens below the threshold.
You can reduce AI token usage by choosing the right model, reusing cached inputs, trimming unnecessary context, and setting token budgets for each feature. Small changes to what you send and how often you send it can make a noticeable difference in API costs.
Token budgets need accurate metering and request-time controls to work in production. Your application needs to know how much each request consumes and when to limit further usage.
Tokens shape AI pricing models by determining how customers are charged, how usage is tracked, and when spending limits apply. Some products bill for every token consumed, while others bundle tokens into subscriptions or let customers spend prepaid credits.
Four common approaches work differently behind the scenes:
| Model | How customers pay | What engineering needs |
|---|---|---|
| Pay-per-token | Pay for input and output tokens consumed | Accurate metering and usage attribution |
| Prepaid credits | Spend purchased credits on token usage | Credit ledger, atomic deductions, and balance checks |
| Subscription with limits | Receive a token allowance with each plan | Entitlement checks and usage limits |
| Hybrid | Pay a subscription plus token-based overages | Allowance tracking, overage detection, and billing sync |
Hybrid pricing is particularly useful when customers want predictable monthly costs but need room for heavier AI workloads. It also introduces more moving parts, since subscriptions, token allowances, and credit balances must stay aligned.
Miro offers a real example. The company launched its credit-based AI pricing model with Stigg in under six weeks, saving an estimated 5,000 engineering hours compared with building the infrastructure internally.
AI products meter and limit tokens by tracking consumption per request and checking available allowances before another model call runs.
A simple usage counter might work initially, but shared budgets, concurrent agents, and changing subscription limits make enforcement more complicated.
A production system needs to handle six things:
These checks also need to be fast. Stigg's Sidecar serves entitlement checks from a local in-memory cache at p99 under 10ms, falling back to Stigg’s Edge API at around 100ms on cache misses.
Applications can enforce access close to the workload while recording actual token consumption for billing and reconciliation.
Billing tells you what happened, while Stigg decides what’s allowed to happen in the request path, before the model runs.
Stigg puts spending controls earlier in the request path. As the usage runtime for AI products, Stigg is the infrastructure that checks entitlements, credits, and usage limits before costly workloads begin, while your existing billing provider handles invoices and payments.
Here's what you get:
Explore the Stigg docs to see how request-time entitlement checks, credit deductions, and usage limits work together in production.
1,000 tokens is roughly 750 English words, based on OpenAI's rule of thumb that 100 tokens equal about 75 words. Code, technical text, and non-English content produce more tokens for the same length.
1 million tokens costs $10 for input and $50 for output on GPT-6 Astra through OpenAI’s API as of October 2026 (prices may change). A ChatGPT subscription charges a flat monthly fee, so per-token pricing applies only to API usage.
Yes, AI tokens cost money when you use a model through an API, with separate per-million-token rates for input and output. Consumer chat apps often include a free tier, but paid API access bills every token in the prompt, context, and response.
Different AI models return different token counts because each uses its own tokenizer and vocabulary. The same input can produce different token sequences across models, which affects limits, credit consumption, and cost after a model change.
A token in AI is a smaller unit than a word, often a word fragment, punctuation mark, or space, while a word is a complete lexical unit.
Common English words like “hello” often count as one token, but longer or unusual words split into several, so 1,000 tokens is roughly 750 English words, not 1,000.