AI tokens and inference, explained
Short guides to how model APIs count, price and serve tokens, with sources and real numbers from the models on OpenScale.
What is an AI token?
An AI token is the unit of text a language model reads and writes: a whole word, part of a word, a punctuation mark or a few bytes, depending on the model's tokenizer.
How LLM token pricing works: input, cached input and output
LLM token pricing is the rate an API charges per token processed, quoted in US dollars per 1M tokens, with separate prices for input tokens, cached input tokens and output tokens.
How much do 1M tokens cost, and what do they buy?
1M tokens is about 750,000 English words of text, and on open models like DeepSeek V4.1 Flash it costs between $0.003 (cached input) and $0.24 (output).
Tokens per second and time to first token, explained
Tokens per second (TPS) is how many output tokens a model generates each second once it starts writing, and time to first token (TTFT) is the wait between sending a request and receiving the first token.
How prompt caching cuts coding agent costs
Prompt caching is when an inference provider keeps the processed form of a prompt prefix and reuses it for a later request that starts with the same tokens, billing those tokens at a lower cached input price.
Open vs closed models for coding agents
An open model (open-weight model) is one whose trained weights are published for anyone to download and run, while a closed model is available only through its maker's API and products.
Batch vs real-time inference
Real-time inference answers each API request as it arrives, in seconds, while batch inference takes a file of many requests and returns all the results within a set window, such as 24 hours.
OpenAI-compatible and Anthropic-compatible APIs, explained
An OpenAI-compatible or Anthropic-compatible API is one that accepts the same request and response format as OpenAI's or Anthropic's API, so tools built for those APIs work with another model by changing only the base URL, the API key and the model name.
Every guide is also plain Markdown, listed in learn.md.