Reading model context window limits instead of hardcoding them
CCDV-F
Model Selection & Optimization
Easy
Question 85 of 105
A gateway service hardcodes each model's context window and output limit in a config file. Every model release forces a code change, and a stale entry recently caused prompt-too-long errors.
Which source should the service read those limits from instead?
Show answer and explanation
AThe Models API, which returns max_input_tokens, max_tokens and capabilities
The Models API returns max_input_tokens, max_tokens and a capabilities object for every available model, so the gateway can read limits at runtime instead of shipping a config change per release. The other three descriptions are accurate and none of them is a ceiling: the usage object reports what a single request consumed, the token counting endpoint reports the size of the request you sent, and the deprecations page publishes lifecycle status and retirement dates rather than token limits.
Anonymous, no account needed. Your tally stays in this browser.