How is AI API pricing calculated?
AI API providers charge based on the number of tokens processed. Tokens are pieces of text (roughly 4 characters or 0.75 words each). You pay separately for input tokens (what you send to the model) and output tokens (what the model generates). Multiply your token count by the per-token rate to get the total cost.