Connect Langflow to Router One through the OpenAI Compatible provider
Langflow is an open-source visual builder for LLM flows and agents: you wire Chat Input, Prompt Template, Language Model, Agent and tool components on a canvas, then run the flow from the editor or call it over Langflow's own API. Since Langflow 1.11 model access is configured once, globally, under Settings → Model Providers, and that list includes an OpenAI Compatible provider that takes a base URL and a key and discovers models from the endpoint's /v1/models route. Pointing it at Router One puts GPT, Claude, Gemini, Grok and DeepSeek family models in every Language Model and Agent field on one key, with a cost trace per request in Dashboard → Logs. This guide is written against Langflow 1.12.5 (October 6, 2026) and covers the provider values, the bundled OpenAI component as the alternative path, what an Agent run costs in requests, and why embeddings must stay on another provider.
Install Langflow 1.12 and create a dedicated key
The OSS Python package needs Python 3.10 to 3.14 and uv: install with uv pip install langflow, start with uv run langflow run, and open http://127.0.0.1:7860. Langflow Desktop (macOS 13 or later, or the Windows installer) and the langflowai/langflow Docker image are the other official options; the image listens on 7860 as well. The OpenAI Compatible provider ships inside the langflow package, so there is nothing extra to install; it first appeared in 1.11.0, and appending /v1 to a base URL that lacks it arrived in 1.12.0, so on 1.11.x type the /v1 yourself. Then create a Router One key for this Langflow instance in Dashboard → API Keys with a maxSpend cap. For a container or a headless server, the provider reads the same two values from environment variables, which keeps the key out of the UI. A key that comes from the server's environment is guarded since Langflow 1.12.3: per the 1.12.5 docs, it may go to a custom endpoint only if that host is listed in LANGFLOW_PROVIDER_CREDENTIAL_ALLOWED_HOSTS, and the bundled OpenAI component enforces this, so the container below lists api.router.one:
docker run -p 7860:7860 \ -e LANGFLOW_AUTO_LOGIN=false \ -e LANGFLOW_SUPERUSER_PASSWORD=<strong-password> \ -e OPENAI_COMPATIBLE_BASE_URL=https://api.router.one/v1 \ -e OPENAI_COMPATIBLE_API_KEY=sk-your-router-one-key \ -e LANGFLOW_PROVIDER_CREDENTIAL_ALLOWED_HOSTS=api.router.one \ langflowai/langflow:latest
Configure Langflow to use the Router One base URL
Click your profile icon → Settings → Model Providers and select OpenAI Compatible. Base URL takes https://api.router.one/v1: the provider builds a LangChain ChatOpenAI client with that value as base_url, and the client posts to base URL plus /chat/completions, so /v1 belongs in the field. API Key is the Router One key; Langflow marks it optional only because local servers may run without auth. Click Save: Langflow validates the pair by requesting /v1/models with the key as a Bearer token, then lists what it found under Language Models and Embedding Models. Enable the chat models you want under Language Models and leave everything under Embedding Models off. In a flow, add the Language Model component (or an Agent), open its Language Model field, and pick OpenAI Compatible plus a discovered model; the name shown is the exact catalog ID, vendor prefix included. The provider holds one endpoint at a time, so a second gateway or a local server needs a different provider entry:
- Base URL
- https://api.router.one/v1
# Langflow 1.12 → profile icon → Settings → Model Providers → OpenAI Compatible Base URL: https://api.router.one/v1 API Key: sk-your-router-one-key # Save → Langflow probes /v1/models and lists the catalog # Language Models: enable the chat model IDs you use # Embedding Models: leave off (no /v1/embeddings on the gateway) # In a flow: Language Model (or Agent) → Language Model field Provider: OpenAI Compatible Model: <exact-model-id-from-/models> # Alternative: Bundles → OpenAI → OpenAI component (advanced controls) OpenAI API Base: https://api.router.one/v1 OpenAI API Key: sk-your-router-one-key (Credential-type global variable) Model Name: type the exact ID, e.g. anthropic/claude-sonnet-5
Which Langflow field sends which request
Two paths reach the gateway. The global OpenAI Compatible provider is the main one; the bundled OpenAI component is the alternative when you want to type a model ID by hand or keep a second endpoint in the same instance. Both send Chat Completions:
| Langflow field | Value | What it sends or what to verify |
|---|---|---|
| Model Providers → OpenAI Compatible → Base URL | https://api.router.one/v1 | Save probes GET /v1/models; chat calls go to POST /v1/chat/completions. On 1.12 a missing /v1 is appended for you, on 1.11.x it is not |
| Model Providers → OpenAI Compatible → API Key | A Router One key created for this instance, with maxSpend | Sent as Authorization: Bearer; a 401 or 403 on the probe fails the save with an authentication message |
| Language Models toggles | Only chat model IDs you use | /v1/models lists the whole catalog, so image and video IDs are discovered too; do not enable them for a Language Model field |
| Embedding Models toggles | Leave all off for this provider | Langflow tags every discovered ID as an embedding model as well; Router One has no /v1/embeddings |
| Language Model component → Model Name Override (advanced) | An exact catalog ID, or a global variable holding one | Overrides the picked model at run time; it needs a built-in model selection, not a connected model object |
| Agent → Language Model | OpenAI Compatible + a model whose page lists tool calling | The field only offers models flagged for tool calling, and Langflow flags every discovered language model that way, so check the model page yourself |
| Agent → Max Iterations (advanced) | Default 15 | The maximum number of model calls one agent run may make; each call is its own request and trace |
| OpenAI component → OpenAI API Base (advanced) | https://api.router.one/v1 | Alternative path: Model Name is a combobox that accepts typed text, so an ID such as anthropic/claude-sonnet-5 can be entered directly; since 1.12.3 a key from the server environment needs api.router.one in LANGFLOW_PROVIDER_CREDENTIAL_ALLOWED_HOSTS |
The bundled OpenAI component as the alternative path
Bundles → OpenAI → OpenAI is a separate language-model component with its own connection fields, independent of the global provider. Open its advanced controls and set OpenAI API Base to https://api.router.one/v1; put the Router One key in OpenAI API Key, ideally as a Credential-type global variable (Settings → Global Variables) so the value is masked in the editor. Model Name is a combobox: its list is a fixed set of OpenAI names and is not fetched from the gateway, but it accepts typed text, so paste the exact catalog ID. Since Langflow 1.12.3 this component checks where its key goes: a key whose value is also held in the server's environment — the field's default reads the variable OPENAI_API_KEY, and the docker run above puts the Router One key in OPENAI_COMPATIBLE_API_KEY — is refused for any host other than api.openai.com with Refusing to send a server-provisioned API credential to the non-default endpoint 'api.router.one', unless that host is in LANGFLOW_PROVIDER_CREDENTIAL_ALLOWED_HOSTS; a key you type or store as your own global variable, with no copy in the server environment, is sent as usual (per the 1.12.5 source, checked 2026-10-09). Three defaults differ from the global path and are worth knowing before the first run. Max Retries defaults to 5 and Timeout to 700 seconds. Temperature 0.1 and Seed 1 are sent with every request, because the component only drops them for names in its own reasoning-model list, and that check is an exact match on unprefixed names such as gpt-5; a catalog ID with a vendor prefix never matches. If a 400 names temperature or seed, that is the model rejecting the parameter: read the full message and request_id in the error Langflow shows (Dashboard → Logs has the row too, unless the request was streamed and failed before any output) and change the value, not the base URL. To drive an Agent from this component, switch its output from Model Response to Language Model and connect it to the Agent's Language Model port.
Budget one Langflow instance and keep embeddings elsewhere
A flow run is not one request. Each Language Model component on the path costs a request, an Agent calls the model again after every tool result up to Max Iterations, and failed calls are retried by the OpenAI client underneath: the global provider passes no retry count, so the client default of 2 applies, while the bundled OpenAI component asks for 5. Every client attempt the gateway forwards to a model is its own row in Dashboard → Logs with model, tokens, cost, latency, status and request_id. Give each Langflow instance its own Router One key with maxSpend, so a looping agent or a scheduled caller stops at the cap with HTTP 402 and cannot spend past that amount, while your other keys keep working. Retrieval flows need an embedding model as well, and that part cannot use the gateway: Router One serves chat models on /v1/chat/completions and has no embeddings or rerank endpoint, so keep the Embedding Model component on another provider or a local embedding model, and point only the language model at Router One. Langflow's own API is a different thing again: POST /api/v1/run/<flow-id> on your Langflow server runs a flow and authenticates with a Langflow API key in the x-api-key header. That key also starts with sk-, so label the two keys clearly; the Langflow key never goes to the gateway and the Router One key never goes in x-api-key. The same applies to Langflow's MCP server, which exposes flows as tools and is unrelated to the gateway's /v1 routes.
Which model ID should Langflow send?
Copy the exact model ID from /models, preserving case, hyphens, and version suffixes; do not substitute a display name. Open its detail page and match the supported API endpoints, context window, and capabilities such as tool calling to the provider and features selected in Langflow. A catalog listing does not mean the client can use every feature of that model. Give each client or application a dedicated API key with a maxSpend cap.
Which API protocol is Langflow using?
OpenAI-compatible describes an interface format; it does not make Chat Completions (/v1/chat/completions), Responses (/v1/responses), and Anthropic Messages (/v1/messages) interchangeable. Check the installed client version, provider configuration, and actual request path against the model detail page and API compatibility fact sheet. A successful plain-text chat does not establish support for hosted tools, conversation state, or file-editing features.
Verify the Langflow call in your request trace
Send a simple text request from Langflow, then match its trace in Dashboard → Logs by time, model, and request_id: tokens, cost, latency, and status. Next, test streaming, tool calls, and multi-turn history separately. For failures, retain the actual request path, full error message, and request_id. If there is no matching log, either the request never reached the gateway (client configuration or connectivity) or the gateway refused it before calling a model — a 401 for the key, a 402 for funds, a 429 from your key's or account's limits, or a 400 or 404 for the model ID or endpoint; a streamed request that failed before any output may have no log either. The status and error message the client received tell which, so check them before attributing the error to the gateway or upstream.
FAQ
Saving the OpenAI Compatible provider fails. What do the errors mean?
Langflow validates the provider by calling /v1/models and reports one of a few fixed messages. 'Authentication failed for the OpenAI-compatible endpoint. Check OPENAI_COMPATIBLE_API_KEY.' means the probe got 401 or 403: the key is wrong, revoked, or has a stray space; on the gateway side an invalid key is 401 AUTH_INVALID_API_KEY. 'The OpenAI-compatible endpoint at … returned HTTP 404 for …/models. Check that the base URL points to an OpenAI-compatible API.' means the path is off, typically a doubled /v1/v1 or a trailing path segment; the message prints the exact URL it requested, so compare it with https://api.router.one/v1/models. 'Could not connect to the OpenAI-compatible endpoint at …' and '… timed out.' are network errors from the machine or container running Langflow; the probe allows five seconds and does not follow redirects, so check outbound HTTPS and any proxy from that host. If the save succeeds but the model list is empty, discovery failed quietly after validation: reopen the provider and save again, then check the Langflow server log.
A model I need is not in the Language Model dropdown. How do I use its exact ID?
First check the toggles: the dropdown only shows models enabled under Settings → Model Providers → OpenAI Compatible → Language Models, and Langflow marks just the first five discovered IDs as defaults. If the ID is in the catalog it is in that list; enable it. To choose the model at run time instead, open the Language Model component's advanced controls and set Model Name Override to the exact catalog ID, for example anthropic/claude-sonnet-5, or bind the field to a global variable. The other route is the bundled OpenAI component, whose Model Name combobox accepts any typed ID. In every case copy the ID from /models character for character, prefix included.
Can the Embedding Model component or a knowledge base use Router One too?
No. Langflow offers every ID it discovers from /v1/models in the Embedding Model picker because that route carries no capability data, so Router One's chat models will appear there, but selecting one makes Langflow call /v1/embeddings, which the gateway does not serve. Keep embeddings on another provider or a local model and leave the OpenAI Compatible entries under Embedding Models disabled. One Router One key still covers every Language Model and Agent component in the instance.
Which models can Langflow use through the gateway?
Choose a current catalog model that supports both the endpoint and the features Langflow uses. Check /models and the model detail page for the exact ID, current rates, and capabilities; a family name such as GPT or Claude is not a compatibility guarantee. A client that lists a model has only read the ID, from its own configuration or from GET /v1/models; verify an actual request too.
Models are listed, but requests fail with 400 or 404. What should I check?
Record the actual request path and error message, then check the exact model ID. A 400 can indicate invalid parameters, unsupported tools, or a model/endpoint mismatch; a 404 can indicate an incorrect path or missing resource, so it does not by itself establish that a model was retired. If the error says must be called via, use the named endpoint or select a model supported on the current endpoint. Do not add or remove /v1 or /chat/completions across all clients indiscriminately.
Does this work from Mainland China?
Yes. The gateway is reachable from Mainland China without a VPN, and the configuration is identical to the global setup.
How do I debug a 401/402/403/429?
Start from what your client received: the status, the error body and the X-Request-ID header. A 401 (missing, unknown, revoked or expired key), a 402 (wallet balance, or the key's maxSpend cap) and a 429 from your key's or account's rate limits are refused before any model is called, so they never appear in Dashboard → Logs — nor does a 400 or 404 for a wrong model ID or endpoint. For 401, check that the full key is sent and still active in Dashboard → API Keys; for 402, top up or raise the key's maxSpend; for a 403, keep the full error body. For 429, back off and retry later; a 429 that does show up in Logs came back from upstream after the gateway's retries. Keep the request_id and follow the error-codes reference.