Skip to main content
Creates a model response for the given chat conversation.
External DocumentationTo learn more, visit the OpenAI documentation.

Basic Parameters

ParameterDescription
MessagesThe messages to generate chat completions for.

Example:
[
{
“role”: “developer”,
“content”: “You are a helpful assistant.”
},
{
“role”: “user”,
“content”: “Hello!”
}
]
Note: For more information about the messages parameter, and the various roles that can be associated with a message, visit OpenAI API docs.
ModelThe model to use. You can use the List models action to get all of your available models, or visit OpenAI’s Model Overview for descriptions of them.

Advanced Parameters

ParameterDescription
Max Completion TokensThe maximum number of tokens that can be generated for a completion. A higher token limit will result in a longer response.
Reasoning EffortThe amount of reasoning effort to use when generating the response with reasoning models.

Some models support limited values of this parameter.

For more information about the Reasoning Effort parameter, visit OpenAI API docs.
StopSequences of text that will instruct the model to stop generating further tokens once any of these sequences are encountered.

The response will not include the stop sequence(s) themselves.

Valid values are:
* String: A single stop sequence (e.g., “END”).
* List: A comma separated list of up to 4 stop sequences (e.g., “END,STOP”).

Note: The quotes are used only for the example. Avoid using quotes in the stop parameter.
TemperatureWhat sampling temperature to use, between 0.0 and 2.0.

Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
UserA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. For more information, please visit OpenAI’s documentation.

Example Output

{
	"id": "<string>",
	"object": "<string>",
	"created": 1901345026,
	"model": "<string>",
	"choices": [
		{
			"index": 1,
			"message": {
				"role": "<string>",
				"content": "<string>",
				"refusal": null,
				"annotations": []
			},
			"logprobs": null,
			"finish_reason": "<string>"
		}
	],
	"usage": {
		"prompt_tokens": 29,
		"completion_tokens": 20,
		"total_tokens": 10,
		"prompt_tokens_details": {
			"cached_tokens": 2,
			"audio_tokens": 2
		},
		"completion_tokens_details": {
			"reasoning_tokens": 2,
			"audio_tokens": 2,
			"accepted_prediction_tokens": 2,
			"rejected_prediction_tokens": 1
		}
	},
	"service_tier": "<string>",
	"service_tier": "<string>",
	"system_fingerprint": null
}

Workflow Library Example

Create Chat Completion with Openai and Send Results Via Email
Workflow LibraryPreview this Workflow on desktop