AI Gateway

POST /ai/v1/chat/completions

Changed on

Request

  • Base URL
    /api (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    HTTP bearer

Request body

frequency_penaltynumber double nullable
max_tokensinteger nullable
modelstring required
ninteger nullable
presence_penaltynumber double nullable
response_formatunknown
seedinteger nullable
streamboolean
temperaturenumber double nullable
tool_choiceunknown
top_pnumber double nullable
userstring nullable

Response

Chat completion response

createdinteger required
idstring required
modelstring required
objectstring required

Changes

    • info

      added the new optional request property allOf[subschema #2]/messages/items/content/oneOf[#/components/schemas/MessageContent]/oneOf[subschema #2]/items/cache_control

    • info

      added the optional property choices/items/message/content/oneOf[#/components/schemas/MessageContent]/oneOf[subschema #2]/items/cache_control to the response with the status

    • info

      added the optional property usage/oneOf[#/components/schemas/UsageInfo]/prompt_tokens_details to the response with the status