How do I Programmatically Fetch and Manage All Available Models to be used via OpenAI API?

Hi All,

I am using various models via API in different use cases. We are seeing that continuously new models are being released with varied capabilities. I was wondering if there is a way to programmatically fetch all the models including the latest ones with their uses like chat completion, responses, Realtime etc. so that we can easily select any model for testing or using them in various use cases.

Currently, I manually go to the OpenAI API documentation site and looking for any models or even older ones and seeing their python request code snippet and then integrating them in the code. For the models with same request structure, I have a dictionary with these models. But this does not seem to be an efficient way for testing models.

Any suggestion or some resources, packages, tools or best practices that are available which might be useful?

Thank You.

https://platform.openai.com/docs/api-reference/models

Yes, I have used models list requests. But this just provides with a list of models, not what kind of requests and structure does those models allow (chat completions, Reponses etc.)

well, unless you scrape the docs, I don’t think there’s a solution for that. There’s no formal API.

1 Like

Yes, it seems that way.
Thank you

1 Like

it as if…one informs the other, like a 1-1 bond?

Hello, llama?