Skip to content

Get a list of available models

The Chat Completion API (aka. Messages API) requires that you know the id for the model that you want to use.

Run the following script in python to get a list of available models.

NOTE: Before running any of the examples in this tutorial, be sure to update PLACE_KEY_HERE with your API Key.

import requests
from pprint import pprint

resp = requests.get(
    "https://chat.dartmouth.edu/api/models",
    headers={"Authorization": "bearer PLACE_KEY_HERE"},
)
models = [ model['id'] for model in resp.json()["data"] ]
pprint(models)