(AFAIK the last 2 are returned in response headers, but we shouldn't need a dummy request to get at this info; the info doesn't depend on the request!).
This way a developer can create a product that:
informs users of new models,
auto-selects the most appropriate model,
is able to react to new models (or pricing changes) without requiring a software update
I'm using the HTTP API directly and currently I have to maintain my own table:
Please add a
/models
endpoint that returns information about available models.So I can do, e.g.:
models['opus']['latest']['context_token_limits']['input']
my_model['daily_limit']['output_tokens']
my_model['daily_limit']['next_reset_time_utc']
(AFAIK the last 2 are returned in response headers, but we shouldn't need a dummy request to get at this info; the info doesn't depend on the request!).
This way a developer can create a product that:
I'm using the HTTP API directly and currently I have to maintain my own table:
And a quick search shows you are doing the same thing! https://github.com/search?q=repo%3Aanthropics%2Fanthropic-sdk-python%20claude-3-haiku-20240307&type=code
In fact you're having to break "single-source-of-truth" as this information exists in 2 places in the repo.
This works for now, as you only have one generation of models. But think a year down the line!