PRODUCTION SCENARIO
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?
Answering here is anonymous. Nothing is saved unless you sign in.
Show answer and explanation
Answer: The 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.
Official Source: https://platform.claude.com/docs/en/models/overview ↗