Create a chat completion
Generates a chat completion based on the provided input. The completion can be streamed to the client as it is generated.
Query parameters
Specific provider to use (default determined by model)
Request body
Response
Successful response
Changes
Changed in 14 of the 55 revisions of this API.112239
- ○
added the optional property
oneOf[CreateChatCompletionStreamResponse]/usage/completion_tokens_detailsto the response with the200status (media type: text/event-stream)response-optional-property-added
- ○
added the optional property
oneOf[CreateChatCompletionStreamResponse]/usage/prompt_tokens_detailsto the response with the200status (media type: text/event-stream)response-optional-property-added
- ○
added the optional property
usage/completion_tokens_detailsto the response with the200status (media type: application/json)response-optional-property-added
- ○
added the optional property
usage/prompt_tokens_detailsto the response with the200status (media type: application/json)response-optional-property-added
- ○
- ○
added the new enum value
llamacppto thequeryrequest parameterproviderrequest-parameter-enum-value-added
- ○
- ○
added the new enum value
zaito thequeryrequest parameterproviderrequest-parameter-enum-value-added
- ○
- ○
added the new enum value
nvidiato thequeryrequest parameterproviderrequest-parameter-enum-value-added
- ○
- ○
added the new optional request property
frequency_penaltynew-optional-request-property
- ○
added the new optional request property
logit_biasnew-optional-request-property
- ○
added the new optional request property
logprobsnew-optional-request-property
- ○
added the new optional request property
max_completion_tokensnew-optional-request-property
- ○
added the new optional request property
nnew-optional-request-property
- ○
added the new optional request property
parallel_tool_callsnew-optional-request-property
- ○
added the new optional request property
presence_penaltynew-optional-request-property
- ○
added the new optional request property
reasoning_effortnew-optional-request-property
- ○
added the new optional request property
response_formatnew-optional-request-property
- ○
added the new optional request property
seednew-optional-request-property
- ○
added the new optional request property
stopnew-optional-request-property
- ○
added the new optional request property
temperaturenew-optional-request-property
- ○
added the new optional request property
tool_choicenew-optional-request-property
- ○
added the new optional request property
top_logprobsnew-optional-request-property
- ○
added the new optional request property
top_pnew-optional-request-property
- ○
added the new optional request property
usernew-optional-request-property
- ○
request property
max_tokensdeprecatedrequest-property-deprecated
- ○
- ○
added the new enum value
minimaxto thequeryrequest parameterproviderrequest-parameter-enum-value-added
- ○
- ▲
added
SSEventCreateChatCompletionStreamResponseto the response bodyoneOflist for the response status200(media type: text/event-stream)response-body-one-of-added
- ▲
the response's body type/format changed from
object/to/for status200(media type: text/event-stream)response-body-type-changed
- ●
removed the optional property
datafrom the response with the200status (media type: text/event-stream)response-optional-property-removed
- ●
removed the optional property
eventfrom the response with the200status (media type: text/event-stream)response-optional-property-removed
- ●
removed the optional property
retryfrom the response with the200status (media type: text/event-stream)response-optional-property-removed
- ○
added the optional property
choices/items/logprobsto the response with the200status (media type: application/json)response-optional-property-added
- ▲
- ○
added the new optional request property
messages/items/tool_calls/items/extra_contentnew-optional-request-property
- ○
added the optional property
choices/items/message/tool_calls/items/extra_contentto the response with the200statusresponse-optional-property-added
- ○
- ○
added the new enum value
moonshotto thequeryrequest parameterproviderrequest-parameter-enum-value-added
- ○
- ○
added the new enum value
ollama_cloudto thequeryrequest parameterproviderrequest-parameter-enum-value-added
- ○