Skip to main content
Generate a chat completion response from a model using a conversation history. Note: To chat with a specific agent instead of a bare model, connect using an agent-specific API key. The agent’s configuration, including its system prompt, knowledge, and tools, is automatically applied. For more information, visit Helix documentation.
External DocumentationTo learn more, visit the Helix documentation.

Basic Parameters

ParameterDescription
MessagesThe list of messages in the conversation.

Each message is an object with a role (system, user, or assistant) and a content string.

Example:
[
{“role”: “system”, “content”: “You are a helpful assistant.”},
{“role”: “user”, “content”: “What is the capital of France?”}
]
ModelThe model used to generate the chat completion, for example qwen3:8b.

Advanced Parameters

ParameterDescription
Max TokensThe maximum number of tokens to generate in the chat completion.
TemperatureThe sampling temperature to use. Values can range from 0 to 2.
Top PThe nucleus sampling parameter, where the model considers the tokens with top_p probability mass.

Example Output

{
	"id": "ses_01a4t10c132825d3k037tyh7ap",
	"object": "chat.completion",
	"created": 1723155364,
	"model": "qwen3:8b",
	"choices": [
		{
			"index": 0,
			"finish_reason": "stop",
			"message": {
				"role": "assistant",
				"content": "The capital of France is Paris."
			}
		}
	],
	"usage": {
		"prompt_tokens": 24,
		"completion_tokens": 8,
		"total_tokens": 32
	}
}

Workflow Library Example

Generate Chat Completion with Helix and Send Results Via Email
Workflow LibraryPreview this Workflow on desktop