What is context length, and what limits apply to it?
Last updated: August 6, 2026
Context length is the combined number of input and output tokens in a request. Two main limits can apply:
Model context window
Each model has a maximum context window. If the combined input and requested output exceeds this limit, the request may be rejected with an error such as:
input is too long (received … tokens; max …).Check the v1/models endpoint to find the exact context length supported by each model.
Per-tier output cap
Your usage tier may impose a separate limit on the number of output tokens. If the response reaches this limit, it may be truncated with:
finish_reason: "length".Upgrade your tier to access a higher output limit. See our docs for more details on Tiers.