Create a chat completion
Generates a response from a model given a prompt or a series of messages.
Authentication
Authorizationstring
API Key authentication via header
Request
Request body for creating a chat completion.
model
The ID of the model to use for this request.
messages
A list of messages comprising the conversation so far.
prompt
A simple string prompt. The API will automatically convert this into a user message.
max_tokens
The maximum number of tokens to generate in the completion.
temperature
Controls randomness. Lower values produce more deterministic results.
tools
A list of tools the model may call.
tool_choice
Controls which (if any) function is called by the model.
Response
Successful response containing the model's choices.
request_id
choices
request
A copy of the original request, excluding prompt and messages.
usage