Skip to content
Docs

LLM Chat

LLM Chat sends one chat completion request to a large language model provider and emits the reply together with token usage. It supports OpenAI, Anthropic, Gemini, Ollama, Mistral, Groq, and xAI. You find it on the node picker’s AI shelf.

The request pays with the credential you pick on the node: a secret holding an API key or a saved connection. Leave the field empty to use the workspace key for the provider, managed on the AI models page, with the server’s own key as the final fallback.

LLM Chat has two handles: input, which accepts the upstream node’s output as the conversation payload, and output, which emits the generated text and token counts as JSON.

The LLM Chat node's settings form, with the fields described below
The LLM Chat node's settings form, with the fields described below
FieldTypeDefaultDescription
Provider (provider)one of openai, anthropic, gemini, ollama, mistral, groq, xai, voyageai, openrouter, typesafe, eleven, openai-compatible, soniox ✦ (required) — The AI provider that generates the reply, e.g. OpenAI or Anthropic.
Model (model)string ✦ (required) — The model to use, e.g. gpt-4o or claude-sonnet-5-5. It must be a model the selected provider offers.
System message (systemMessage)string ✦ (optional) — A system prompt that sets the model’s role and tone for this single chat completion.
Credential (credential)string ✦ (optional) — The key this node pays with — a secret holding an API key, or a saved Connection. Leave it empty to use the workspace key for this provider, set on the AI models page.
URL (url)string ✦ (optional) — Override the provider’s API base URL — only needed for self-hosted models or a proxy endpoint.
Max tokens (maxTokens)integer ✦ (optional) — The maximum number of tokens to generate in the reply. Leave empty for the provider’s default.
Temperature (temperature)number ✦ (optional) — Sampling temperature (0–2). Lower is more focused and deterministic, higher is more creative. Leave empty for the provider’s default.

Fields marked ✦ accept expressions.

Try this node — run it once against your own workspace, with your credentials, without building a flow first.

temperature and maxTokens are only forwarded when the selected model accepts them. A model whose API refuses a sampling parameter (Anthropic’s Claude 5 generation refuses temperature) gets the request without it instead of a failed call.

The node reads its messages from the upstream node’s output. Three shapes work:

  • An object with a messages array, each item carrying a role (user or assistant) and content. Use this for a multi-turn conversation you assemble yourself.
  • An object with a userPrompt string, sent as the single user message.
  • Anything else is JSON-encoded and sent as the single user message, so you can pipe upstream output straight into the model.
{
"content": "Hello! How can I help you today?",
"model": "gpt-4o-mini",
"inputTokens": 12,
"outputTokens": 9
}

content is the generated text and model the model you configured. While the model generates, tokens stream live into the flow’s run view.

The template “LLM / Chat — Translation” wires Start, an Injector, and an LLM Chat node into a translator (browse it under Templates). The Injector seeds the prompt:

{ "userPrompt": "Goedemorgen, kun je mij vertellen hoe ik mijn wachtwoord kan resetten?" }

The chat node runs claude-sonnet-5-5 on Anthropic with a system message telling the model to reply with the English translation only. Its credential field is empty, so it pays with the workspace’s Anthropic key. To pay with a key of your own, pick the secret that holds it in the credential field. Writing {{ $secrets->… }} there does not work: the field takes the secret, not its value.

The output’s content holds the translated sentence.

  • One completion per run: the node cannot call tools or loop. Give the model tools with an Agent.
  • The node remembers nothing between runs. A multi-turn conversation has to arrive whole in the messages array. For history that persists, use an Agent with a Chat Thread.