I need to programmatically get a list of models with costs and capabilities. Why can I not get this through the API? And why can I not just hit https://platform.openai.com/docs/models/ and a model page like https://platform.openai.com/docs/models/o4-mini with curl to scrape it myself? Why do you block attempts at me trying to automatically get model features and prices? Why are you making it so hard on your customers? I know why, OpenAI DESPISES THEIR CUSTOMERS.
Yeah, I’m running into the same issue. It would be really nice if the API supported querying of model capabilities and could return per-model pricing information. To get around this, I’m just grabbing the ‘model_prices_and_context_window.json’ from the LiteLLM project at:
It seems to have a pretty comprehensive list of model capabilities and prices. It even has the latest gpt-4.1 models. I’m just loading the JSON directly into my NestJS service. It’s nicely indexed by model name, so I can easily do a lookup for the model data I need.