Skip to main content

AI API cost glossary

Input tokens

Input tokens are the tokenized units sent to a model, including instructions, user content, conversation history, retrieved context, and tool definitions.

Why it matters for API cost

Providers commonly price input separately from generated output. Large system prompts, long conversations, and retrieved documents increase the cost of every request.

Formula

input cost = input tokens ÷ 1,000,000 × input rate

Example

A request with 2,000 input tokens at $1 per million input tokens has an estimated input cost of $0.002.

Frequently asked questions

Is the system prompt included in input tokens?

Yes. Instructions and other content sent with the request contribute to input usage.