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.
Azure OpenAI shares a common control plane with all other Azure AI Services. The control plane API is used for things like creating 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.
The data plane inference API provides the inference capabilities/endpoints for features like completions, chat completions, embeddings, speech/whisper, 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 the api-key HTTP header. The Quickstart 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 the Authorization header. The token provided must be preceded by Bearer, for example Bearer YOUR_AUTH_TOKEN. You can read our how-to guide on authenticating with Microsoft Entra ID.
REST API versioning
The service APIs are versioned using the api-version query parameter. All versions follow the YYYY-MM-DD date structure. For example:
HTTP
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.
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
Name
In
Required
Type
Description
endpoint
path
Yes
string 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-id
path
Yes
string
Deployment ID of the model which was deployed.
api-version
query
Yes
string
API version
Request Header
Name
Required
Type
Description
api-key
True
string
Provide Azure OpenAI API key here
Request Body
Content-Type: application/json
Name
Type
Description
Required
Default
prompt
string or array
The 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_of
integer
Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). Results can't be streamed.
When used with n, best_of controls the number of candidate completions and n specifies how many to return – best_of must be greater than n.
Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop.
No
1
echo
boolean
Echo back the prompt in addition to the completion
No
False
frequency_penalty
number
Number 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.
No
0
logit_bias
object
Modify 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.
No
None
logprobs
integer
Include the log probabilities on the logprobs most likely output tokens, as well the chosen tokens. For example, if logprobs is 5, the API will return a list of the five most likely tokens. The API will always return the logprob of the sampled token, so there may be up to logprobs+1 elements in the response.
The maximum value for logprobs is 5.
No
None
max_tokens
integer
The maximum number of tokens that can be generated in the completion.
The token count of your prompt plus max_tokens can't exceed the model's context length.
No
16
n
integer
How 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 for max_tokens and stop.
No
1
presence_penalty
number
Number 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.
No
0
seed
integer
If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
Determinism isn't guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.
No
stop
string or array
Up to four sequences where the API will stop generating further tokens. The returned text won't contain the stop sequence.
No
stream
boolean
Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message.
No
False
suffix
string
The suffix that comes after a completion of inserted text.
This parameter is only supported for gpt-3.5-turbo-instruct.
No
None
temperature
number
What 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 or top_p but not both.
No
1
top_p
number
An 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 or temperature but not both.
No
1
user
string
A unique identifier representing your end-user, which can help to monitor and detect abuse.
Represents a completion response from the API. Note: both the streamed and nonstreamed response objects share the same shape (unlike the chat endpoint).
Creates a completion for the provided prompt, parameters, and chosen model.
HTTP
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
JSON
{
"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
HTTP
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
Name
In
Required
Type
Description
endpoint
path
Yes
string 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-id
path
Yes
string
api-version
query
Yes
string
API version
Request Header
Name
Required
Type
Description
api-key
True
string
Provide Azure OpenAI API key here
Request Body
Content-Type: application/json
Name
Type
Description
Required
Default
input
string or array
Input 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 for text-embedding-ada-002), can't be an empty string, and any array must be 2,048 dimensions or less.
Yes
user
string
A unique identifier representing your end-user, which can help monitoring and detecting abuse.
No
input_type
string
input type of embedding search to use
No
encoding_format
string
The format to return the embeddings in. Can be either float or base64. Defaults to float.
No
dimensions
integer
The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.
No
Responses
Name
Type
Description
Required
Default
object
string
Yes
model
string
Yes
data
array
Yes
usage
object
Yes
Properties for usage
prompt_tokens
Name
Type
Description
Default
prompt_tokens
integer
total_tokens
Name
Type
Description
Default
total_tokens
integer
Status Code: 200
Description: OK
Content-Type
Type
Description
application/json
object
Examples
Example
Return the embeddings for a given prompt.
HTTP
POST https://{endpoint}/openai/deployments/{deployment-id}/embeddings?api-version=2024-10-21
{
"input": [
"this is a test"
]
}
POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version=2024-10-21
Creates a completion for the chat message
URI Parameters
Name
In
Required
Type
Description
endpoint
path
Yes
string 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-id
path
Yes
string
Deployment ID of the model which was deployed.
api-version
query
Yes
string
API version
Request Header
Name
Required
Type
Description
api-key
True
string
Provide Azure OpenAI API key here
Request Body
Content-Type: application/json
Name
Type
Description
Required
Default
temperature
number
What 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 or top_p but not both.
No
1
top_p
number
An 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 or temperature but not both.
No
1
stream
boolean
If 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 a data: [DONE] message.
No
False
stop
string or array
Up to four sequences where the API will stop generating further tokens.
No
max_tokens
integer
The 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_tokens
integer
An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
No
presence_penalty
number
Number 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.
No
0
frequency_penalty
number
Number 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.
No
0
logit_bias
object
Modify 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
None
user
string
A unique identifier representing your end-user, which can help to monitor and detect abuse.
No
messages
array
A list of messages comprising the conversation so far.
Yes
data_sources
array
The configuration entries for Azure OpenAI chat extensions that use them. This additional specification is only compatible with Azure OpenAI.
No
logprobs
boolean
Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
No
False
top_logprobs
integer
An 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 to true if this parameter is used.
No
n
integer
How 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. Keep n as 1 to minimize costs.
An object specifying the format that the model must output. Compatible with GPT-4o, GPT-4o mini, GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-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, you must 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 if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
No
seed
integer
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism isn't guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.
No
tools
array
A 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.
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.
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
functions
array
Deprecated in favor of tools.
A list of functions the model may generate JSON inputs for.
Creates a completion for the provided prompt, parameters, and chosen model.
HTTP
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
JSON
{
"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.
HTTP
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"
}
}
}
]
}
POST https://{endpoint}/openai/deployments/{deployment-id}/audio/transcriptions?api-version=2024-10-21
Transcribes audio into the input language.
URI Parameters
Name
In
Required
Type
Description
endpoint
path
Yes
string 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-id
path
Yes
string
Deployment ID of the whisper model.
api-version
query
Yes
string
API version
Request Header
Name
Required
Type
Description
api-key
True
string
Provide Azure OpenAI API key here
Request Body
Content-Type: multipart/form-data
Name
Type
Description
Required
Default
file
string
The audio file object to transcribe.
Yes
prompt
string
An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
The 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.
No
0
language
string
The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.
Transcribed 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.
HTTP
POST https://{endpoint}/openai/deployments/{deployment-id}/audio/transcriptions?api-version=2024-10-21
Responses:
Status Code: 200
JSON
{
"body": {
"text": "A structured object when requesting json or verbose_json"
}
}
Example
Gets transcribed text and associated metadata from provided spoken audio data.
HTTP
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
JSON
{
"type": "string",
"example": "plain text when requesting text, srt, or vtt"
}
Translations - Create
HTTP
POST https://{endpoint}/openai/deployments/{deployment-id}/audio/translations?api-version=2024-10-21
Transcribes and translates input audio into English text.
URI Parameters
Name
In
Required
Type
Description
endpoint
path
Yes
string 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-id
path
Yes
string
Deployment ID of the whisper model which was deployed.
api-version
query
Yes
string
API version
Request Header
Name
Required
Type
Description
api-key
True
string
Provide Azure OpenAI API key here
Request Body
Content-Type: multipart/form-data
Name
Type
Description
Required
Default
file
string
The audio file to translate.
Yes
prompt
string
An optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.
The 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.
Transcribed 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.
HTTP
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
JSON
{
"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.
HTTP
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
JSON
{
"type": "string",
"example": "plain text when requesting text, srt, or vtt"
}
Image generation
HTTP
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
Name
In
Required
Type
Description
endpoint
path
Yes
string 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-id
path
Yes
string
Deployment ID of the dall-e model which was deployed.
api-version
query
Yes
string
API version
Request Header
Name
Required
Type
Description
api-key
True
string
Provide Azure OpenAI API key here
Request Body
Content-Type: application/json
Name
Type
Description
Required
Default
prompt
string
A text description of the desired image(s). The maximum length is 4,000 characters.
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"
}
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.
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:
Value
Description
ResponsibleAIPolicyViolation
The prompt violated one of more content filter rules.
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.
No
revised_prompt
string
The prompt that was used to generate the image, if there was any revision to the prompt.
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.
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.
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.
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.
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.
What 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 or top_p but not both.
No
1
top_p
number
An 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 or temperature but not both.
No
1
stream
boolean
If 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 a data: [DONE] message.
No
False
stop
string or array
Up to four sequences where the API will stop generating further tokens.
No
max_tokens
integer
The 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 of max_completion_tokens, and isn't compatible with o1 series models.
No
4096
max_completion_tokens
integer
An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
No
presence_penalty
number
Number 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.
No
0
frequency_penalty
number
Number 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.
No
0
logit_bias
object
Modify 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
user
string
A unique identifier representing your end-user, which can help Azure OpenAI to monitor and detect abuse.
No
createCompletionRequest
Name
Type
Description
Required
Default
prompt
string or array
The 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_of
integer
Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). Results can't be streamed.
When used with n, best_of controls the number of candidate completions and n specifies how many to return – best_of must be greater than n.
Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop.
No
1
echo
boolean
Echo back the prompt in addition to the completion
No
False
frequency_penalty
number
Number 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.
No
0
logit_bias
object
Modify 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.
No
None
logprobs
integer
Include the log probabilities on the logprobs most likely output tokens, as well the chosen tokens. For example, if logprobs is 5, the API will return a list of the five most likely tokens. The API will always return the logprob of the sampled token, so there may be up to logprobs+1 elements in the response.
The maximum value for logprobs is 5.
No
None
max_tokens
integer
The maximum number of tokens that can be generated in the completion.
The token count of your prompt plus max_tokens can't exceed the model's context length.
No
16
n
integer
How 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 for max_tokens and stop.
No
1
presence_penalty
number
Number 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.
No
0
seed
integer
If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
Determinism isn't guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.
No
stop
string or array
Up to four sequences where the API will stop generating further tokens. The returned text won't contain the stop sequence.
No
stream
boolean
Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message.
No
False
suffix
string
The suffix that comes after a completion of inserted text.
This parameter is only supported for gpt-3.5-turbo-instruct.
No
None
temperature
number
What 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 or top_p but not both.
No
1
top_p
number
An 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 or temperature but not both.
No
1
user
string
A 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).
Name
Type
Description
Required
Default
id
string
A unique identifier for the completion.
Yes
choices
array
The list of completion choices the model generated for the input prompt.
Yes
created
integer
The Unix timestamp (in seconds) of when the completion was created.
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
system_fingerprint
string
This fingerprint represents the backend configuration that the model runs with.
Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.
No
object
enum
The object type, which is always "text_completion" Possible values: text_completion
What 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 or top_p but not both.
No
1
top_p
number
An 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 or temperature but not both.
No
1
stream
boolean
If 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 a data: [DONE] message.
No
False
stop
string or array
Up to four sequences where the API will stop generating further tokens.
No
max_tokens
integer
The 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_tokens
integer
An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
No
presence_penalty
number
Number 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.
No
0
frequency_penalty
number
Number 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.
No
0
logit_bias
object
Modify 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
None
user
string
A unique identifier representing your end-user, which can help to monitor and detect abuse.
No
messages
array
A list of messages comprising the conversation so far.
Yes
data_sources
array
The configuration entries for Azure OpenAI chat extensions that use them. This additional specification is only compatible with Azure OpenAI.
No
logprobs
boolean
Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
No
False
top_logprobs
integer
An 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 to true if this parameter is used.
No
n
integer
How 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. Keep n as 1 to minimize costs.
An object specifying the format that the model must output. Compatible with GPT-4o, GPT-4o mini, GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-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, you must 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 if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
No
seed
integer
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism isn't guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.
No
tools
array
A 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.
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.
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
functions
array
Deprecated in favor of tools.
A list of functions the model may generate JSON inputs for.
No
chatCompletionFunctions
Name
Type
Description
Required
Default
description
string
A description of what the function does, used by the model to choose when and how to call the function.
No
name
string
The 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.
The parameters the functions accepts, described as a JSON Schema object. See the guide for examples, and the JSON Schema reference for documentation about the format.
Omitting parameters 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.
Name
Type
Description
Required
Default
name
string
The name of the function to call.
Yes
chatCompletionRequestMessage
This component can be one of the following:
chatCompletionRequestSystemMessage
Name
Type
Description
Required
Default
content
string or array
The contents of the system message.
Yes
role
enum
The role of the messages author, in this case system. Possible values: system
Yes
name
string
An optional name for the participant. Provides the model information to differentiate between participants of the same role.
No
chatCompletionRequestUserMessage
Name
Type
Description
Required
Default
content
string or array
The contents of the user message.
Yes
role
enum
The role of the messages author, in this case user. Possible values: user
Yes
name
string
An optional name for the participant. Provides the model information to differentiate between participants of the same role.
No
chatCompletionRequestAssistantMessage
Name
Type
Description
Required
Default
content
string or array
The contents of the assistant message. Required unless tool_calls or function_call is specified.
No
refusal
string
The refusal message by the assistant.
No
role
enum
The role of the messages author, in this case assistant. Possible values: assistant
Yes
name
string
An optional name for the participant. Provides the model information to differentiate between participants of the same role.
The tool calls generated by the model, such as function calls.
No
function_call
object
Deprecated and replaced by tool_calls. The name and arguments of a function that should be called, as generated by the model.
No
Properties for function_call
arguments
Name
Type
Description
Default
arguments
string
The 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
Name
Type
Description
Default
name
string
The name of the function to call.
chatCompletionRequestToolMessage
Name
Type
Description
Required
Default
role
enum
The role of the messages author, in this case tool. Possible values: tool
Yes
content
string or array
The contents of the tool message.
Yes
tool_call_id
string
Tool call that this message is responding to.
Yes
chatCompletionRequestFunctionMessage
Name
Type
Description
Required
Default
role
enum
The role of the messages author, in this case function. Possible values: function
Yes
content
string
The contents of the function message.
Yes
name
string
The 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
Name
Type
Description
Required
Default
type
enum
The type of the content part. Possible values: text
Yes
text
string
The text content.
Yes
chatCompletionRequestMessageContentPartImage
Name
Type
Description
Required
Default
type
enum
The type of the content part. Possible values: image_url
Yes
image_url
object
Yes
Properties for image_url
url
Name
Type
Description
Default
url
string
Either a URL of the image or the base64 encoded image data.
detail
Name
Type
Description
Default
detail
string
Specifies the detail level of the image. Learn more in the Vision guide.
auto
chatCompletionRequestMessageContentPartRefusal
Name
Type
Description
Required
Default
type
enum
The type of the content part. Possible values: refusal
Yes
refusal
string
The 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 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.
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.
Yes
azureChatExtensionType
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.
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:
Value
Description
azure_search
Represents the use of Azure Search as an Azure OpenAI chat extension.
azure_cosmos_db
Represents 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 chat
extension.
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.
The configured top number of documents to feature for the configured query.
No
in_scope
boolean
Whether queries should be restricted to use of indexed data.
No
strictness
integer
The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer.
No
role_information
string
Give 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
endpoint
string
The absolute endpoint path for the Azure Search resource to use.
Yes
index_name
string
The name of the index to use as available in the referenced Azure Search resource.
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.
The authentication options for Azure OpenAI On Your Data when using a connection string.
Yes
top_n_documents
integer
The configured top number of documents to feature for the configured query.
No
in_scope
boolean
Whether queries should be restricted to use of indexed data.
No
strictness
integer
The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer.
No
role_information
string
Give 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_name
string
The MongoDB vCore database name to use with Azure Cosmos DB.
Yes
container_name
string
The name of the Azure Cosmos DB resource container.
Yes
index_name
string
The MongoDB vCore index name to use with Azure Cosmos DB.
Represents 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 with
vector 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:
Value
Description
endpoint
Represents vectorization performed by public service calls to an Azure OpenAI embedding model.
deployment_name
Represents 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 based
on an internal embeddings model deployment name in the same Azure OpenAI resource.
Represents the available sources Azure OpenAI On Your Data can use to configure vectorization of data for use with vector search.
Yes
deployment_name
string
Specifies 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 based
on a public Azure OpenAI endpoint call for embeddings.
The authentication options for Azure OpenAI On Your Data when using an API key.
No
endpoint
string
Specifies 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 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.
Name
Type
Description
Required
Default
citations
array
The data source retrieval result, used to generate the assistant message in the response.
No
intent
string
The 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.
The 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 case function.
Description: The type of the tool call, in this case function.
Type: string
Default:
Enum Name: ToolCallType
Enum Values:
Value
Description
function
The tool call type is function.
chatCompletionRequestMessageTool
Name
Type
Description
Required
Default
tool_call_id
string
Tool call that this message is responding to.
No
content
string
The contents of the message.
No
chatCompletionRequestMessageFunction
Name
Type
Description
Required
Default
role
enum
The role of the messages author, in this case function. Possible values: function
No
name
string
The contents of the message.
No
content
string
The contents of the message.
No
createChatCompletionResponse
Represents a chat completion response returned by model, based on the provided input.
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
choices
array
A list of chat completion choices. Can be more than one if n is greater than 1.
Yes
created
integer
The Unix timestamp (in seconds) of when the chat completion was created.
Yes
model
string
The model used for the chat completion.
Yes
system_fingerprint
string
This fingerprint represents the backend configuration that the model runs with.
Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.
No
object
enum
The object type, which is always chat.completion. Possible values: chat.completion
Represents a streamed chunk of a chat completion response returned by model, based on the provided input.
Name
Type
Description
Required
Default
id
string
A unique identifier for the chat completion. Each chunk has the same ID.
Yes
choices
array
A list of chat completion choices. Can contain more than one elements if n is greater than 1.
Yes
created
integer
The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
Yes
model
string
The model to generate the completion.
Yes
system_fingerprint
string
This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.
No
object
enum
The object type, which is always chat.completion.chunk. Possible values: chat.completion.chunk
Yes
chatCompletionStreamResponseDelta
A chat completion delta generated by streamed model responses.
Name
Type
Description
Required
Default
content
string
The contents of the chunk message.
No
function_call
object
Deprecated and replaced by tool_calls. The name and arguments of a function that should be called, as generated by the model.
No
tool_calls
array
No
role
enum
The role of the author of this message. Possible values: system, user, assistant, tool
No
refusal
string
The refusal message generated by the model.
No
Properties for function_call
arguments
Name
Type
Description
Default
arguments
string
The 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
Name
Type
Description
Default
name
string
The name of the function to call.
chatCompletionMessageToolCallChunk
Name
Type
Description
Required
Default
index
integer
Yes
id
string
The ID of the tool call.
No
type
enum
The type of the tool. Currently, only function is supported. Possible values: function
No
function
object
No
Properties for function
name
Name
Type
Description
Default
name
string
The name of the function to call.
arguments
Name
Type
Description
Default
arguments
string
The 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 set stream: true.
Name
Type
Description
Required
Default
include_usage
boolean
If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array. All other chunks will also include a usage field, but with a null value.
No
chatCompletionChoiceLogProbs
Log probability information for the choice.
Name
Type
Description
Required
Default
content
array
A list of message content tokens with log probability information.
Yes
refusal
array
A list of message refusal tokens with log probability information.
No
chatCompletionTokenLogprob
Name
Type
Description
Required
Default
token
string
The token.
Yes
logprob
number
The log probability of this token.
Yes
bytes
array
A 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 be null if there's no bytes representation for the token.
Yes
top_logprobs
array
List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested top_logprobs returned.
A 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.
Name
Type
Description
Required
Default
type
enum
The type of the tool. Currently, only function is supported. Possible values: function
Yes
function
object
Yes
Properties for function
name
Name
Type
Description
Default
name
string
The 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 by tool_calls. The name and arguments of a function that should be called, as generated by the model.
Name
Type
Description
Required
Default
name
string
The name of the function to call.
Yes
arguments
string
The 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.
Name
Type
Description
Required
Default
prompt_tokens
integer
Number of tokens in the prompt.
Yes
completion_tokens
integer
Number of tokens in the generated completion.
Yes
total_tokens
integer
Total number of tokens used in the request (prompt + completion).
Yes
completion_tokens_details
object
Breakdown of tokens used in a completion.
No
Properties for completion_tokens_details
reasoning_tokens
Name
Type
Description
Default
reasoning_tokens
integer
Tokens generated by the model for reasoning.
chatCompletionTool
Name
Type
Description
Required
Default
type
enum
The type of the tool. Currently, only function is supported. Possible values: function
The parameters the functions accepts, described as a JSON Schema object. See the guide for examples, and the JSON Schema reference for documentation about the format.
Omitting parameters defines a function with an empty parameter list.
No properties defined for this component.
FunctionObject
Name
Type
Description
Required
Default
description
string
A description of what the function does, used by the model to choose when and how to call the function.
No
name
string
The 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.
The parameters the functions accepts, described as a JSON Schema object. See the guide for examples, and the JSON Schema reference for documentation about the format.
Omitting parameters defines a function with an empty parameter list.
No
strict
boolean
Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is true.
No
False
ResponseFormatText
Name
Type
Description
Required
Default
type
enum
The type of response format being defined: text Possible values: text
Yes
ResponseFormatJsonObject
Name
Type
Description
Required
Default
type
enum
The 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
Name
Type
Description
Required
Default
type
enum
The type of response format being defined: json_schema Possible values: json_schema
Yes
json_schema
object
Yes
Properties for json_schema
description
Name
Type
Description
Default
description
string
A description of what the response format is for, used by the model to determine how to respond in the format.
name
Name
Type
Description
Default
name
string
The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
The schema for the response format, described as a JSON Schema object.
strict
Name
Type
Description
Default
strict
boolean
Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true.
False
chatCompletionChoiceCommon
Name
Type
Description
Required
Default
index
integer
No
finish_reason
string
No
createTranslationRequest
Translation request.
Name
Type
Description
Required
Default
file
string
The audio file to translate.
Yes
prompt
string
An optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.
The 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.
No
0
audioResponse
Translation or transcription response when response_format was json
Name
Type
Description
Required
Default
text
string
Translated or transcribed text.
Yes
audioVerboseResponse
Translation or transcription response when response_format was verbose_json
Name
Type
Description
Required
Default
text
string
Translated or transcribed text.
Yes
task
string
Type of audio task.
No
language
string
Language.
No
duration
number
Duration.
No
segments
array
No
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.
Name
Type
Description
Required
Default
file
string
The audio file object to transcribe.
Yes
prompt
string
An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
The 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.
No
0
language
string
The 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.
Name
Type
Description
Required
Default
id
integer
Segment identifier.
No
seek
number
Offset of the segment.
No
start
number
Segment start offset.
No
end
number
Segment end offset.
No
text
string
Segment text.
No
tokens
array
Tokens of the text.
No
temperature
number
Temperature.
No
avg_logprob
number
Average log probability.
No
compression_ratio
number
Compression ratio.
No
no_speech_prob
number
Probability of no 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:
Value
Description
standard
Standard quality creates images with standard quality.
hd
HD 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:
Value
Description
url
The URL that provides temporary access to download the generated images.
b64_json
The 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:
Value
Description
1792x1024
The desired size of the generated image is 1792x1024 pixels.
1024x1792
The desired size of the generated image is 1024x1792 pixels.
1024x1024
The 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:
Value
Description
vivid
Vivid creates images that are hyper-realistic and dramatic.
natural
Natural creates images that are more natural and less hyper-realistic.
imageGenerationsRequest
Name
Type
Description
Required
Default
prompt
string
A text description of the desired image(s). The maximum length is 4,000 characters.
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.
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
Is not currently part of the latest Azure OpenAI GA version of the Azure OpenAI data plane inference spec. Refer to the latest preview version for this capability.
Pievienojieties meetup sērijai, lai kopā ar citiem izstrādātājiem un ekspertiem izveidotu mērogojamus AI risinājumus, kuru pamatā ir reālas lietošanas gadījumi.
Learn how to use Azure OpenAI's latest preview REST API. In this article, you learn about authorization options, how to structure a request and receive a response.