Microsoft Azure Chat Completions API
Operations for chat-based completions
Operations 1
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Operations for chat-based completions
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/microsoft-azure:microsoft-azure-chat-completions-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Microsoft Azure Azure OpenAI Service Chat Completions API
description: Azure OpenAI Service provides REST API access to OpenAI's language models including GPT-4, GPT-4 Turbo, GPT-3.5-Turbo, and the Embeddings model series. These models can be adapted to tasks including content generation, summarization, semantic search, and natural language to code translation. Users access the service through REST APIs, Python SDK, or the web-based interface in the Azure AI Foundry portal.
version: '2024-06-01'
contact:
name: Microsoft Azure Support
url: https://azure.microsoft.com/en-us/support/
email: azuresupport@microsoft.com
license:
name: Microsoft API License
url: https://learn.microsoft.com/en-us/legal/
x-logo:
url: https://azure.microsoft.com/svghandler/azure-logo.png
servers:
- url: https://{endpoint}/openai
description: Azure OpenAI Service endpoint
variables:
endpoint:
default: your-resource-name.openai.azure.com
description: 'The Azure OpenAI resource endpoint. Format: https://{resource-name}.openai.azure.com'
security:
- apiKey: []
- oauth2:
- https://cognitiveservices.azure.com/.default
tags:
- name: Chat Completions
description: Operations for chat-based completions
paths:
/deployments/{deployment-id}/chat/completions:
post:
operationId: ChatCompletions_Create
summary: Microsoft Azure Create a Chat Completion
description: Creates a completion for the chat message. Supports GPT-4, GPT-4 Turbo, and GPT-3.5-Turbo models.
tags:
- Chat Completions
parameters:
- $ref: '#/components/parameters/DeploymentIdParameter'
- $ref: '#/components/parameters/ApiVersionParameter'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateChatCompletionRequest'
examples:
ChatcompletionsCreateRequestExample:
summary: Default ChatCompletions_Create request
x-microcks-default: true
value:
messages:
- role: system
content: example_value
name: Example Title
tool_calls: {}
tool_call_id: '500123'
temperature: 42.5
top_p: 42.5
n: 10
stream: true
stop: example_value
max_tokens: 10
presence_penalty: 42.5
frequency_penalty: 42.5
response_format:
type: text
seed: 10
tools:
- type: function
tool_choice: example_value
user: example_value
responses:
'200':
description: Successfully created a chat completion.
content:
application/json:
schema:
$ref: '#/components/schemas/CreateChatCompletionResponse'
examples:
ChatcompletionsCreate200Example:
summary: Default ChatCompletions_Create 200 response
x-microcks-default: true
value:
id: abc123
object: chat.completion
created: 10
model: example_value
choices:
- index: 10
finish_reason: stop
usage:
prompt_tokens: 10
completion_tokens: 10
total_tokens: 10
system_fingerprint: example_value
default:
description: An error occurred.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
ChatcompletionsCreatedefaultExample:
summary: Default ChatCompletions_Create default response
x-microcks-default: true
value:
error:
code: example_value
message: example_value
param: example_value
type: example_value
inner_error:
code: example_value
content_filter_result: example_value
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
components:
schemas:
FunctionDefinition:
type: object
description: The function definition.
properties:
name:
type: string
description: The name of the function to be called.
example: Example Title
description:
type: string
description: A description of what the function does.
example: A sample description.
parameters:
type: object
description: The parameters the functions accepts, described as a JSON Schema object.
example: example_value
required:
- name
CreateChatCompletionRequest:
type: object
description: Request body for creating a chat completion.
properties:
messages:
type: array
description: A list of messages comprising the conversation so far.
items:
$ref: '#/components/schemas/ChatCompletionMessage'
minItems: 1
example: []
temperature:
type: number
minimum: 0
maximum: 2
default: 1
description: Sampling temperature between 0 and 2. Higher values make the output more random, while lower values make it more focused and deterministic.
example: 42.5
top_p:
type: number
minimum: 0
maximum: 1
default: 1
description: An alternative to sampling with temperature called nucleus sampling.
example: 42.5
n:
type: integer
minimum: 1
maximum: 128
default: 1
description: How many chat completion choices to generate for each input message.
example: 10
stream:
type: boolean
default: false
description: If set, partial message deltas will be sent as server-sent events.
example: true
stop:
description: Up to 4 sequences where the API will stop generating further tokens.
oneOf:
- type: string
- type: array
items:
type: string
minItems: 1
maxItems: 4
example: example_value
max_tokens:
type: integer
description: The maximum number of tokens that can be generated in the chat completion.
example: 10
presence_penalty:
type: number
default: 0
minimum: -2
maximum: 2
description: Positive values penalize new tokens based on whether they appear in the text so far.
example: 42.5
frequency_penalty:
type: number
default: 0
minimum: -2
maximum: 2
description: Positive values penalize new tokens based on their existing frequency in the text so far.
example: 42.5
response_format:
type: object
description: An object specifying the format that the model must output.
properties:
type:
type: string
enum:
- text
- json_object
description: The type of response format being defined.
example: example_value
seed:
type: integer
description: If specified, the system will make a best effort to sample deterministically.
example: 10
tools:
type: array
description: A list of tools the model may call.
items:
$ref: '#/components/schemas/ChatCompletionTool'
example: []
tool_choice:
description: Controls which (if any) tool is called by the model.
oneOf:
- type: string
enum:
- none
- auto
- required
- type: object
properties:
type:
type: string
enum:
- function
function:
type: object
properties:
name:
type: string
required:
- name
required:
- type
- function
example: example_value
user:
type: string
description: A unique identifier representing your end-user.
example: example_value
required:
- messages
CreateChatCompletionResponse:
type: object
description: Represents a chat completion response returned by model.
properties:
id:
type: string
description: A unique identifier for the chat completion.
example: abc123
object:
type: string
enum:
- chat.completion
description: The object type.
example: chat.completion
created:
type: integer
description: The Unix timestamp of when the chat completion was created.
example: 10
model:
type: string
description: The model used for the chat completion.
example: example_value
choices:
type: array
description: A list of chat completion choices.
items:
$ref: '#/components/schemas/ChatCompletionChoice'
example: []
usage:
$ref: '#/components/schemas/Usage'
system_fingerprint:
type: string
description: The system fingerprint representing the backend configuration.
example: example_value
required:
- id
- object
- created
- model
- choices
ErrorResponse:
type: object
description: Error response.
properties:
error:
type: object
description: The error object.
properties:
code:
type: string
description: The error code.
message:
type: string
description: The error message.
param:
type: string
description: The parameter that caused the error.
type:
type: string
description: The error type.
inner_error:
type: object
description: Inner error details.
properties:
code:
type: string
description: The inner error code.
content_filter_result:
type: object
description: Content filter results, if applicable.
required:
- code
- message
example: example_value
ChatCompletionToolCall:
type: object
description: A tool call generated by the model.
properties:
id:
type: string
description: The ID of the tool call.
example: abc123
type:
type: string
enum:
- function
description: The type of the tool call.
example: function
function:
type: object
description: The function that the model called.
properties:
name:
type: string
description: The name of the function to call.
arguments:
type: string
description: The arguments to call the function with, as generated by the model in JSON format.
required:
- name
- arguments
example: example_value
required:
- id
- type
- function
Usage:
type: object
description: Usage statistics for the API call.
properties:
prompt_tokens:
type: integer
description: Number of tokens in the prompt.
example: 10
completion_tokens:
type: integer
description: Number of tokens in the generated completion.
example: 10
total_tokens:
type: integer
description: Total number of tokens used in the request.
example: 10
required:
- prompt_tokens
- total_tokens
ChatCompletionMessage:
type: object
description: A message in the chat conversation.
properties:
role:
type: string
enum:
- system
- user
- assistant
- tool
description: The role of the messages author.
example: system
content:
description: The contents of the message.
oneOf:
- type: string
- type: 'null'
example: example_value
name:
type: string
description: An optional name for the participant.
example: Example Title
tool_calls:
type: array
description: The tool calls generated by the model.
items:
$ref: '#/components/schemas/ChatCompletionToolCall'
example: []
tool_call_id:
type: string
description: Tool call that this message is responding to.
example: '500123'
required:
- role
ChatCompletionChoice:
type: object
description: A chat completion choice.
properties:
index:
type: integer
description: The index of the choice in the list.
example: 10
message:
$ref: '#/components/schemas/ChatCompletionMessage'
finish_reason:
type: string
enum:
- stop
- length
- content_filter
- tool_calls
description: The reason the model stopped generating tokens.
example: stop
required:
- index
- message
- finish_reason
ChatCompletionTool:
type: object
description: A tool the model may call.
properties:
type:
type: string
enum:
- function
description: The type of the tool.
example: function
function:
$ref: '#/components/schemas/FunctionDefinition'
required:
- type
- function
parameters:
ApiVersionParameter:
name: api-version
in: query
required: true
description: The API version to use for this operation.
schema:
type: string
default: '2024-06-01'
DeploymentIdParameter:
name: deployment-id
in: path
required: true
description: The deployment ID of the model to use for this request.
schema:
type: string
securitySchemes:
apiKey:
type: apiKey
name: api-key
in: header
description: Azure OpenAI API key authentication.
oauth2:
type: oauth2
flows:
implicit:
authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
scopes:
https://cognitiveservices.azure.com/.default: Access Azure OpenAI