#How can I see what models are available to me?

1 messages · Page 1 of 1 (latest)

tiny flicker
#

I have api access, what's a good way to see what models and files I have available?

vestal citrusBOT
#

Hi @tiny flicker. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

You can view the available models and files through the OpenAI API.

To see the available models, you can use the listModels method in the "Models" group of the API. This method is a GET request to /models and it lists the currently available models, providing basic information about each one such as the owner and availability. Here is the API endpoint for this:

GET /models

This operation does not require authentication. You can find more details about this in the OpenAI API documentation (https://platform.openai.com/docs/api-reference).

To see the files that belong to your organization, you can use the listFiles method in the "Files" group of the API. This method is a GET request to /files. Here is the API endpoint for this:

GET /files

You can also filter the files by their purpose by adding a query parameter purpose to the request. More details about this can be found in the OpenAI API documentation (https://platform.openai.com/docs/api-reference).

Please note that you need to replace /models and /files with the actual URL of the OpenAI API.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@tiny flicker kapa.ai is still learning and improving, please let us know how it did by reacting below

tiny flicker
#

@vestal citrus What is an example snippet of code to pull models?

vestal citrusBOT
#

Let me check the knowledge base for you. One moment! :books:

#

Sure, here is an example snippet of code to list models using the OpenAI Python library. This code was extracted from a GitHub issue (https://github.com/openai/openai-python/issues/470) in the OpenAI Python library:

import openai

openai.api_key = "your-api-key"

# List models
models = openai.Model.list()

# Print the first model's id
print(models.data[0].id)

Please replace "your-api-key" with your actual OpenAI API key. Remember to keep your API key secure and do not expose it in your code or public repositories. You can read more about best practices for API key safety in the OpenAI documentation (https://platform.openai.com/docs/guides/production-best-practices).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: