Context window vs max output tokens: two separate limits

A model's context window and its maximum output are separate catalog fields. How to read both for any model id and handle a limit that is not published.

Checked 2026-11-22

·All posts·Models

A context window and a maximum output are two separate limits, and the UplinkSwitch catalog publishes them as two separate fields, context_window and max_output_tokens, at https://api.uplinkswitch.com/v1/catalog. A model that reads a very long prompt can still be capped at a much shorter answer, which is why a long-context model sometimes stops mid-document.

The two fields, side by side

Model idcontext_windowmax_output_tokensAvailability
gpt-6.1-sol1.1M128Kok
claude-sonnet-5-51M128Kok

Catalog snapshot of 2026-11-23. "not published" means the field is null for that row.

The API document defines them this way. context_window is the window in tokens as the developer publishes it, or the longest prompt the model takes on this gateway when that is less. max_output_tokens is the most output tokens one request returns, as the developer publishes it. Either can be null when no developer page states a figure.

So the first column bounds what the model can hold in view and the second bounds the length of one reply. Many providers count the reply against the window too, so a prompt that fills the window leaves no room to answer; keep headroom. Nothing in the catalog says the two add up in a fixed way, and this page does not supply a formula: how reasoning tokens, tool results or a provider's own accounting count against either limit differs by model and is not a catalog field.

Read both limits for any id

bash
curl -s https://api.uplinkswitch.com/v1/catalog \
  | jq '.data[] | select(.id == "gpt-6.1-sol")
        | {id, availability, context_window, max_output_tokens}'

The route needs no key. The model pages print the same two values for a person to read.

Keep "unknown" as its own state

A null is not zero and not infinity. Code that treats a missing limit as either will send an oversized request or refuse a valid one.

python
def output_cap(row: dict, wanted: int) -> int | None:
    """The max_tokens to send, or None when the catalog does not publish a cap."""
    cap = row.get("max_output_tokens")
    if cap is None:
        return None          # unknown: let the caller decide, do not invent a number
    return min(wanted, cap)

When the function returns None, a reasonable application either omits the output setting and lets the model apply its own default, or uses a conservative value it has chosen and labelled as its own. What it should not do is copy context_window into the output setting because that happened to be the only number available.

An output cap is also a cost control, since output tokens are the expensive side of most price lists; that angle is covered in how to reduce LLM API costs.

Questions and answers

No. They are different catalog fields with different meanings: one bounds what the model reads, the other bounds a single reply. The table above shows both for two ids, and they are not equal.

In GET /v1/catalog, on the row whose id matches, as context_window and max_output_tokens. The jq line above extracts them, and each model's page on this site shows them.

Carry the null through as "unknown". Show it as unknown in any picker, skip client-side truncation that depends on it, and avoid substituting the other limit or a guessed constant.
Join on Telegram
Help