#Is there a way to query the API for a list of models working with the chat completions endpoint?

9 messages · Page 1 of 1 (latest)

lethal heath
median sable
lethal heath
#

Thank you!

I briefly looked over the code and it seems to get its information from the API models and models/{model_id} endpoints, which do not seem to expose the information in question, unless I missed something!?

median sable
#

You are right, it does not show endpoints

#

(P.S. to automate ones going away you can just ping the endpoint and see if you get a response or not found)

lethal heath
#

Well, yes, I could just query all models I get from the models list and send a chat completion request. It's not elegant, but maybe the only solution, thanks!

For a non-supported model I get:

{
"message": "This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?",
"code": null,
"type": "invalid_request_error"
}

median sable
#

That's about the only way to check them as there is not other official way to my knowledge, That a good response to check against to trigger whatever outcome you are aiming for.