Models

List and describe the various models available in the API. You can refer to the Models documentation to understand what models are available and the differences between them.source

List models

get https://api.openai.com/v1/models

Lists the currently available models, and provides basic information about each one such as the owner and availability.source

Returns

A list of model objects.source

Example request
1
2
curl https://api.openai.com/v1/models \
  -H "Authorization: Bearer $OPENAI_API_KEY"
Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
  "object": "list",
  "data": [
    {
      "id": "model-id-0",
      "object": "model",
      "created": 1686935002,
      "owned_by": "organization-owner"
    },
    {
      "id": "model-id-1",
      "object": "model",
      "created": 1686935002,
      "owned_by": "organization-owner",
    },
    {
      "id": "model-id-2",
      "object": "model",
      "created": 1686935002,
      "owned_by": "openai"
    },
  ],
  "object": "list"
}

Retrieve model

get https://api.openai.com/v1/models/{model}

Retrieves a model instance, providing basic information about the model such as the owner and permissioning.source

Path parameters

The ID of the model to use for this requestsource

Returns

The model object matching the specified ID.source

Example request
1
2
curl https://api.openai.com/v1/models/gpt-4o \
  -H "Authorization: Bearer $OPENAI_API_KEY"
Response
1
2
3
4
5
6
{
  "id": "gpt-4o",
  "object": "model",
  "created": 1686935002,
  "owned_by": "openai"
}

Delete a fine-tuned model

delete https://api.openai.com/v1/models/{model}

Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.source

Path parameters

The model to deletesource

Returns

Deletion status.source

Example request
1
2
3
curl https://api.openai.com/v1/models/ft:gpt-4o-mini:acemeco:suffix:abc123 \
  -X DELETE \
  -H "Authorization: Bearer $OPENAI_API_KEY"
Response
1
2
3
4
5
{
  "id": "ft:gpt-4o-mini:acemeco:suffix:abc123",
  "object": "model",
  "deleted": true
}

The model object

Describes an OpenAI model offering that can be used with the API.source

The model identifier, which can be referenced in the API endpoints.source

The Unix timestamp (in seconds) when the model was created.source

The object type, which is always "model".source

The organization that owns the model.source

OBJECT The model object
1
2
3
4
5
6
{
  "id": "gpt-4o",
  "object": "model",
  "created": 1686935002,
  "owned_by": "openai"
}