Guardrails and usage
token_ceiling
Rejects provider-bound requests whose estimated serialized request body or requested output exceeds configured limits.
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
| Field | Type | Required | Description |
|---|---|---|---|
max_input_tokens | integer | no | Maximum number of tokens in the serialized provider-bound JSON body. This includes JSON keys, model/tool schemas, and non-text data. |
max_output_tokens | integer | no | Maximum requested output tokens. The request must contain exactly one of max_output_tokens, max_completion_tokens, or max_tokens. |
tokenizer | cl100k_base | o200k_base | no | Tiktoken encoding used for the serialized request-body estimate. |
max_body_bytes | integer | no | Maximum 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