Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OpenAI Chat Model

ai.lm_chat_openai · version 1 · AI sub-node

Chat completions from OpenAI models (Chat Completions or Responses API).

Ports

PortKindLabelRequiredMax connections
output 0ai_languageModel

Credentials

SlotAccepted kindsRequired
openAiApiopenai/api_keyyes

Parameters

NameTypeDefaultRequiredShown whenDescription
modelstring"gpt-4o-mini"Identifier of the model to call, as listed by the provider. Values from lookup openai.models.
optionscollection{}Optional settings.
options.temperaturenumberSampling Temperature. Higher values make answers more varied; lower values more deterministic.
options.maxTokensnumberMaximum Tokens. Upper bound on the number of tokens the model may generate.
options.topPnumberTop P. Nucleus sampling: only consider tokens within this cumulative probability.
options.frequencyPenaltynumberFrequency Penalty. Discourage repeating the same tokens.
options.presencePenaltynumberPresence Penalty. Encourage the model to introduce new topics.
options.responseFormatoptions"text"Response Format. Ask the model for free text or for a JSON object. One of text, json_object.
options.reasoningEffortstringReasoning Effort. For reasoning models: how much effort to spend thinking (low, medium, high).
options.responsesApiEnabledbooleanfalseUse Responses API. Call the Responses endpoint instead of Chat Completions.
options.baseURLstringBase URL. Send requests to this API root instead of the provider default.
options.timeoutnumber600000Timeout (ms). Give up on a single request after this many milliseconds.
options.maxRetriesnumber2Max Retries. How many times to retry after rate limiting or a server error.

Import

Exported workflows that use these node types import to this node. Unverified ranges import with a parameter warning until parity fixtures confirm them; see Migrating.

Source typeVersion rangeStatusFixtures
@n8n/n8n-nodes-langchain.lmChatOpenAi1unverified