Skip to main content

Create Chat Completion

Creates a completion for the chat message.

Basic Parameters

ParameterDescription
Max TokensThe maximum number of tokens to generate in the completion.
MessagesThe messages to generate chat completions for, in the chat format.
ModelID of the model to use. Currently, only gpt-3.5-turbo and gpt-3.5-turbo-0301 are supported.

Advanced Parameters

ParameterDescription
StopUp to 4 sequences where the API will stop generating further tokens.
TemperatureWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

We generally recommend altering this or top_p but not both.
UserA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

Example Output

{
"choices": [
{
"finish_reason": "string",
"index": 0,
"message": {
"content": "The contents of the message",
"role": "The role of the author of this message."
}
}
],
"created": 0,
"id": "string",
"model": "string",
"object": "string",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0
}
}

Automation Library Example

Create Chat Completion with Openai and Send Results Via Email

Automation LibraryPreview this Automation on desktop