Flowise with a Custom OpenAI-Compatible Endpoint

In short: Only the ChatOpenAI Custom node has a Base Path field; the plain one talks to OpenAI's own host, where a gateway key is genuinely invalid. The credential has to be created as OpenAI API type regardless of the endpoint, and the model name is free text with no discovery behind it. Base Path is stored per node, so a flow with several model nodes holds several copies of the same URL.

Flowise is a drag-and-drop canvas for LLM apps: you place a chat model node, wire it to prompts, tools and memory, and the flow runs in the browser. Pointing it at a gateway is one node and three fields, but the node you drag onto the canvas decides whether a Base Path field exists at all — and the obvious one does not have it.

Use the ChatOpenAI Custom node, not ChatOpenAI. The two look alike in the sidebar, and the plain one talks to api.openai.com with no way to redirect it. There is no Base Path field to fill in, so the usual symptom is not an error about the endpoint but a perfectly valid-looking invalid API key — because your gateway key really is invalid, at OpenAI.

You need a key before the code below runs. Create an account, generate a key, and copy the base URL (https://aicomp.ai/v1). Create one free →
Check current rates → Free to sign up · $1 minimum top-up · No prepayment

This page covers which node to pick, what each of its three fields actually does, and why a canvas with several model nodes means editing the same URL several times.

Pick the node first

Chat Models  →  ChatOpenAI Custom
FieldValue
Base Pathhttps://gw.example.com/v1
Model Namegpt-5.6-terra
Credentiala credential of type OpenAI API
# self-hosted only — .env next to your Flowise install
OPENAI_API_KEY=sk-your-gateway-key

The Base Path is a root, not a full URL. Flowise appends /chat/completions for you, so the value carries the version path your gateway serves under and nothing after it. Two ways to get it wrong are common and they fail differently:

Neither is caught at save time. Flowise does not probe the endpoint when you save a flow, so a flow with a broken Base Path saves cleanly and only complains on the first run.

Three fields, three failure modes

Credential type must be OpenAI API. Flowise asks you to create a credential and gives you a type picker. Your gateway is not OpenAI, and picking "Custom" feels more honest — but the credential type controls how the key is put on the request. Anything other than OpenAI API omits or mangles the Authorization header, and the gateway returns 401. The error says the key is wrong, which sends you to rotate a key that was never the problem.

Model Name is free text. Unlike the provider-specific nodes, ChatOpenAI Custom has no dropdown — there is nothing for Flowise to fetch a list from. Whatever you type goes into the model field verbatim. A one-character difference is a model not found from your gateway while the model sits plainly on your dashboard. Copy the id from what your gateway returns on /v1/models rather than from a blog post or from memory.

Base Path is per node, and there is no global default worth trusting. Each ChatOpenAI Custom node carries its own copy. A canvas with a chat model, an embedding model and an agent's model has three separate Base Path fields holding the same URL, and changing gateways means editing all three. Forget one and the flow half-works: the parts wired to the updated node respond, the rest fail, and nothing in the UI groups the failures by node.

Tool calling is a separate requirement

An Agent node needs a model that returns tool calls. Gateways list which models support it, and a model that does not will make the agent fail with an error about tools or parsing rather than about the model. If you are wiring an Agent node rather than a plain chat model, confirm function calling on the model before debugging the flow — the same Base Path and key work fine for a simple Chatflow and fail only once tools enter the picture.

Where the tokens go

A Flowise flow is not one request per user message. A RAG chatflow embeds the query, retrieves chunks, and sends the query plus every retrieved chunk plus the chat history on the turn. An agent flow goes further: each tool call re-sends the whole conversation with the tool result appended, so one user message can be several full-context requests.

That means the input side scales with what you retrieve, not with what the user types. Raising the number of retrieved chunks from 4 to 8 roughly doubles a payload that was already larger than the question — and it happens on every turn, including the ones where the answer is one sentence.

A day of work on this page's workload is 220k input and 55k output tokens — 4.4M input and 1.1M output across 20 working days. Retrieval depth is the lever on that number, and it is usually the cheapest thing to turn down. See output vs input pricing for the other half of the arithmetic, and prompt caching savings for why a stable system prompt plus a stable retrieval order is worth real money at this shape.

Per 1M input / output tokens and a 20-day month
ModelGateway rate
in / out per 1M tokens
One day20 days
gpt-5.6-terra$1.00 / $6.00$0.55$11.00
claude-sonnet-5$1.00 / $5.00$0.49$9.90
deepseek-v4-pro$0.66 / $1.98$0.25$5.08
qwen3.8-max$1.00 / $3.00$0.39$7.70
glm-5.3$0.70 / $2.2$0.28$5.50

One day = 220k input + 55k output on this page's workload. 20 days = 4.4M input and 1.1M output. Rates checked 2026-10-12 — gateway rates move with upstream promotions, so verify the current number in your dashboard before committing to a budget.

Across 219 catalogue models that publish both rates, the median output rate is 4.0× the input rate, and 68% of them (150 models) charge at least 4× more for output than input. The other 624 raw catalogue entries are dropped by cleaning — test entries, dated snapshots and non-chat variants — not for a missing rate. This is why an agent workload is decided on the output column, not the input one everyone quotes.

Verifying the route

  1. Drag ChatOpenAI Custom, not ChatOpenAI. Check that a Base Path field is on the node before you start.
  2. Fill Base Path with the version root — no trailing slash, no /chat/completions.
  3. Create the credential as OpenAI API type even though the endpoint is not OpenAI.
  4. Paste the model id from /v1/models rather than typing it from memory.
  5. Update every model node on the canvas. There is no shared Base Path.
  6. Expect no confirmation on save. First real run is the test.

FAQ

FAQ

Why does my flow say invalid API key when the key works elsewhere?

You are on the plain ChatOpenAI node, which sends requests to api.openai.com. The key is fine at your gateway and invalid at OpenAI. Switch to ChatOpenAI Custom.

Why do I get 401 with the right key?

The credential type is not OpenAI API. The type determines how the key reaches the request; anything else leaves the Authorization header wrong. Recreate the credential as OpenAI API.

Does Base Path need /v1?

Yes, if your gateway serves its OpenAI-compatible API under /v1 — the same as any OpenAI SDK client. Flowise adds /chat/completions itself, so anything you add after the version path breaks the URL.

Why does my gateway say model not found when the model is listed?

The Model Name field is free text and is sent verbatim. Fetch /v1/models and copy the id exactly.

I changed the gateway and half my flow broke. Why?

Base Path is stored per node. The nodes you edited work; the ones you did not still point at the old gateway.

Does an agent flow cost more than a chatflow on the same model?

Yes, and the gap is on the input side. Each tool call re-sends the full conversation with the new result appended, so one user message becomes several full-context requests.

Related

Get API access