You are billed per token against the usage the model vendor reports — the same numbers on your invoice line and in ours — with no rounding up to a minimum and no per-request fee. Image generation is the exception and is billed per image, as above.
Cached prompt tokens are billed separately, at the cache read rate rather than the input rate. Those already cost between a third and a twenty-fifth of a fresh input token depending on the model, and we pass that through rather than flattening it into one blended rate. On agent workloads with a long stable system prompt it is usually the largest saving of all.
Credit is reserved when a request starts and the unused part is refunded the moment it finishes, so a runaway generation stops at your balance instead of past it. Reasoning models are the exception worth knowing about: their reasoning is not bounded by max_tokens, so the reservation carries a measured allowance for it and an unusually long run can settle slightly above what was held.
A 4xx from upstream is never charged, and neither is a request that fails before any tokens are generated.