POST
/
v1
/
chat
/
completions

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required

The id of the model to use for the generation

messages
object[]
required

The list of messages to generate a response for. The last message is the prompt.

max_tokens
integer

The maximum number of tokens to generate

temperature
number

The temperature of the sampling distribution

top_p
number

The cumulative probability of the top tokens to keep in the nucleus of the distribution

tools
object[]

The list of tools to use for the generation

tool_choice

Defaults to auto for automatic tool choice

internet
boolean

Whether to use the internet for the generation > Model limitations apply, defaults to true for bing models.

citations
boolean

Whether to include citations in the generation > For use in owned_by: bing/openai models only, defaults to true.

tone
string

The tone of the generation > For use in owned_by: bing/openai models only, defaults to precise.

raw
boolean

Whether to return the raw response > For use in owned_by: bing/openai models only! Returns Bing AI Suggestions and Search Results, defaults to false.

image

The url of the image to use for the generation > Model limitations apply

Response

200 - application/json
id
string
object
string
created
integer
model
string
choices
object[]
usage
object
system_fingerprint
string