Skip to contentOceanToken

Glossary term

What is max tokens?

The most tokens a model may write in one reply.

Definition

Max tokens, max_tokens in the API, is the upper limit on how many tokens a model may generate in one reply. When the model reaches it, it stops mid-answer and reports a finish reason of length. The limit covers only the output, while the context window covers input and output together.

Why it matters

It caps the cost and the length of every reply. Set it too low, especially on reasoning models, and answers are cut off before they are finished.

How it works on OceanToken

On OceanToken, a max_tokens above a model's own output limit is lowered to that limit instead of refused; each model's page lists its Max output. On reasoning models leave room, since reasoning tokens often count toward it.