LLM ROUTING

Understand output-token parameters in an OpenRouter adapter

In this article
THE QUICK TAKE

An output limit can cover reasoning and visible text together, so a short or empty answer may reflect budget exhaustion rather than an unused request.

The maximum length of a model answer is not always the maximum number of words a user can see. OpenRouter’s reasoning documentation explains that most providers count reasoning and visible output against a shared budget. Understanding that accounting helps diagnose an incomplete response without assuming that the model produced nothing or that every output-token field has the same name.

Use the limit field for the API family

Responses uses max_output_tokens. Chat Completions uses its documented max_tokens or max_completion_tokens budget. For a hypothetical reasoning-based extractor, configure the field supported by the selected endpoint and current model. Do not copy every limit field into one request hoping that one will take effect. The application should know which control it requested and which completion indicators it will inspect afterward.

Allow for reasoning as well as the final record

On most providers, reasoning consumes the same output budget as visible content. An extractor that needs a compact final object can therefore still require room for supported reasoning work. Consult the model’s actual options rather than assigning one universal budget. The documented Anthropic constraint requires the overall output budget to exceed the reasoning budget. The relationship matters more than choosing a large number without understanding what it covers.

Detect exhaustion from status and usage

The reasoning guide describes Responses results marked incomplete because of the output limit, potentially without a message item. Chat Completions can report a length finish reason with empty content when reasoning used the budget. Examine the relevant usage details to distinguish reasoning from visible output. A client that checks only the answer string can misreport such a request as a transport failure or an unexplained empty success.

Keep hidden display separate from compute

On Chat Completions, the documented reasoning-exclude option omits reasoning from the returned display fields. It does not mean reasoning consumed no tokens. For the extractor, inspect finish information and usage even when no reasoning text is exposed. Avoid treating a quieter payload as proof of lower computational work or automatically lower cost. Exact supported controls and accounting remain model- and provider-specific.

Adjust the workflow from observed evidence

Use representative extraction inputs and compare completion state, required final-record size and supported reasoning settings. If the budget is exhausted, choose a justified adjustment or report the limitation instead of retrying indefinitely. Keep domain validation after the completed result, since more output space does not guarantee correct values. The application’s goal is a sufficient verified record under a deliberate budget, not the largest possible generated response.

Documentation and further study

Related engineering guides: OpenRouter usage: reconciling tokens and request cost; Fetching the OpenRouter model catalog before deployment.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles