2027 setup guide · Workflow automation

n8n with an OpenAI-compatible API

n8n has two OpenAI paths. The built-in node is OpenAI-only; the Custom Endpoint Chat Model node is the one that accepts a base URL and a compatible provider.

Abstract illustration of workflow nodes connected to a model endpoint
Illustration: an automation workflow calling a chat model. Plugsky Editorial Team.

n8n is a workflow automation tool with a large library of integrations and an AI agent layer. Teams use it for document routing, support triage, lead enrichment and scheduled report generation. The AI step is usually one node inside a longer workflow, which means a model failure should be visible as a failed execution, not as a plausible but empty field.

There are two ways to call a model. The built-in OpenAI node and OpenAI Chat Model node use OpenAI credentials: an API key and an optional organisation ID. The Custom Endpoint Chat Model node uses a Custom Model Endpoint credential with a base URL and a choice of authentication. That second path is the one for Plugsky and other compatible providers.

n8n model paths, checked 23 November 2026
PathBest forLimit to know
OpenAI nodeFiles, audio, images, assistants and batch operationsCredential is OpenAI-specific: API key plus optional organization ID.
OpenAI Chat Model nodeChat and agent sub-nodesSame OpenAI credential; no custom base URL in the credential form.
Custom Endpoint Chat ModelAny OpenAI-compatible chat endpointChat model sub-node; pair it with the AI Agent or a chain.
HTTP Request nodeUnusual endpoints or request shapesYou build the request, parse the response and handle retries yourself.

Choose the node before the credential

The built-in OpenAI node is the broadest integration: it handles text, images, audio, files, assistants and conversations. Its credential form asks for an API key and an organisation ID, and n8n Cloud can substitute gateway credits. There is no base URL field in that credential, so it is not the path for a third-party compatible endpoint.

The Custom Endpoint Chat Model node is a chat model sub-node. It connects to an AI Agent, a Basic LLM Chain or another node that expects a chat model. It uses the Custom Model Endpoint credential, which is where the base URL lives. If the workflow needs image generation or transcription, the custom endpoint node will not cover it; keep those steps on a provider-specific node or an HTTP request.

The HTTP Request node is the fallback for anything the model nodes do not expose. It is more work and more fragile, but it can call an endpoint that returns a shape n8n does not model.

The Custom Model Endpoint credential

The credential's Base URL field is described as the root of the OpenAI-compatible API; n8n adds paths such as /chat/completions to it. For Plugsky that root is https://api.plugsky.com/v1. Authentication can be a bearer token, an API key in a named header, basic auth, OAuth2 client credentials or none. Most compatible providers use the bearer token.

Do not paste the full chat completions URL into the base URL. The node appends the route, so a full path becomes a doubled path. If the endpoint requires a custom header, the credential supports a header name and value; that is preferable to embedding a header in every node.

The credential is reusable across nodes. Treat it as a shared secret: one credential for production, one for testing, and a name that says which is which. A production workflow that silently uses a test key is a common cause of 'the model changed' reports.

API format, model IDs and context headers

The node exposes an API Format choice: Chat Completions or Responses. Chat Completions is the default and the safer choice for a compatible gateway. Responses is for gateways that implement the Responses API; n8n's own notice warns that the OpenAI built-in tools are not available there and that a tool definition in Extra Body uses the flat Responses shape.

The model field defaults to By ID rather than From List. n8n's node description explains why: a gateway does not have to answer GET /models. That is a useful default for private endpoints, but it also means a typo is not caught until the workflow runs. Copy the model ID from the provider's catalogue.

The node can send n8n context headers: x-n8n-workflow-id, x-n8n-workflow-name and x-n8n-execution-id. A gateway can use those to attribute usage to a workflow and an execution. Turn them on when you need that attribution, and confirm the gateway records them.

What to check in a workflow

Run the workflow with a real item, not the editor's test pin. Check that the model output reaches the next node in the shape it expects, that an agent calls its tool, and that a failed model call fails the execution. A node that returns an empty string on error can look successful while writing bad data downstream.

Check execution data retention. n8n stores execution data for debugging, and prompts may contain customer information. Decide how long that data lives and who can read it before the workflow touches production records.

Check retries and timeouts. A model call that retries three times inside n8n and three times at the gateway can multiply a transient error into a burst. Set one retry policy and make the other layer passive.

If the workflow uses a sub-node, remember that sub-nodes resolve expressions against the first item. A prompt that references an item field will use the first item even when the node processes several. Test with multiple items before trusting the output.

When a competitor wins

The built-in OpenAI nodes win when the workflow needs OpenAI's file, audio, image or assistant operations and the team is comfortable with an OpenAI-only dependency. A direct HTTP Request workflow wins when the endpoint is unusual or the request needs a shape n8n does not model. A code-first orchestrator wins when the workflow needs tests, version control and a review process.

Plugsky wins when n8n is one consumer of a shared OpenAI-compatible endpoint and the team wants a flat monthly plan, per-key access and an audit trail across workflows. The private VPC and air-gapped options cover workflows that cannot call a public API. The limit is catalogue size: 39 public model IDs, so confirm the chat model and any embedding model your workflow needs are available.

Verdict

Use the Custom Endpoint Chat Model node with a Custom Model Endpoint credential, the /v1 base URL, bearer authentication and Chat Completions format. Keep file and audio steps on the nodes that support them, and test a failed model call before production.

Choose Plugsky when n8n workflows should share a flat-rate compatible endpoint with other tools and a private deployment path. Choose the built-in OpenAI nodes when you need their full operation set and a single-vendor dependency is acceptable.

Frequently asked questions

Can the n8n OpenAI node use a custom base URL?

The OpenAI credential documents an API key and an optional organization ID, not a base URL. For a compatible endpoint, use the Custom Endpoint Chat Model node with a Custom Model Endpoint credential.

What base URL should I use for Plugsky in n8n?

https://api.plugsky.com/v1. n8n appends routes such as /chat/completions, so do not paste the full endpoint.

Why does n8n ask for a model ID instead of loading a list?

The Custom Endpoint node defaults to By ID because a gateway is not required to implement GET /models. You can still type the ID from the provider's catalogue.

What are the x-n8n context headers?

The node can send x-n8n-workflow-id, x-n8n-workflow-name and x-n8n-execution-id so a gateway can attribute usage to a workflow and execution.

Can I use the Custom Endpoint node for image generation?

It is a chat model sub-node. Use a provider-specific node or an HTTP Request for image, audio or file operations.

Related

Sources

  1. n8n: OpenAI Chat Model node · 23 Nov 2026
  2. n8n: OpenAI credentials · 23 Nov 2026
  3. n8n: Custom Endpoint Chat Model source · 23 Nov 2026
  4. n8n: Custom Model Endpoint credential source · 23 Nov 2026
  5. Plugsky API quickstart · 23 Nov 2026