Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

Azure OpenAI in Azure AI Foundry Models REST API reference

  • 2025-07-02
Feedback

In this article

This article provides details on the inference REST API endpoints for Azure OpenAI.

API specs

Managing and interacting with Azure OpenAI models and resources is divided across three primary API surfaces:

  • Control plane
  • Data plane - authoring
  • Data plane - inference

Each API surface/specification encapsulates a different set of Azure OpenAI capabilities. Each API has its own unique set of preview and stable/generally available (GA) API releases. Preview releases currently tend to follow a monthly cadence.

Important

There is now a new preview inference API. Learn more in ourAPI lifecycle guide.

APILatest preview releaseLatest GA releaseSpecificationsDescription
Control plane2024-06-01-preview2024-10-01Spec filesAzure OpenAI shares a common control plane with all other services. The control plane API is used for things likecreating Azure OpenAI resources,model deployment, and other higher level resource management tasks. The control plane also governs what is possible to do with capabilities like Azure Resource Manager, Bicep, Terraform, and Azure CLI.
Data plane - authoring2025-04-01-preview2024-10-21Spec filesThe data plane authoring API controlsfine-tuning,file-upload,ingestion jobs,batch and certainmodel level queries
Data plane - inference2025-04-01-preview2024-10-21Spec filesThe data plane inference API provides the inference capabilities/endpoints for features like completions, chat completions, embeddings, audio, on your data, Dall-e, assistants, etc.

Authentication

Azure OpenAI provides two methods for authentication. You can use either API Keys or Microsoft Entra ID.

  • API Key authentication: For this type of authentication, all API requests must include the API Key in theapi-key HTTP header. TheQuickstart provides guidance for how to make calls with this type of authentication.

  • Microsoft Entra ID authentication: You can authenticate an API call using a Microsoft Entra token. Authentication tokens are included in a request as theAuthorization header. The token provided must be preceded byBearer, for exampleBearer YOUR_AUTH_TOKEN. You can read our how-to guide onauthenticating with Microsoft Entra ID.

REST API versioning

The service APIs are versioned using theapi-version query parameter. All versions follow the YYYY-MM-DD date structure. For example:

POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/chat/completions?api-version=2024-06-01

Data plane inference

The rest of the article covers the latest GA release of the Azure OpenAI data plane inference specification,2024-10-21.

If you're looking for documentation on the latest preview API release, refer to thelatest preview data plane inference API

Completions

POST https://{endpoint}/openai/deployments/{deployment-id}/completions?api-version=2024-10-21

Creates a completion for the provided prompt, parameters, and chosen model.

URI Parameters

NameInRequiredTypeDescription
endpointpathYesstring
url
Supported Azure OpenAI endpoints (protocol and hostname, for example:https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI resource name). https://{your-resource-name}.openai.azure.com
deployment-idpathYesstringDeployment ID of the model which was deployed.
api-versionqueryYesstringAPI version

Request Header

NameRequiredTypeDescription
api-keyTruestringProvide Azure OpenAI API key here

Request Body

Content-Type: application/json

NameTypeDescriptionRequiredDefault
promptstring or arrayThe prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.

Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt isn't specified the model will generate as if from the beginning of a new document.
Yes
best_ofintegerGeneratesbest_of completions server-side and returns the "best" (the one with the highest log probability per token). Results can't be streamed.

When used withn,best_of controls the number of candidate completions andn specifies how many to return –best_of must be greater thann.

Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings formax_tokens andstop.
No1
echobooleanEcho back the prompt in addition to the completion
NoFalse
frequency_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
No0
logit_biasobjectModify the likelihood of specified tokens appearing in the completion.

Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.

As an example, you can pass{"50256": -100} to prevent the <|endoftext|> token from being generated.
NoNone
logprobsintegerInclude the log probabilities on thelogprobs most likely output tokens, as well the chosen tokens. For example, iflogprobs is 5, the API will return a list of the five most likely tokens. The API will always return thelogprob of the sampled token, so there may be up tologprobs+1 elements in the response.

The maximum value forlogprobs is 5.
NoNone
max_tokensintegerThe maximum number of tokens that can be generated in the completion.

The token count of your prompt plusmax_tokens can't exceed the model's context length.
No16
nintegerHow many completions to generate for each prompt.

Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings formax_tokens andstop.
No1
presence_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
No0
seedintegerIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the sameseed and parameters should return the same result.

Determinism isn't guaranteed, and you should refer to thesystem_fingerprint response parameter to monitor changes in the backend.
No
stopstring or arrayUp to four sequences where the API will stop generating further tokens. The returned text won't contain the stop sequence.
No
streambooleanWhether to stream back partial progress. If set, tokens will be sent as data-onlyserver-sent events as they become available, with the stream terminated by adata: [DONE] message.NoFalse
suffixstringThe suffix that comes after a completion of inserted text.

This parameter is only supported forgpt-3.5-turbo-instruct.
NoNone
temperaturenumberWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

We generally recommend altering this ortop_p but not both.
No1
top_pnumberAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this ortemperature but not both.
No1
userstringA unique identifier representing your end-user, which can help to monitor and detect abuse.
No

Responses

Status Code: 200

Description: OK

Content-TypeTypeDescription
application/jsoncreateCompletionResponseRepresents a completion response from the API. Note: both the streamed and nonstreamed response objects share the same shape (unlike the chat endpoint).

Status Code: default

Description: Service unavailable

Content-TypeTypeDescription
application/jsonerrorResponse

Examples

Example

Creates a completion for the provided prompt, parameters, and chosen model.

POST https://{endpoint}/openai/deployments/{deployment-id}/completions?api-version=2024-10-21{ "prompt": [  "tell me a joke about mango" ], "max_tokens": 32, "temperature": 1.0, "n": 1}

Responses:Status Code: 200

{  "body": {    "id": "cmpl-7QmVI15qgYVllxK0FtxVGG6ywfzaq",    "created": 1686617332,    "choices": [      {        "text": "es\n\nWhat do you call a mango who's in charge?\n\nThe head mango.",        "index": 0,        "finish_reason": "stop",        "logprobs": null      }    ],    "usage": {      "completion_tokens": 20,      "prompt_tokens": 6,      "total_tokens": 26    }  }}

Embeddings

POST https://{endpoint}/openai/deployments/{deployment-id}/embeddings?api-version=2024-10-21

Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

URI Parameters

NameInRequiredTypeDescription
endpointpathYesstring
url
Supported Azure OpenAI endpoints (protocol and hostname, for example:https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI resource name). https://{your-resource-name}.openai.azure.com
deployment-idpathYesstring
api-versionqueryYesstringAPI version

Request Header

NameRequiredTypeDescription
api-keyTruestringProvide Azure OpenAI API key here

Request Body

Content-Type: application/json

NameTypeDescriptionRequiredDefault
inputstring or arrayInput text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8,192 tokens fortext-embedding-ada-002), can't be an empty string, and any array must be 2,048 dimensions or less.Yes
userstringA unique identifier representing your end-user, which can help monitoring and detecting abuse.No
input_typestringinput type of embedding search to useNo
encoding_formatstringThe format to return the embeddings in. Can be eitherfloat orbase64. Defaults tofloat.No
dimensionsintegerThe number of dimensions the resulting output embeddings should have. Only supported intext-embedding-3 and later models.No

Responses

NameTypeDescriptionRequiredDefault
objectstringYes
modelstringYes
dataarrayYes
usageobjectYes

Properties for usage

prompt_tokens

NameTypeDescriptionDefault
prompt_tokensinteger

total_tokens

NameTypeDescriptionDefault
total_tokensinteger

Status Code: 200

Description: OK

Content-TypeTypeDescription
application/jsonobject

Examples

Example

Return the embeddings for a given prompt.

POST https://{endpoint}/openai/deployments/{deployment-id}/embeddings?api-version=2024-10-21{ "input": [  "this is a test" ]}

Responses:Status Code: 200

{  "body": {    "data": [      {        "index": 0,        "embedding": [          -0.012838088,          -0.007421397,          -0.017617522,          -0.028278312,          -0.018666342,          0.01737855,          -0.01821495,          -0.006950092,          -0.009937238,          -0.038580645,          0.010674067,          0.02412286,          -0.013647936,          0.013189907,          0.0021125758,          0.012406612,          0.020790534,          0.00074595667,          0.008397198,          -0.00535031,          0.008968075,          0.014351576,          -0.014086051,          0.015055214,          -0.022211088,          -0.025198232,          0.0065186154,          -0.036350243,          0.009180495,          -0.009698266,          0.009446018,          -0.008463579,          -0.0040426035,          -0.03443847,          -0.00091273896,          -0.0019217303,          0.002349888,          -0.021560553,          0.016515596,          -0.015572986,          0.0038666942,          -8.432463e-05        ]      }    ],    "usage": {      "prompt_tokens": 4,      "total_tokens": 4    }  }}

Chat completions

POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version=2024-10-21

Creates a completion for the chat message

URI Parameters

NameInRequiredTypeDescription
endpointpathYesstring
url
Supported Azure OpenAI endpoints (protocol and hostname, for example:https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI resource name). https://{your-resource-name}.openai.azure.com
deployment-idpathYesstringDeployment ID of the model which was deployed.
api-versionqueryYesstringAPI version

Request Header

NameRequiredTypeDescription
api-keyTruestringProvide Azure OpenAI API key here

Request Body

Content-Type: application/json

NameTypeDescriptionRequiredDefault
temperaturenumberWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

We generally recommend altering this ortop_p but not both.
No1
top_pnumberAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this ortemperature but not both.
No1
streambooleanIf set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-onlyserver-sent events as they become available, with the stream terminated by adata: [DONE] message.NoFalse
stopstring or arrayUp to four sequences where the API will stop generating further tokens.
No
max_tokensintegerThe maximum number of tokens that can be generated in the chat completion.

The total length of input tokens and generated tokens is limited by the model's context length.
No
max_completion_tokensintegerAn upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.No
presence_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
No0
frequency_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
No0
logit_biasobjectModify the likelihood of specified tokens appearing in the completion.

Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
NoNone
userstringA unique identifier representing your end-user, which can help to monitor and detect abuse.
No
messagesarrayA list of messages comprising the conversation so far.Yes
data_sourcesarrayThe configuration entries for Azure OpenAI chat extensions that use them.
This additional specification is only compatible with Azure OpenAI.
No
logprobsbooleanWhether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in thecontent ofmessage.NoFalse
top_logprobsintegerAn integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.logprobs must be set totrue if this parameter is used.No
nintegerHow many chat completion choices to generate for each input message. Note that you'll be charged based on the number of generated tokens across all of the choices. Keepn as1 to minimize costs.No1
parallel_tool_callsParallelToolCallsWhether to enable parallel function calling during tool use.NoTrue
response_formatResponseFormatText orResponseFormatJsonObject orResponseFormatJsonSchemaAn object specifying the format that the model must output. Compatible withGPT-4o,GPT-4o mini,GPT-4 Turbo and allGPT-3.5 Turbo models newer thangpt-3.5-turbo-1106.

Setting to{ "type": "json_schema", "json_schema": {...} } enables Structured Outputs which guarantees the model will match your supplied JSON schema.

Setting to{ "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON.

Important: when using JSON mode, youmust also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off iffinish_reason="length", which indicates the generation exceededmax_tokens or the conversation exceeded the max context length.
No
seedintegerThis feature is in Beta.
If specified, our system will make a best effort to sample deterministically, such that repeated requests with the sameseed and parameters should return the same result.
Determinism isn't guaranteed, and you should refer to thesystem_fingerprint response parameter to monitor changes in the backend.
No
toolsarrayA list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
No
tool_choicechatCompletionToolChoiceOptionControls which (if any) tool is called by the model.none means the model won't call any tool and instead generates a message.auto means the model can pick between generating a message or calling one or more tools.required means the model must call one or more tools. Specifying a particular tool via{"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.none is the default when no tools are present.auto is the default if tools are present.No
function_callstring orchatCompletionFunctionCallOptionDeprecated in favor oftool_choice.

Controls which (if any) function is called by the model.
none means the model won't call a function and instead generates a message.
auto means the model can pick between generating a message or calling a function.
Specifying a particular function via{"name": "my_function"} forces the model to call that function.

none is the default when no functions are present.auto is the default if functions are present.
No
functionsarrayDeprecated in favor oftools.

A list of functions the model may generate JSON inputs for.
No

Responses

Status Code: 200

Description: OK

Content-TypeTypeDescription
application/jsoncreateChatCompletionResponse orcreateChatCompletionStreamResponse

Status Code: default

Description: Service unavailable

Content-TypeTypeDescription
application/jsonerrorResponse

Examples

Example

Creates a completion for the provided prompt, parameters, and chosen model.

POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version=2024-10-21{ "messages": [  {   "role": "system",   "content": "you are a helpful assistant that talks like a pirate"  },  {   "role": "user",   "content": "can you tell me how to care for a parrot?"  } ]}

Responses:Status Code: 200

{  "body": {    "id": "chatcmpl-7R1nGnsXO8n4oi9UPz2f3UHdgAYMn",    "created": 1686676106,    "choices": [      {        "index": 0,        "finish_reason": "stop",        "message": {          "role": "assistant",          "content": "Ahoy matey! So ye be wantin' to care for a fine squawkin' parrot, eh? Well, shiver me timbers, let ol' Cap'n Assistant share some wisdom with ye! Here be the steps to keepin' yer parrot happy 'n healthy:\n\n1. Secure a sturdy cage: Yer parrot be needin' a comfortable place to lay anchor! Be sure ye get a sturdy cage, at least double the size of the bird's wingspan, with enough space to spread their wings, yarrrr!\n\n2. Perches 'n toys: Aye, parrots need perches of different sizes, shapes, 'n textures to keep their feet healthy. Also, a few toys be helpin' to keep them entertained 'n their minds stimulated, arrrh!\n\n3. Proper grub: Feed yer feathered friend a balanced diet of high-quality pellets, fruits, 'n veggies to keep 'em strong 'n healthy. Give 'em fresh water every day, or ye\u00e2\u20ac\u2122ll have a scurvy bird on yer hands!\n\n4. Cleanliness: Swab their cage deck! Clean their cage on a regular basis: fresh water 'n food daily, the floor every couple of days, 'n a thorough scrubbing ev'ry few weeks, so the bird be livin' in a tidy haven, arrhh!\n\n5. Socialize 'n train: Parrots be a sociable lot, arrr! Exercise 'n interact with 'em daily to create a bond 'n maintain their mental 'n physical health. Train 'em with positive reinforcement, treat 'em kindly, yarrr!\n\n6. Proper rest: Yer parrot be needin' \u00e2\u20ac\u2122bout 10-12 hours o' sleep each night. Cover their cage 'n let them slumber in a dim, quiet quarter for a proper night's rest, ye scallywag!\n\n7. Keep a weather eye open for illness: Birds be hidin' their ailments, arrr! Be watchful for signs of sickness, such as lethargy, loss of appetite, puffin' up, or change in droppings, and make haste to a vet if need be.\n\n8. Provide fresh air 'n avoid toxins: Parrots be sensitive to draft and pollutants. Keep yer quarters well ventilated, but no drafts, arrr! Be mindful of toxins like Teflon fumes, candles, or air fresheners.\n\nSo there ye have it, me hearty! With proper care 'n commitment, yer parrot will be squawkin' \"Yo-ho-ho\" for many years to come! Good luck, sailor, and may the wind be at yer back!"        }      }    ],    "usage": {      "completion_tokens": 557,      "prompt_tokens": 33,      "total_tokens": 590    }  }}

Example

Creates a completion based on Azure Search data and system-assigned managed identity.

POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version=2024-10-21{ "messages": [  {   "role": "user",   "content": "can you tell me how to care for a dog?"  } ], "data_sources": [  {   "type": "azure_search",   "parameters": {    "endpoint": "https://your-search-endpoint.search.windows.net/",    "index_name": "{index name}",    "authentication": {     "type": "system_assigned_managed_identity"    }   }  } ]}

Responses:Status Code: 200

{  "body": {    "id": "chatcmpl-7R1nGnsXO8n4oi9UPz2f3UHdgAYMn",    "created": 1686676106,    "choices": [      {        "index": 0,        "finish_reason": "stop",        "message": {          "role": "assistant",          "content": "Content of the completion [doc1].",          "context": {            "citations": [              {                "content": "Citation content.",                "title": "Citation Title",                "filepath": "contoso.txt",                "url": "https://contoso.blob.windows.net/container/contoso.txt",                "chunk_id": "0"              }            ],            "intent": "dog care"          }        }      }    ],    "usage": {      "completion_tokens": 557,      "prompt_tokens": 33,      "total_tokens": 590    }  }}

Example

Creates a completion based on Azure Search vector data, previous assistant message and user-assigned managed identity.

POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version=2024-10-21{ "messages": [  {   "role": "user",   "content": "can you tell me how to care for a cat?"  },  {   "role": "assistant",   "content": "Content of the completion [doc1].",   "context": {    "intent": "cat care"   }  },  {   "role": "user",   "content": "how about dog?"  } ], "data_sources": [  {   "type": "azure_search",   "parameters": {    "endpoint": "https://your-search-endpoint.search.windows.net/",    "authentication": {     "type": "user_assigned_managed_identity",     "managed_identity_resource_id": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resource-name}"    },    "index_name": "{index name}",    "query_type": "vector",    "embedding_dependency": {     "type": "deployment_name",     "deployment_name": "{embedding deployment name}"    },    "in_scope": true,    "top_n_documents": 5,    "strictness": 3,    "role_information": "You are an AI assistant that helps people find information.",    "fields_mapping": {     "content_fields_separator": "\\n",     "content_fields": [      "content"     ],     "filepath_field": "filepath",     "title_field": "title",     "url_field": "url",     "vector_fields": [      "contentvector"     ]    }   }  } ]}

Responses:Status Code: 200

{  "body": {    "id": "chatcmpl-7R1nGnsXO8n4oi9UPz2f3UHdgAYMn",    "created": 1686676106,    "choices": [      {        "index": 0,        "finish_reason": "stop",        "message": {          "role": "assistant",          "content": "Content of the completion [doc1].",          "context": {            "citations": [              {                "content": "Citation content 2.",                "title": "Citation Title 2",                "filepath": "contoso2.txt",                "url": "https://contoso.blob.windows.net/container/contoso2.txt",                "chunk_id": "0"              }            ],            "intent": "dog care"          }        }      }    ],    "usage": {      "completion_tokens": 557,      "prompt_tokens": 33,      "total_tokens": 590    }  }}

Example

Creates a completion for the provided Azure Cosmos DB.

POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version=2024-10-21{ "messages": [  {   "role": "user",   "content": "can you tell me how to care for a dog?"  } ], "data_sources": [  {   "type": "azure_cosmos_db",   "parameters": {    "authentication": {     "type": "connection_string",     "connection_string": "mongodb+srv://rawantest:{password}$@{cluster-name}.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000"    },    "database_name": "vectordb",    "container_name": "azuredocs",    "index_name": "azuredocindex",    "embedding_dependency": {     "type": "deployment_name",     "deployment_name": "{embedding deployment name}"    },    "fields_mapping": {     "content_fields": [      "content"     ],     "vector_fields": [      "contentvector"     ]    }   }  } ]}

Responses:Status Code: 200

{  "body": {    "id": "chatcmpl-7R1nGnsXO8n4oi9UPz2f3UHdgAYMn",    "created": 1686676106,    "choices": [      {        "index": 0,        "finish_reason": "stop",        "message": {          "role": "assistant",          "content": "Content of the completion [doc1].",          "context": {            "citations": [              {                "content": "Citation content.",                "title": "Citation Title",                "filepath": "contoso.txt",                "url": "https://contoso.blob.windows.net/container/contoso.txt",                "chunk_id": "0"              }            ],            "intent": "dog care"          }        }      }    ],    "usage": {      "completion_tokens": 557,      "prompt_tokens": 33,      "total_tokens": 590    }  }}

Transcriptions - Create

POST https://{endpoint}/openai/deployments/{deployment-id}/audio/transcriptions?api-version=2024-10-21

Transcribes audio into the input language.

URI Parameters

NameInRequiredTypeDescription
endpointpathYesstring
url
Supported Azure OpenAI endpoints (protocol and hostname, for example:https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI resource name). https://{your-resource-name}.openai.azure.com
deployment-idpathYesstringDeployment ID of the speech to text model.

For information about supported models, see [/azure/ai-services/openai/concepts/models#audio-models].
api-versionqueryYesstringAPI version

Request Header

NameRequiredTypeDescription
api-keyTruestringProvide Azure OpenAI API key here

Request Body

Content-Type: multipart/form-data

NameTypeDescriptionRequiredDefault
filestringThe audio file object to transcribe.Yes
promptstringAn optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.No
response_formataudioResponseFormatDefines the format of the output.No
temperaturenumberThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.No0
languagestringThe language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.No

Responses

Status Code: 200

Description: OK

Content-TypeTypeDescription
application/jsonaudioResponse oraudioVerboseResponse
text/plainstringTranscribed text in the output format (when response_format was one of text, vtt or srt).

Examples

Example

Gets transcribed text and associated metadata from provided spoken audio data.

POST https://{endpoint}/openai/deployments/{deployment-id}/audio/transcriptions?api-version=2024-10-21

Responses:Status Code: 200

{  "body": {    "text": "A structured object when requesting json or verbose_json"  }}

Example

Gets transcribed text and associated metadata from provided spoken audio data.

POST https://{endpoint}/openai/deployments/{deployment-id}/audio/transcriptions?api-version=2024-10-21"---multipart-boundary\nContent-Disposition: form-data; name=\"file\"; filename=\"file.wav\"\nContent-Type: application/octet-stream\n\nRIFF..audio.data.omitted\n---multipart-boundary--"

Responses:Status Code: 200

{  "type": "string",  "example": "plain text when requesting text, srt, or vtt"}

Translations - Create

POST https://{endpoint}/openai/deployments/{deployment-id}/audio/translations?api-version=2024-10-21

Transcribes and translates input audio into English text.

URI Parameters

NameInRequiredTypeDescription
endpointpathYesstring
url
Supported Azure OpenAI endpoints (protocol and hostname, for example:https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI resource name). https://{your-resource-name}.openai.azure.com
deployment-idpathYesstringDeployment ID of the whisper model which was deployed.

For information about supported models, see [/azure/ai-services/openai/concepts/models#audio-models].
api-versionqueryYesstringAPI version

Request Header

NameRequiredTypeDescription
api-keyTruestringProvide Azure OpenAI API key here

Request Body

Content-Type: multipart/form-data

NameTypeDescriptionRequiredDefault
filestringThe audio file to translate.Yes
promptstringAn optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.No
response_formataudioResponseFormatDefines the format of the output.No
temperaturenumberThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.No0

Responses

Status Code: 200

Description: OK

Content-TypeTypeDescription
application/jsonaudioResponse oraudioVerboseResponse
text/plainstringTranscribed text in the output format (when response_format was one of text, vtt or srt).

Examples

Example

Gets English language transcribed text and associated metadata from provided spoken audio data.

POST https://{endpoint}/openai/deployments/{deployment-id}/audio/translations?api-version=2024-10-21"---multipart-boundary\nContent-Disposition: form-data; name=\"file\"; filename=\"file.wav\"\nContent-Type: application/octet-stream\n\nRIFF..audio.data.omitted\n---multipart-boundary--"

Responses:Status Code: 200

{  "body": {    "text": "A structured object when requesting json or verbose_json"  }}

Example

Gets English language transcribed text and associated metadata from provided spoken audio data.

POST https://{endpoint}/openai/deployments/{deployment-id}/audio/translations?api-version=2024-10-21"---multipart-boundary\nContent-Disposition: form-data; name=\"file\"; filename=\"file.wav\"\nContent-Type: application/octet-stream\n\nRIFF..audio.data.omitted\n---multipart-boundary--"

Responses:Status Code: 200

{  "type": "string",  "example": "plain text when requesting text, srt, or vtt"}

Image generation

POST https://{endpoint}/openai/deployments/{deployment-id}/images/generations?api-version=2024-10-21

Generates a batch of images from a text caption on a given dall-e model deployment

URI Parameters

NameInRequiredTypeDescription
endpointpathYesstring
url
Supported Azure OpenAI endpoints (protocol and hostname, for example:https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI resource name). https://{your-resource-name}.openai.azure.com
deployment-idpathYesstringDeployment ID of the dall-e model which was deployed.
api-versionqueryYesstringAPI version

Request Header

NameRequiredTypeDescription
api-keyTruestringProvide Azure OpenAI API key here

Request Body

Content-Type: application/json

NameTypeDescriptionRequiredDefault
promptstringA text description of the desired image(s). The maximum length is 4,000 characters.Yes
nintegerThe number of images to generate.No1
sizeimageSizeThe size of the generated images.No1024x1024
response_formatimagesResponseFormatThe format in which the generated images are returned.Nourl
userstringA unique identifier representing your end-user, which can help to monitor and detect abuse.No
qualityimageQualityThe quality of the image that will be generated.Nostandard
styleimageStyleThe style of the generated images.Novivid

Responses

Status Code: 200

Description: Ok

Content-TypeTypeDescription
application/jsongenerateImagesResponse

Status Code: default

Description: An error occurred.

Content-TypeTypeDescription
application/jsondalleErrorResponse

Examples

Example

Creates images given a prompt.

POST https://{endpoint}/openai/deployments/{deployment-id}/images/generations?api-version=2024-10-21{ "prompt": "In the style of WordArt, Microsoft Clippy wearing a cowboy hat.", "n": 1, "style": "natural", "quality": "standard"}

Responses:Status Code: 200

{  "body": {    "created": 1698342300,    "data": [      {        "revised_prompt": "A vivid, natural representation of Microsoft Clippy wearing a cowboy hat.",        "prompt_filter_results": {          "sexual": {            "severity": "safe",            "filtered": false          },          "violence": {            "severity": "safe",            "filtered": false          },          "hate": {            "severity": "safe",            "filtered": false          },          "self_harm": {            "severity": "safe",            "filtered": false          },          "profanity": {            "detected": false,            "filtered": false          }        },        "url": "https://dalletipusw2.blob.core.windows.net/private/images/e5451cc6-b1ad-4747-bd46-b89a3a3b8bc3/generated_00.png?se=2023-10-27T17%3A45%3A09Z&...",        "content_filter_results": {          "sexual": {            "severity": "safe",            "filtered": false          },          "violence": {            "severity": "safe",            "filtered": false          },          "hate": {            "severity": "safe",            "filtered": false          },          "self_harm": {            "severity": "safe",            "filtered": false          }        }      }    ]  }}

Components

errorResponse

NameTypeDescriptionRequiredDefault
errorerrorNo

errorBase

NameTypeDescriptionRequiredDefault
codestringNo
messagestringNo

error

NameTypeDescriptionRequiredDefault
paramstringNo
typestringNo
inner_errorinnerErrorInner error with additional details.No

innerError

Inner error with additional details.

NameTypeDescriptionRequiredDefault
codeinnerErrorCodeError codes for the inner error object.No
content_filter_resultscontentFilterPromptResultsInformation about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer blocklist, if it has been filtered and its id.No

innerErrorCode

Error codes for the inner error object.

Description: Error codes for the inner error object.

Type: string

Default:

Enum Name: InnerErrorCode

Enum Values:

ValueDescription
ResponsibleAIPolicyViolationThe prompt violated one of more content filter rules.

dalleErrorResponse

NameTypeDescriptionRequiredDefault
errordalleErrorNo

dalleError

NameTypeDescriptionRequiredDefault
paramstringNo
typestringNo
inner_errordalleInnerErrorInner error with additional details.No

dalleInnerError

Inner error with additional details.

NameTypeDescriptionRequiredDefault
codeinnerErrorCodeError codes for the inner error object.No
content_filter_resultsdalleFilterResultsInformation about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer blocklist, if it has been filtered and its id.No
revised_promptstringThe prompt that was used to generate the image, if there was any revision to the prompt.No

contentFilterResultBase

NameTypeDescriptionRequiredDefault
filteredbooleanYes

contentFilterSeverityResult

NameTypeDescriptionRequiredDefault
filteredbooleanYes
severitystringNo

contentFilterDetectedResult

NameTypeDescriptionRequiredDefault
filteredbooleanYes
detectedbooleanNo

contentFilterDetectedWithCitationResult

NameTypeDescriptionRequiredDefault
citationobjectNo

Properties for citation

URL

NameTypeDescriptionDefault
URLstring

license

NameTypeDescriptionDefault
licensestring

contentFilterResultsBase

Information about the content filtering results.

NameTypeDescriptionRequiredDefault
sexualcontentFilterSeverityResultNo
violencecontentFilterSeverityResultNo
hatecontentFilterSeverityResultNo
self_harmcontentFilterSeverityResultNo
profanitycontentFilterDetectedResultNo
errorerrorBaseNo

contentFilterPromptResults

Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer blocklist, if it has been filtered and its id.

NameTypeDescriptionRequiredDefault
sexualcontentFilterSeverityResultNo
violencecontentFilterSeverityResultNo
hatecontentFilterSeverityResultNo
self_harmcontentFilterSeverityResultNo
profanitycontentFilterDetectedResultNo
errorerrorBaseNo
jailbreakcontentFilterDetectedResultNo

contentFilterChoiceResults

Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about third party text and profanity, if it has been detected, and if it has been filtered or not. And information about customer blocklist, if it has been filtered and its id.

NameTypeDescriptionRequiredDefault
sexualcontentFilterSeverityResultNo
violencecontentFilterSeverityResultNo
hatecontentFilterSeverityResultNo
self_harmcontentFilterSeverityResultNo
profanitycontentFilterDetectedResultNo
errorerrorBaseNo
protected_material_textcontentFilterDetectedResultNo
protected_material_codecontentFilterDetectedWithCitationResultNo

promptFilterResult

Content filtering results for a single prompt in the request.

NameTypeDescriptionRequiredDefault
prompt_indexintegerNo
content_filter_resultscontentFilterPromptResultsInformation about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer blocklist, if it has been filtered and its id.No

promptFilterResults

Content filtering results for zero or more prompts in the request. In a streaming request, results for different prompts may arrive at different times or in different orders.

No properties defined for this component.

dalleContentFilterResults

Information about the content filtering results.

NameTypeDescriptionRequiredDefault
sexualcontentFilterSeverityResultNo
violencecontentFilterSeverityResultNo
hatecontentFilterSeverityResultNo
self_harmcontentFilterSeverityResultNo

dalleFilterResults

Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer blocklist, if it has been filtered and its id.

NameTypeDescriptionRequiredDefault
sexualcontentFilterSeverityResultNo
violencecontentFilterSeverityResultNo
hatecontentFilterSeverityResultNo
self_harmcontentFilterSeverityResultNo
profanitycontentFilterDetectedResultNo
jailbreakcontentFilterDetectedResultNo

chatCompletionsRequestCommon

NameTypeDescriptionRequiredDefault
temperaturenumberWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
We generally recommend altering this ortop_p but not both.
No1
top_pnumberAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this ortemperature but not both.
No1
streambooleanIf set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by adata: [DONE] message.NoFalse
stopstring or arrayUp to four sequences where the API will stop generating further tokens.No
max_tokensintegerThe maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens). This value is now deprecated in favor ofmax_completion_tokens, and isn't compatible with o1 series models.No4096
max_completion_tokensintegerAn upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.No
presence_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.No0
frequency_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.No0
logit_biasobjectModify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.No
userstringA unique identifier representing your end-user, which can help Azure OpenAI to monitor and detect abuse.No

createCompletionRequest

NameTypeDescriptionRequiredDefault
promptstring or arrayThe prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.

Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt isn't specified the model will generate as if from the beginning of a new document.
Yes
best_ofintegerGeneratesbest_of completions server-side and returns the "best" (the one with the highest log probability per token). Results can't be streamed.

When used withn,best_of controls the number of candidate completions andn specifies how many to return –best_of must be greater thann.

Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings formax_tokens andstop.
No1
echobooleanEcho back the prompt in addition to the completion
NoFalse
frequency_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
No0
logit_biasobjectModify the likelihood of specified tokens appearing in the completion.

Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.

As an example, you can pass{"50256": -100} to prevent the <|endoftext|> token from being generated.
NoNone
logprobsintegerInclude the log probabilities on thelogprobs most likely output tokens, as well the chosen tokens. For example, iflogprobs is 5, the API will return a list of the five most likely tokens. The API will always return thelogprob of the sampled token, so there may be up tologprobs+1 elements in the response.

The maximum value forlogprobs is 5.
NoNone
max_tokensintegerThe maximum number of tokens that can be generated in the completion.

The token count of your prompt plusmax_tokens can't exceed the model's context length.
No16
nintegerHow many completions to generate for each prompt.

Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings formax_tokens andstop.
No1
presence_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
No0
seedintegerIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the sameseed and parameters should return the same result.

Determinism isn't guaranteed, and you should refer to thesystem_fingerprint response parameter to monitor changes in the backend.
No
stopstring or arrayUp to four sequences where the API will stop generating further tokens. The returned text won't contain the stop sequence.
No
streambooleanWhether to stream back partial progress. If set, tokens will be sent as data-onlyserver-sent events as they become available, with the stream terminated by adata: [DONE] message.NoFalse
suffixstringThe suffix that comes after a completion of inserted text.

This parameter is only supported forgpt-3.5-turbo-instruct.
NoNone
temperaturenumberWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

We generally recommend altering this ortop_p but not both.
No1
top_pnumberAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this ortemperature but not both.
No1
userstringA unique identifier representing your end-user, which can help to monitor and detect abuse.
No

createCompletionResponse

Represents a completion response from the API. Note: both the streamed and nonstreamed response objects share the same shape (unlike the chat endpoint).

NameTypeDescriptionRequiredDefault
idstringA unique identifier for the completion.Yes
choicesarrayThe list of completion choices the model generated for the input prompt.Yes
createdintegerThe Unix timestamp (in seconds) of when the completion was created.Yes
modelstringThe model used for completion.Yes
prompt_filter_resultspromptFilterResultsContent filtering results for zero or more prompts in the request. In a streaming request, results for different prompts may arrive at different times or in different orders.No
system_fingerprintstringThis fingerprint represents the backend configuration that the model runs with.

Can be used in conjunction with theseed request parameter to understand when backend changes have been made that might impact determinism.
No
objectenumThe object type, which is always "text_completion"
Possible values: text_completion
Yes
usagecompletionUsageUsage statistics for the completion request.No

createChatCompletionRequest

NameTypeDescriptionRequiredDefault
temperaturenumberWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

We generally recommend altering this ortop_p but not both.
No1
top_pnumberAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this ortemperature but not both.
No1
streambooleanIf set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-onlyserver-sent events as they become available, with the stream terminated by adata: [DONE] message.NoFalse
stopstring or arrayUp to four sequences where the API will stop generating further tokens.
No
max_tokensintegerThe maximum number of tokens that can be generated in the chat completion.

The total length of input tokens and generated tokens is limited by the model's context length.
No
max_completion_tokensintegerAn upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.No
presence_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
No0
frequency_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
No0
logit_biasobjectModify the likelihood of specified tokens appearing in the completion.

Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
NoNone
userstringA unique identifier representing your end-user, which can help to monitor and detect abuse.
No
messagesarrayA list of messages comprising the conversation so far.Yes
data_sourcesarrayThe configuration entries for Azure OpenAI chat extensions that use them.
This additional specification is only compatible with Azure OpenAI.
No
logprobsbooleanWhether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in thecontent ofmessage.NoFalse
top_logprobsintegerAn integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.logprobs must be set totrue if this parameter is used.No
nintegerHow many chat completion choices to generate for each input message. Note that you'll be charged based on the number of generated tokens across all of the choices. Keepn as1 to minimize costs.No1
parallel_tool_callsParallelToolCallsWhether to enable parallel function calling during tool use.NoTrue
response_formatResponseFormatText orResponseFormatJsonObject orResponseFormatJsonSchemaAn object specifying the format that the model must output. Compatible withGPT-4o,GPT-4o mini,GPT-4 Turbo and allGPT-3.5 Turbo models newer thangpt-3.5-turbo-1106.

Setting to{ "type": "json_schema", "json_schema": {...} } enables Structured Outputs which guarantees the model will match your supplied JSON schema.

Setting to{ "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON.

Important: when using JSON mode, youmust also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off iffinish_reason="length", which indicates the generation exceededmax_tokens or the conversation exceeded the max context length.
No
seedintegerThis feature is in Beta.
If specified, our system will make a best effort to sample deterministically, such that repeated requests with the sameseed and parameters should return the same result.
Determinism isn't guaranteed, and you should refer to thesystem_fingerprint response parameter to monitor changes in the backend.
No
toolsarrayA list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
No
tool_choicechatCompletionToolChoiceOptionControls which (if any) tool is called by the model.none means the model won't call any tool and instead generates a message.auto means the model can pick between generating a message or calling one or more tools.required means the model must call one or more tools. Specifying a particular tool via{"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.none is the default when no tools are present.auto is the default if tools are present.No
function_callstring orchatCompletionFunctionCallOptionDeprecated in favor oftool_choice.

Controls which (if any) function is called by the model.
none means the model won't call a function and instead generates a message.
auto means the model can pick between generating a message or calling a function.
Specifying a particular function via{"name": "my_function"} forces the model to call that function.

none is the default when no functions are present.auto is the default if functions are present.
No
functionsarrayDeprecated in favor oftools.

A list of functions the model may generate JSON inputs for.
No

chatCompletionFunctions

NameTypeDescriptionRequiredDefault
descriptionstringA description of what the function does, used by the model to choose when and how to call the function.No
namestringThe name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.Yes
parametersFunctionParametersThe parameters the functions accepts, described as a JSON Schema object.See the guide for examples, and theJSON Schema reference for documentation about the format.

Omittingparameters defines a function with an empty parameter list.
No

chatCompletionFunctionCallOption

Specifying a particular function via{"name": "my_function"} forces the model to call that function.

NameTypeDescriptionRequiredDefault
namestringThe name of the function to call.Yes

chatCompletionRequestMessage

This component can be one of the following:

chatCompletionRequestSystemMessage

NameTypeDescriptionRequiredDefault
contentstring or arrayThe contents of the system message.Yes
roleenumThe role of the messages author, in this casesystem.
Possible values: system
Yes
namestringAn optional name for the participant. Provides the model information to differentiate between participants of the same role.No

chatCompletionRequestUserMessage

NameTypeDescriptionRequiredDefault
contentstring or arrayThe contents of the user message.
Yes
roleenumThe role of the messages author, in this caseuser.
Possible values: user
Yes
namestringAn optional name for the participant. Provides the model information to differentiate between participants of the same role.No

chatCompletionRequestAssistantMessage

NameTypeDescriptionRequiredDefault
contentstring or arrayThe contents of the assistant message. Required unlesstool_calls orfunction_call is specified.
No
refusalstringThe refusal message by the assistant.No
roleenumThe role of the messages author, in this caseassistant.
Possible values: assistant
Yes
namestringAn optional name for the participant. Provides the model information to differentiate between participants of the same role.No
tool_callschatCompletionMessageToolCallsThe tool calls generated by the model, such as function calls.No
function_callobjectDeprecated and replaced bytool_calls. The name and arguments of a function that should be called, as generated by the model.No

Properties for function_call

arguments

NameTypeDescriptionDefault
argumentsstringThe arguments to call the function with, as generated by the model in JSON format. Note that the model doesn't always generate valid JSON, and may generate parameters not defined by your function schema. Validate the arguments in your code before calling your function.

name

NameTypeDescriptionDefault
namestringThe name of the function to call.

chatCompletionRequestToolMessage

NameTypeDescriptionRequiredDefault
roleenumThe role of the messages author, in this casetool.
Possible values: tool
Yes
contentstring or arrayThe contents of the tool message.Yes
tool_call_idstringTool call that this message is responding to.Yes

chatCompletionRequestFunctionMessage

NameTypeDescriptionRequiredDefault
roleenumThe role of the messages author, in this casefunction.
Possible values: function
Yes
contentstringThe contents of the function message.Yes
namestringThe name of the function to call.Yes

chatCompletionRequestSystemMessageContentPart

This component can be one of the following:

chatCompletionRequestUserMessageContentPart

This component can be one of the following:

chatCompletionRequestAssistantMessageContentPart

This component can be one of the following:

chatCompletionRequestToolMessageContentPart

This component can be one of the following:

chatCompletionRequestMessageContentPartText

NameTypeDescriptionRequiredDefault
typeenumThe type of the content part.
Possible values: text
Yes
textstringThe text content.Yes

chatCompletionRequestMessageContentPartImage

NameTypeDescriptionRequiredDefault
typeenumThe type of the content part.
Possible values: image_url
Yes
image_urlobjectYes

Properties for image_url

url

NameTypeDescriptionDefault
urlstringEither a URL of the image or the base64 encoded image data.

detail

NameTypeDescriptionDefault
detailstringSpecifies the detail level of the image. Learn more in theVision guide.auto

chatCompletionRequestMessageContentPartRefusal

NameTypeDescriptionRequiredDefault
typeenumThe type of the content part.
Possible values: refusal
Yes
refusalstringThe refusal message generated by the model.Yes

azureChatExtensionConfiguration

A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chatcompletions request that should use Azure OpenAI chat extensions to augment the response behavior.The use of this configuration is compatible only with Azure OpenAI.

NameTypeDescriptionRequiredDefault
typeazureChatExtensionTypeA representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat
completions request that should use Azure OpenAI chat extensions to augment the response behavior.
The use of this configuration is compatible only with Azure OpenAI.
Yes

azureChatExtensionType

A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chatcompletions request that should use Azure OpenAI chat extensions to augment the response behavior.The use of this configuration is compatible only with Azure OpenAI.

Description: A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat completions request that should use Azure OpenAI chat extensions to augment the response behavior. The use of this configuration is compatible only with Azure OpenAI.

Type: string

Default:

Enum Name: AzureChatExtensionType

Enum Values:

ValueDescription
azure_searchRepresents the use of Azure Search as an Azure OpenAI chat extension.
azure_cosmos_dbRepresents the use of Azure Cosmos DB as an Azure OpenAI chat extension.

azureSearchChatExtensionConfiguration

A specific representation of configurable options for Azure Search when using it as an Azure OpenAI chatextension.

NameTypeDescriptionRequiredDefault
typeazureChatExtensionTypeA representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat
completions request that should use Azure OpenAI chat extensions to augment the response behavior.
The use of this configuration is compatible only with Azure OpenAI.
Yes
parametersazureSearchChatExtensionParametersParameters for Azure Search when used as an Azure OpenAI chat extension.No

azureSearchChatExtensionParameters

Parameters for Azure Search when used as an Azure OpenAI chat extension.

NameTypeDescriptionRequiredDefault
authenticationonYourDataApiKeyAuthenticationOptions oronYourDataSystemAssignedManagedIdentityAuthenticationOptions oronYourDataUserAssignedManagedIdentityAuthenticationOptionsYes
top_n_documentsintegerThe configured top number of documents to feature for the configured query.No
in_scopebooleanWhether queries should be restricted to use of indexed data.No
strictnessintegerThe configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer.No
role_informationstringGive the model instructions about how it should behave and any context it should reference when generating a response. You can describe the assistant's personality and tell it how to format responses. There's a 100 token limit for it, and it counts against the overall token limit.No
endpointstringThe absolute endpoint path for the Azure Search resource to use.Yes
index_namestringThe name of the index to use as available in the referenced Azure Search resource.Yes
fields_mappingazureSearchIndexFieldMappingOptionsOptional settings to control how fields are processed when using a configured Azure Search resource.No
query_typeazureSearchQueryTypeThe type of Azure Search retrieval query that should be executed when using it as an Azure OpenAI chat extension.No
semantic_configurationstringThe additional semantic configuration for the query.No
filterstringSearch filter.No
embedding_dependencyonYourDataEndpointVectorizationSource oronYourDataDeploymentNameVectorizationSourceNo

azureSearchIndexFieldMappingOptions

Optional settings to control how fields are processed when using a configured Azure Search resource.

NameTypeDescriptionRequiredDefault
title_fieldstringThe name of the index field to use as a title.No
url_fieldstringThe name of the index field to use as a URL.No
filepath_fieldstringThe name of the index field to use as a filepath.No
content_fieldsarrayThe names of index fields that should be treated as content.No
content_fields_separatorstringThe separator pattern that content fields should use.No
vector_fieldsarrayThe names of fields that represent vector data.No

azureSearchQueryType

The type of Azure Search retrieval query that should be executed when using it as an Azure OpenAI chat extension.

Description: The type of Azure Search retrieval query that should be executed when using it as an Azure OpenAI chat extension.

Type: string

Default:

Enum Name: AzureSearchQueryType

Enum Values:

ValueDescription
simpleRepresents the default, simple query parser.
semanticRepresents the semantic query parser for advanced semantic modeling.
vectorRepresents vector search over computed data.
vector_simple_hybridRepresents a combination of the simple query strategy with vector data.
vector_semantic_hybridRepresents a combination of semantic search and vector data querying.

azureCosmosDBChatExtensionConfiguration

A specific representation of configurable options for Azure Cosmos DB when using it as an Azure OpenAI chatextension.

NameTypeDescriptionRequiredDefault
typeazureChatExtensionTypeA representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat
completions request that should use Azure OpenAI chat extensions to augment the response behavior.
The use of this configuration is compatible only with Azure OpenAI.
Yes
parametersazureCosmosDBChatExtensionParametersParameters to use when configuring Azure OpenAI On Your Data chat extensions when using Azure Cosmos DB for
MongoDB vCore.
No

azureCosmosDBChatExtensionParameters

Parameters to use when configuring Azure OpenAI On Your Data chat extensions when using Azure Cosmos DB forMongoDB vCore.

NameTypeDescriptionRequiredDefault
authenticationonYourDataConnectionStringAuthenticationOptionsThe authentication options for Azure OpenAI On Your Data when using a connection string.Yes
top_n_documentsintegerThe configured top number of documents to feature for the configured query.No
in_scopebooleanWhether queries should be restricted to use of indexed data.No
strictnessintegerThe configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer.No
role_informationstringGive the model instructions about how it should behave and any context it should reference when generating a response. You can describe the assistant's personality and tell it how to format responses. There's a 100 token limit for it, and it counts against the overall token limit.No
database_namestringThe MongoDB vCore database name to use with Azure Cosmos DB.Yes
container_namestringThe name of the Azure Cosmos DB resource container.Yes
index_namestringThe MongoDB vCore index name to use with Azure Cosmos DB.Yes
fields_mappingazureCosmosDBFieldMappingOptionsOptional settings to control how fields are processed when using a configured Azure Cosmos DB resource.Yes
embedding_dependencyonYourDataEndpointVectorizationSource oronYourDataDeploymentNameVectorizationSourceYes

azureCosmosDBFieldMappingOptions

Optional settings to control how fields are processed when using a configured Azure Cosmos DB resource.

NameTypeDescriptionRequiredDefault
title_fieldstringThe name of the index field to use as a title.No
url_fieldstringThe name of the index field to use as a URL.No
filepath_fieldstringThe name of the index field to use as a filepath.No
content_fieldsarrayThe names of index fields that should be treated as content.Yes
content_fields_separatorstringThe separator pattern that content fields should use.No
vector_fieldsarrayThe names of fields that represent vector data.Yes

onYourDataAuthenticationOptions

The authentication options for Azure OpenAI On Your Data.

NameTypeDescriptionRequiredDefault
typeonYourDataAuthenticationTypeThe authentication types supported with Azure OpenAI On Your Data.Yes

onYourDataAuthenticationType

The authentication types supported with Azure OpenAI On Your Data.

Description: The authentication types supported with Azure OpenAI On Your Data.

Type: string

Default:

Enum Name: OnYourDataAuthenticationType

Enum Values:

ValueDescription
api_keyAuthentication via API key.
connection_stringAuthentication via connection string.
system_assigned_managed_identityAuthentication via system-assigned managed identity.
user_assigned_managed_identityAuthentication via user-assigned managed identity.

onYourDataApiKeyAuthenticationOptions

The authentication options for Azure OpenAI On Your Data when using an API key.

NameTypeDescriptionRequiredDefault
typeonYourDataAuthenticationTypeThe authentication types supported with Azure OpenAI On Your Data.Yes
keystringThe API key to use for authentication.No

onYourDataConnectionStringAuthenticationOptions

The authentication options for Azure OpenAI On Your Data when using a connection string.

NameTypeDescriptionRequiredDefault
typeonYourDataAuthenticationTypeThe authentication types supported with Azure OpenAI On Your Data.Yes
connection_stringstringThe connection string to use for authentication.No

onYourDataSystemAssignedManagedIdentityAuthenticationOptions

The authentication options for Azure OpenAI On Your Data when using a system-assigned managed identity.

NameTypeDescriptionRequiredDefault
typeonYourDataAuthenticationTypeThe authentication types supported with Azure OpenAI On Your Data.Yes

onYourDataUserAssignedManagedIdentityAuthenticationOptions

The authentication options for Azure OpenAI On Your Data when using a user-assigned managed identity.

NameTypeDescriptionRequiredDefault
typeonYourDataAuthenticationTypeThe authentication types supported with Azure OpenAI On Your Data.Yes
managed_identity_resource_idstringThe resource ID of the user-assigned managed identity to use for authentication.No

onYourDataVectorizationSource

An abstract representation of a vectorization source for Azure OpenAI On Your Data with vector search.

NameTypeDescriptionRequiredDefault
typeonYourDataVectorizationSourceTypeRepresents the available sources Azure OpenAI On Your Data can use to configure vectorization of data for use with
vector search.
Yes

onYourDataVectorizationSourceType

Represents the available sources Azure OpenAI On Your Data can use to configure vectorization of data for use withvector search.

Description: Represents the available sources Azure OpenAI On Your Data can use to configure vectorization of data for use with
vector search.

Type: string

Default:

Enum Name: OnYourDataVectorizationSourceType

Enum Values:

ValueDescription
endpointRepresents vectorization performed by public service calls to an Azure OpenAI embedding model.
deployment_nameRepresents an Ada model deployment name to use. This model deployment must be in the same Azure OpenAI resource, but
On Your Data will use this model deployment via an internal call rather than a public one, which enables vector
search even in private networks.

onYourDataDeploymentNameVectorizationSource

The details of a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is basedon an internal embeddings model deployment name in the same Azure OpenAI resource.

NameTypeDescriptionRequiredDefault
typeonYourDataVectorizationSourceTypeRepresents the available sources Azure OpenAI On Your Data can use to configure vectorization of data for use with
vector search.
Yes
deployment_namestringSpecifies the name of the model deployment to use for vectorization. This model deployment must be in the same Azure OpenAI resource, but On Your Data will use this model deployment via an internal call rather than a public one, which enables vector search even in private networks.No

onYourDataEndpointVectorizationSource

The details of a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is basedon a public Azure OpenAI endpoint call for embeddings.

NameTypeDescriptionRequiredDefault
typeonYourDataVectorizationSourceTypeRepresents the available sources Azure OpenAI On Your Data can use to configure vectorization of data for use with
vector search.
Yes
authenticationonYourDataApiKeyAuthenticationOptionsThe authentication options for Azure OpenAI On Your Data when using an API key.No
endpointstringSpecifies the endpoint to use for vectorization. This endpoint must be in the same Azure OpenAI resource, but On Your Data will use this endpoint via an internal call rather than a public one, which enables vector search even in private networks.No

azureChatExtensionsMessageContext

A representation of the additional context information available when Azure OpenAI chat extensions are involvedin the generation of a corresponding chat completions response. This context information is only populated whenusing an Azure OpenAI request configured to use a matching extension.

NameTypeDescriptionRequiredDefault
citationsarrayThe data source retrieval result, used to generate the assistant message in the response.No
intentstringThe detected intent from the chat history, used to pass to the next turn to carry over the context.No

citation

citation information for a chat completions response message.

NameTypeDescriptionRequiredDefault
contentstringThe content of the citation.Yes
titlestringThe title of the citation.No
urlstringThe URL of the citation.No
filepathstringThe file path of the citation.No
chunk_idstringThe chunk ID of the citation.No

chatCompletionMessageToolCall

NameTypeDescriptionRequiredDefault
idstringThe ID of the tool call.Yes
typetoolCallTypeThe type of the tool call, in this casefunction.Yes
functionobjectThe function that the model called.Yes

Properties for function

name

NameTypeDescriptionDefault
namestringThe name of the function to call.

arguments

NameTypeDescriptionDefault
argumentsstringThe arguments to call the function with, as generated by the model in JSON format. Note that the model doesn't always generate valid JSON, and may generate parameters not defined by your function schema. Validate the arguments in your code before calling your function.

toolCallType

The type of the tool call, in this casefunction.

Description: The type of the tool call, in this casefunction.

Type: string

Default:

Enum Name: ToolCallType

Enum Values:

ValueDescription
functionThe tool call type is function.

chatCompletionRequestMessageTool

NameTypeDescriptionRequiredDefault
tool_call_idstringTool call that this message is responding to.No
contentstringThe contents of the message.No

chatCompletionRequestMessageFunction

NameTypeDescriptionRequiredDefault
roleenumThe role of the messages author, in this casefunction.
Possible values: function
No
namestringThe contents of the message.No
contentstringThe contents of the message.No

createChatCompletionResponse

Represents a chat completion response returned by model, based on the provided input.

NameTypeDescriptionRequiredDefault
idstringA unique identifier for the chat completion.Yes
prompt_filter_resultspromptFilterResultsContent filtering results for zero or more prompts in the request. In a streaming request, results for different prompts may arrive at different times or in different orders.No
choicesarrayA list of chat completion choices. Can be more than one ifn is greater than 1.Yes
createdintegerThe Unix timestamp (in seconds) of when the chat completion was created.Yes
modelstringThe model used for the chat completion.Yes
system_fingerprintstringThis fingerprint represents the backend configuration that the model runs with.

Can be used in conjunction with theseed request parameter to understand when backend changes have been made that might impact determinism.
No
objectenumThe object type, which is alwayschat.completion.
Possible values: chat.completion
Yes
usagecompletionUsageUsage statistics for the completion request.No

createChatCompletionStreamResponse

Represents a streamed chunk of a chat completion response returned by model, based on the provided input.

NameTypeDescriptionRequiredDefault
idstringA unique identifier for the chat completion. Each chunk has the same ID.Yes
choicesarrayA list of chat completion choices. Can contain more than one elements ifn is greater than 1.
Yes
createdintegerThe Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.Yes
modelstringThe model to generate the completion.Yes
system_fingerprintstringThis fingerprint represents the backend configuration that the model runs with.
Can be used in conjunction with theseed request parameter to understand when backend changes have been made that might impact determinism.
No
objectenumThe object type, which is alwayschat.completion.chunk.
Possible values: chat.completion.chunk
Yes

chatCompletionStreamResponseDelta

A chat completion delta generated by streamed model responses.

NameTypeDescriptionRequiredDefault
contentstringThe contents of the chunk message.No
function_callobjectDeprecated and replaced bytool_calls. The name and arguments of a function that should be called, as generated by the model.No
tool_callsarrayNo
roleenumThe role of the author of this message.
Possible values: system, user, assistant, tool
No
refusalstringThe refusal message generated by the model.No

Properties for function_call

arguments

NameTypeDescriptionDefault
argumentsstringThe arguments to call the function with, as generated by the model in JSON format. Note that the model doesn't always generate valid JSON, and may generate parameters not defined by your function schema. Validate the arguments in your code before calling your function.

name

NameTypeDescriptionDefault
namestringThe name of the function to call.

chatCompletionMessageToolCallChunk

NameTypeDescriptionRequiredDefault
indexintegerYes
idstringThe ID of the tool call.No
typeenumThe type of the tool. Currently, onlyfunction is supported.
Possible values: function
No
functionobjectNo

Properties for function

name

NameTypeDescriptionDefault
namestringThe name of the function to call.

arguments

NameTypeDescriptionDefault
argumentsstringThe arguments to call the function with, as generated by the model in JSON format. Note that the model doesn't always generate valid JSON, and may generate parameters not defined by your function schema. Validate the arguments in your code before calling your function.

chatCompletionStreamOptions

Options for streaming response. Only set this when you setstream: true.

NameTypeDescriptionRequiredDefault
include_usagebooleanIf set, an additional chunk will be streamed before thedata: [DONE] message. Theusage field on this chunk shows the token usage statistics for the entire request, and thechoices field will always be an empty array. All other chunks will also include ausage field, but with a null value.
No

chatCompletionChoiceLogProbs

Log probability information for the choice.

NameTypeDescriptionRequiredDefault
contentarrayA list of message content tokens with log probability information.Yes
refusalarrayA list of message refusal tokens with log probability information.No

chatCompletionTokenLogprob

NameTypeDescriptionRequiredDefault
tokenstringThe token.Yes
logprobnumberThe log probability of this token.Yes
bytesarrayA list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can benull if there's no bytes representation for the token.Yes
top_logprobsarrayList of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requestedtop_logprobs returned.Yes

chatCompletionResponseMessage

A chat completion message generated by the model.

NameTypeDescriptionRequiredDefault
rolechatCompletionResponseMessageRoleThe role of the author of the response message.Yes
refusalstringThe refusal message generated by the model.Yes
contentstringThe contents of the message.Yes
tool_callsarrayThe tool calls generated by the model, such as function calls.No
function_callchatCompletionFunctionCallDeprecated and replaced bytool_calls. The name and arguments of a function that should be called, as generated by the model.No
contextazureChatExtensionsMessageContextA representation of the additional context information available when Azure OpenAI chat extensions are involved
in the generation of a corresponding chat completions response. This context information is only populated when
using an Azure OpenAI request configured to use a matching extension.
No

chatCompletionResponseMessageRole

The role of the author of the response message.

Description: The role of the author of the response message.

Type: string

Default:

Enum Values:

  • assistant

chatCompletionToolChoiceOption

Controls which (if any) tool is called by the model.none means the model won't call any tool and instead generates a message.auto means the model can pick between generating a message or calling one or more tools.required means the model must call one or more tools. Specifying a particular tool via{"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.none is the default when no tools are present.auto is the default if tools are present.

This component can be one of the following:

chatCompletionNamedToolChoice

Specifies a tool the model should use. Use to force the model to call a specific function.

NameTypeDescriptionRequiredDefault
typeenumThe type of the tool. Currently, onlyfunction is supported.
Possible values: function
Yes
functionobjectYes

Properties for function

name

NameTypeDescriptionDefault
namestringThe name of the function to call.

ParallelToolCalls

Whether to enable parallel function calling during tool use.

No properties defined for this component.

chatCompletionMessageToolCalls

The tool calls generated by the model, such as function calls.

No properties defined for this component.

chatCompletionFunctionCall

Deprecated and replaced bytool_calls. The name and arguments of a function that should be called, as generated by the model.

NameTypeDescriptionRequiredDefault
namestringThe name of the function to call.Yes
argumentsstringThe arguments to call the function with, as generated by the model in JSON format. Note that the model doesn't always generate valid JSON, and may generate parameters not defined by your function schema. Validate the arguments in your code before calling your function.Yes

completionUsage

Usage statistics for the completion request.

NameTypeDescriptionRequiredDefault
prompt_tokensintegerNumber of tokens in the prompt.Yes
completion_tokensintegerNumber of tokens in the generated completion.Yes
total_tokensintegerTotal number of tokens used in the request (prompt + completion).Yes
completion_tokens_detailsobjectBreakdown of tokens used in a completion.No

Properties for completion_tokens_details

reasoning_tokens

NameTypeDescriptionDefault
reasoning_tokensintegerTokens generated by the model for reasoning.

chatCompletionTool

NameTypeDescriptionRequiredDefault
typeenumThe type of the tool. Currently, onlyfunction is supported.
Possible values: function
Yes
functionFunctionObjectYes

FunctionParameters

The parameters the functions accepts, described as a JSON Schema object.See the guide for examples, and theJSON Schema reference for documentation about the format.

Omittingparameters defines a function with an empty parameter list.

No properties defined for this component.

FunctionObject

NameTypeDescriptionRequiredDefault
descriptionstringA description of what the function does, used by the model to choose when and how to call the function.No
namestringThe name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.Yes
parametersFunctionParametersThe parameters the functions accepts, described as a JSON Schema object.See the guide for examples, and theJSON Schema reference for documentation about the format.

Omittingparameters defines a function with an empty parameter list.
No
strictbooleanWhether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in theparameters field. Only a subset of JSON Schema is supported whenstrict istrue.NoFalse

ResponseFormatText

NameTypeDescriptionRequiredDefault
typeenumThe type of response format being defined:text
Possible values: text
Yes

ResponseFormatJsonObject

NameTypeDescriptionRequiredDefault
typeenumThe type of response format being defined:json_object
Possible values: json_object
Yes

ResponseFormatJsonSchemaSchema

The schema for the response format, described as a JSON Schema object.

No properties defined for this component.

ResponseFormatJsonSchema

NameTypeDescriptionRequiredDefault
typeenumThe type of response format being defined:json_schema
Possible values: json_schema
Yes
json_schemaobjectYes

Properties for json_schema

description

NameTypeDescriptionDefault
descriptionstringA description of what the response format is for, used by the model to determine how to respond in the format.

name

NameTypeDescriptionDefault
namestringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

schema

NameTypeDescriptionDefault
schemaResponseFormatJsonSchemaSchemaThe schema for the response format, described as a JSON Schema object.

strict

NameTypeDescriptionDefault
strictbooleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in theschema field. Only a subset of JSON Schema is supported whenstrict istrue.False

chatCompletionChoiceCommon

NameTypeDescriptionRequiredDefault
indexintegerNo
finish_reasonstringNo

createTranslationRequest

Translation request.

NameTypeDescriptionRequiredDefault
filestringThe audio file to translate.Yes
promptstringAn optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.No
response_formataudioResponseFormatDefines the format of the output.No
temperaturenumberThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.No0

audioResponse

Translation or transcription response when response_format was json

NameTypeDescriptionRequiredDefault
textstringTranslated or transcribed text.Yes

audioVerboseResponse

Translation or transcription response when response_format was verbose_json

NameTypeDescriptionRequiredDefault
textstringTranslated or transcribed text.Yes
taskstringType of audio task.No
languagestringLanguage.No
durationnumberDuration.No
segmentsarrayNo

audioResponseFormat

Defines the format of the output.

Description: Defines the format of the output.

Type: string

Default:

Enum Values:

  • json
  • text
  • srt
  • verbose_json
  • vtt

createTranscriptionRequest

Transcription request.

NameTypeDescriptionRequiredDefault
filestringThe audio file object to transcribe.Yes
promptstringAn optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.No
response_formataudioResponseFormatDefines the format of the output.No
temperaturenumberThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.No0
languagestringThe language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.No

audioSegment

Transcription or translation segment.

NameTypeDescriptionRequiredDefault
idintegerSegment identifier.No
seeknumberOffset of the segment.No
startnumberSegment start offset.No
endnumberSegment end offset.No
textstringSegment text.No
tokensarrayTokens of the text.No
temperaturenumberTemperature.No
avg_logprobnumberAverage log probability.No
compression_rationumberCompression ratio.No
no_speech_probnumberProbability ofno speech.No

imageQuality

The quality of the image that will be generated.

Description: The quality of the image that will be generated.

Type: string

Default: standard

Enum Name: Quality

Enum Values:

ValueDescription
standardStandard quality creates images with standard quality.
hdHD quality creates images with finer details and greater consistency across the image.

imagesResponseFormat

The format in which the generated images are returned.

Description: The format in which the generated images are returned.

Type: string

Default: url

Enum Name: ImagesResponseFormat

Enum Values:

ValueDescription
urlThe URL that provides temporary access to download the generated images.
b64_jsonThe generated images are returned as base64 encoded string.

imageSize

The size of the generated images.

Description: The size of the generated images.

Type: string

Default: 1024x1024

Enum Name: Size

Enum Values:

ValueDescription
1792x1024The desired size of the generated image is 1792x1024 pixels.
1024x1792The desired size of the generated image is 1024x1792 pixels.
1024x1024The desired size of the generated image is 1024x1024 pixels.

imageStyle

The style of the generated images.

Description: The style of the generated images.

Type: string

Default: vivid

Enum Name: Style

Enum Values:

ValueDescription
vividVivid creates images that are hyper-realistic and dramatic.
naturalNatural creates images that are more natural and less hyper-realistic.

imageGenerationsRequest

NameTypeDescriptionRequiredDefault
promptstringA text description of the desired image(s). The maximum length is 4,000 characters.Yes
nintegerThe number of images to generate.No1
sizeimageSizeThe size of the generated images.No1024x1024
response_formatimagesResponseFormatThe format in which the generated images are returned.Nourl
userstringA unique identifier representing your end-user, which can help to monitor and detect abuse.No
qualityimageQualityThe quality of the image that will be generated.Nostandard
styleimageStyleThe style of the generated images.Novivid

generateImagesResponse

NameTypeDescriptionRequiredDefault
createdintegerThe unix timestamp when the operation was created.Yes
dataarrayThe result data of the operation, if successfulYes

imageResult

The image url or encoded image if successful, and an error otherwise.

NameTypeDescriptionRequiredDefault
urlstringThe image url.No
b64_jsonstringThe base64 encoded imageNo
content_filter_resultsdalleContentFilterResultsInformation about the content filtering results.No
revised_promptstringThe prompt that was used to generate the image, if there was any revision to the prompt.No
prompt_filter_resultsdalleFilterResultsInformation about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer blocklist, if it has been filtered and its id.No

Completions extensions

Completions extensions aren't part of the latest GA version of the Azure OpenAI data plane inference spec.

Chatmessage

The Chat message object isn't part of the latest GA version of the Azure OpenAI data plane inference spec.

Text to speech (Preview)

Is not currently part of the latest Azure OpenAI GA version of the Azure OpenAI data plane inference spec. Refer to the latestpreview version for this capability.

Next steps

Learn aboutModels, and fine-tuning with the REST API.Learn more about theunderlying models that power Azure OpenAI.


Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo