Skip to main content

AI API cost glossary

Context window

A context window is the amount of tokenized input and output a model can consider within a request or conversation, subject to provider-specific rules.

Why it matters for API cost

Larger contexts permit more history or documents but increase input usage. Some models also publish a higher pricing tier after a threshold.

Example

Sending an entire document corpus on every request is usually more expensive than retrieving a small set of relevant passages.

Frequently asked questions

Is a larger context window always better?

No. It increases capacity, but cost, latency, retrieval quality, and attention to relevant information still matter.