Understanding the Available Models and Which One to Use

OpenAI Available Models and Important Considerations

Using the API’s models endpoint, you can list all available models. Let’s see how this works in practice:

cat << EOF > src/test_api.py
from api import client

models = client.models.list()
for model in models:
    print(vars(model))
EOF

Run the code:

python src/test_api.py

You should see a similar output to this:

{
    'id': 'curie-search-query', 
    'created': 1651172509, 
    'object': 'model', 
    'owned_by': 'openai-dev'
}

{
    'id': 'babbage-search-query', 
    'created': 1651172509, 
    'object': 'model', 
    'owned_by': 'openai-dev'
}

    {
    'id': 'dall-e-3', 
    'created': 1698785189, 
    'object': 'model', 
    'owned_by': 'system'
}
... etc

The OpenAI Python SDK is intuitive ...

Get OpenAI GPT For Python Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.