Azure OpenAI models

API Version: v1

Server: {endpoint}/openai/v1 — Azure AI Foundry Models APIs

Server Variables:

Variable Default Description
endpoint A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://westus.api.cognitive.microsoft.com).

Authentication

ApiKeyAuth (API Key)

Pass your API key in the api-key header.

ApiKeyAuth_ (API Key)

Pass your API key in the authorization header.

OAuth2Auth (OAuth 2.0)

Flow: implicit

Authorization URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

Scopes:

  • https://cognitiveservices.azure.com/.default

Security Requirements

Endpoints accept any one of the following authentication methods:

  1. ApiKeyAuth
  2. ApiKeyAuth_
  3. OAuth2Auth (scopes: https://cognitiveservices.azure.com/.default)

List models

GET {endpoint}/openai/v1/models

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

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://westus.api.cognitive.microsoft.com).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.ListModelsResponse

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null Yes
type string Yes

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Retrieve model

GET {endpoint}/openai/v1/models/{model}

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

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://westus.api.cognitive.microsoft.com).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
model path Yes string The ID of the model to use for this request.

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.Model

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null Yes
type string Yes

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Delete model

DELETE {endpoint}/openai/v1/models/{model}

Deletes a model instance.

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://westus.api.cognitive.microsoft.com).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
model path Yes string The ID of the model to delete.

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.DeleteModelResponse

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null Yes
type string Yes

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Components

AzureAIFoundryModelsApiVersion

Property Value
Type string
Values v1
preview

OpenAI.DeleteModelResponse

Name Type Description Required Default
deleted boolean Yes
id string Yes
object string Yes

OpenAI.ListModelsResponse

Name Type Description Required Default
data array of OpenAI.Model Yes
object enum
Possible values: list
Yes

OpenAI.Model

Model

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

Name Type Description Required Default
created integer (unixtime) The Unix timestamp (in seconds) when the model was created. Yes
id string The model identifier, which can be referenced in the API endpoints. Yes
object enum The object type, which is always "model".
Possible values: model
Yes
owned_by string The organization that owns the model. Yes