POST
/openai/deployments/{deployment}/chat/completions
const url = 'http://localhost:8000/openai/deployments/example/chat/completions';const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/openai/deployments/example/chat/completions \ --header 'Content-Type: application/json' \ --data '{}'Azure OpenAI’s URL shape, for clients written against it (AzureOpenAI): the same handler and checks as
/v1/chat/completions, with the deployment as the task (a model alias, ratchet or a task name; the body’s model
is not read) and the key in api-key. The api-version query parameter is accepted and ignored.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”deployment
required
Deployment
string
Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
Example generated
{}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Example generated
exampleValidation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}