CLI Proxy Web Chat Model icon

CLI Proxy Web Chat Model

Use CLI Proxy Web as a native n8n AI chat model

CLI Proxy Web Chat Model

AI-generated

Summary

Supplies a LangChain ChatOpenAI-based chat model to n8n AI Agent/Chain nodes, pointed at a CLI Proxy Web gateway (OpenAI-compatible /v1 API), with optional Responses API use, chat-completions fallback, and empty-response retries.

Inputs

  • model (required) — Proxy model, chosen from a searchable list (fetched from GET /v1/models) or entered by ID. Default gpt-5-mini.
  • useResponsesApi — Prefer /v1/responses over /v1/chat/completions (default true). Only applied if the model name starts with gpt-, chatgpt-, o, or contains codex; otherwise chat completions is used. If the Responses call fails or returns empty, the first attempt falls back to chat completions.
  • options.baseUrl — Overrides the credential's base URL. Trailing slashes and /v1 are normalized, and /v1 is appended. An error is thrown if no base URL is available.
  • options.emptyResponseRetries — Retries when the model returns blank text with no tool calls (default 2). Throws an error after the final attempt.
  • options.extraBody — JSON object merged into the request body, overriding generated fields such as reasoning or response format.
  • options.metadata — JSON object sent as request metadata. Must be valid JSON object.
  • options.reasoningEffort — low, medium, high, or xhigh. Sent as reasoning.effort for Responses, or reasoning_effort for chat completions.
  • options.responseFormat — Default or JSON Object. For advanced schemas, use Extra Body.
  • options.temperature / topP / maxTokens / presencePenalty / frequencyPenalty — Standard sampling and length parameters, passed to the model when set.
  • options.timeout / maxRetries — Request timeout in ms (default 60000) and the client's retry count (default 2).

Output shape

A single AiLanguageModel connection output (a configured ChatOpenAI model instance), not item data. It attaches to a Chat Model input on an AI Agent or chain node.

Requires the cliProxyWebApi credential (base URL and API token). Each LLM call is traced in n8n with its input messages and output generations. Errors are surfaced as node errors.

Examples

Example 1: Power an AI Agent with a gateway-hosted GPT model using JSON output

Model: gpt-5-mini; Use Responses API on; Options: Response Format = JSON Object, Temperature 0.2

Example 2: Use a non-OpenAI model through the proxy

Model ID: a non-OpenAI model name; Responses API is skipped automatically, so chat completions is used; set Max Tokens 2048

Example 3: Point at a different deployment and add custom request fields

Options: Base URL Override = https://proxy.example.com; Extra Body = {"user":"n8n"}; Timeout 120000

Links

Discussion