token_ceiling

Rejects provider-bound requests whose estimated serialized request body or requested output exceeds configured limits.

Versions marked “overview” do not contain this page. Selecting one opens that version’s documentation overview.

On this page

Rejects provider-bound requests whose estimated serialized request body or requested output exceeds configured limits. Missing output-limit fields are rejected when max_output_tokens is configured; this strict behavior prevents providers from applying an unbounded model default. At least one of max_input_tokens or max_output_tokens is required, and max_body_bytes defaults to 2 MiB.

Configuration

FieldTypeRequiredDescription
max_input_tokensintegernoMaximum number of tokens in the serialized provider-bound JSON body. This includes JSON keys, model/tool schemas, and non-text data.
max_output_tokensintegernoMaximum requested output tokens. The request must contain exactly one of max_output_tokens, max_completion_tokens, or max_tokens.
tokenizercl100k_base | o200k_basenoTiktoken encoding used for the serialized request-body estimate.
max_body_bytesintegernoMaximum request-body bytes buffered for validation. Defaults to 2 MiB.

Example

filter: token_ceiling
max_input_tokens: 4000
max_output_tokens: 1024
tokenizer: cl100k_base
max_body_bytes: 2097152