Models - List

Gets a list of all models that are accessible by the Azure OpenAI resource. These include base models as well as all successfully completed fine-tuned models owned by the Azure OpenAI resource.

GET {endpoint}/openai/models?api-version=2024-06-01

URI Parameters

Name In Required Type Description
endpoint
path True

string

url

Supported Cognitive Services endpoints (protocol and hostname, for example: https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI account name).

api-version
query True

string

The requested API version.

Request Header

Name Required Type Description
api-key True

string

Provide your Cognitive Services Azure OpenAI account key here.

Responses

Name Type Description
200 OK

ModelList

Success

Other Status Codes

ErrorResponse

An error occurred.

Security

api-key

Provide your Cognitive Services Azure OpenAI account key here.

Type: apiKey
In: header

Examples

Getting all models owned by account.

Sample request

GET https://aoairesource.openai.azure.com/openai/models?api-version=2024-06-01

Sample response

{
  "data": [
    {
      "capabilities": {
        "fine_tune": true,
        "inference": true,
        "completion": true,
        "chat_completion": false,
        "embeddings": false
      },
      "lifecycle_status": "generally-available",
      "deprecation": {
        "fine_tune": 1677662127,
        "inference": 1709284527
      },
      "id": "curie",
      "status": "succeeded",
      "created_at": 1646126127,
      "object": "model"
    },
    {
      "model": "curie",
      "fine_tune": "ft-72a2792ef7d24ba7b82c7fe4a37e379f",
      "capabilities": {
        "fine_tune": false,
        "inference": true,
        "completion": true,
        "chat_completion": false,
        "embeddings": false
      },
      "lifecycle_status": "generally-available",
      "deprecation": {
        "inference": 1709284527
      },
      "id": "curie.ft-72a2792ef7d24ba7b82c7fe4a37e379f",
      "status": "succeeded",
      "created_at": 1646126127,
      "object": "model"
    }
  ],
  "object": "list"
}

Definitions

Name Description
Capabilities

Capabilities

Deprecation

Deprecation

Error

Error

ErrorCode

ErrorCode

ErrorResponse

ErrorResponse

FineTuningState

FineTuningState

InnerError

InnerError

InnerErrorCode

InnerErrorCode

LifeCycleStatus

LifeCycleStatus

Model

Model

ModelList

ModelList

TypeDiscriminator

TypeDiscriminator

Capabilities

Capabilities

Name Type Description
chat_completion

boolean

A value indicating whether a model supports chat completion.

completion

boolean

A value indicating whether a model supports completion.

embeddings

boolean

A value indicating whether a model supports embeddings.

fine_tune

boolean

A value indicating whether a model can be used for fine tuning.

inference

boolean

A value indicating whether a model can be deployed.

Deprecation

Deprecation

Name Type Description
fine_tune

integer

The end date of fine tune support of this model. Will be null for fine tune models.

inference

integer

The end date of inference support of this model.

Error

Error

Name Type Description
code

ErrorCode

ErrorCode
Error codes as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

details

Error[]

The error details if available.

innererror

InnerError

InnerError
Inner error as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

message

string

The message of this error.

target

string

The location where the error happened if available.

ErrorCode

ErrorCode

Name Type Description
conflict

string

The requested operation conflicts with the current resource state.

contentFilter

string

Image generation failed as a result of our safety system.

fileImportFailed

string

Import of file failed.

forbidden

string

The operation is forbidden for the current user/api key.

internalFailure

string

Internal error. Please retry.

invalidPayload

string

The request data is invalid for this operation.

itemDoesAlreadyExist

string

The item does already exist.

jsonlValidationFailed

string

Validation of jsonl data failed.

notFound

string

The resource is not found.

quotaExceeded

string

Quota exceeded.

serviceUnavailable

string

The service is currently not available.

tooManyRequests

string

Too many requests. Please retry later.

unauthorized

string

The current user/api key is not authorized for the operation.

unexpectedEntityState

string

The operation cannot be executed in the current resource's state.

ErrorResponse

ErrorResponse

Name Type Description
error

Error

Error
Error content as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

FineTuningState

FineTuningState

Name Type Description
cancelled

string

The operation has been cancelled and is incomplete. It can be categorized as a terminal state.

created

string

The operation was created. This state is not returned by Azure OpenAI and exposed only for compatibility. It can be categorized as an inactive state.

failed

string

The operation has completed processing with a failure and cannot be further consumed. It can be categorized as a terminal state.

pending

string

The operation is not yet queued to be processed in the future. It can be categorized as an inactive state.

running

string

The operation has started to be processed. It can be categorized as an active state.

succeeded

string

The operation has successfully be processed and is ready for consumption. It can be categorized as a terminal state.

InnerError

InnerError

Name Type Description
code

InnerErrorCode

InnerErrorCode
Inner error codes as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

innererror

InnerError

InnerError
Inner error as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

InnerErrorCode

InnerErrorCode

Name Type Description
invalidPayload

string

The request data is invalid for this operation.

LifeCycleStatus

LifeCycleStatus

Name Type Description
generally-available

string

Model is generally available.

preview

string

Model is in preview and covered by the service preview terms.

Model

Model

Name Type Description
capabilities

Capabilities

Capabilities
The capabilities of a base or fine tune model.

created_at

integer

A timestamp when this job or item was created (in unix epochs).

deprecation

Deprecation

Deprecation
Defines the dates of deprecation for the different use cases of a model. Usually base models support 1 year of fine tuning after creation. Inference is typically supported 2 years after creation of base or fine tuned models. The exact dates are specified in the properties.

fine_tune

string

The fine tune job identity (fine-tune-id) if this is a fine tune model; otherwise null.

id

string

The identity of this item.

lifecycle_status

LifeCycleStatus

LifeCycleStatus
The life cycle status of a model. Note: A model can be promoted from "preview" to "generally-available", but never from "generally-available" to "preview".

model

string

The base model identity (model-id) if this is a fine tune model; otherwise null.

object

TypeDiscriminator

TypeDiscriminator
Defines the type of an object.

status

FineTuningState

FineTuningState
The state of a finetunes object or fine tuning job.

ModelList

ModelList

Name Type Description
data

Model[]

The list of items.

object

TypeDiscriminator

TypeDiscriminator
Defines the type of an object.

TypeDiscriminator

TypeDiscriminator

Name Type Description
file

string

This object represents a file.

fine_tuning.job

string

This object represents a fine tune job.

fine_tuning.job.checkpoint

string

This object represents a checkpoint of a fine tuning job.

fine_tuning.job.event

string

This object represents an event of a fine tuning job.

list

string

This object represents a list of other objects.

model

string

This object represents a model (can be a base model or fine tune job result).