Run FastGPT apps on a custom OpenAI-compatible base URL.
Updated 2026-07-16
Current FastGPT configures models in the UI: add a channel under Account, Model Providers with the OpenAI protocol, https://api.apisrouter.com/v1 as the proxy address, and one key. Claude, GPT, DeepSeek, GLM, Kimi, and Qwen ids then power your knowledge bases and workflows.
Quick answer: one channel on the Model Providers page.
Since v4.8.23, FastGPT ships its own model-aggregation layer (AI Proxy) and a model-configuration UI, so a custom endpoint no longer requires a separate OneAPI deployment or hand-edited config.json. Open Account, then Model Providers, switch to the Model Channels tab, and click Add Channel. Set the protocol type to OpenAI, name the channel, put https://api.apisrouter.com/v1 in the proxy address field (the base URL, not the full request path), paste your key, and select or type the model ids the channel should serve. Back on the models tab, enable the ids you added and run the built-in connectivity test. From then on, every FastGPT app, knowledge base, and workflow node can select those models. The docs are bilingual and labels shift between releases (doc.fastgpt.io is the English entry), so treat the flow, channel, protocol, base URL, key, models, as the stable part rather than exact wording.
Channel Name: APIsRouter
Protocol Type: OpenAI
Proxy URL: https://api.apisrouter.com/v1
API Key: sk-YOUR-APISROUTER-KEY
Models: claude-sonnet-4-6, deepseek-v4-flash,
glm-5.2, qwen3.7-plus, kimi-k2.6
then: enable the models + run the connection testHow FastGPT routes model traffic.
FastGPT (labring on GitHub, roughly 29K stars) is a Chinese-origin knowledge-base and workflow platform: datasets with QA extraction and vector search, visual Flow orchestration, and published apps with sharing and API access. All of it resolves to models registered in the configuration layer. A channel is a routing rule: these model ids, this base URL, this key. Requests leave FastGPT as standard chat completions with the model id as a plain string, which is why a multi-vendor gateway slots in as a single channel. The channel layer also carries operational features you would otherwise build yourself: one model can live in several channels for load balancing, and model mapping lets FastGPT expose one name while sending the provider a different id string. For self-hosters on older versions, the direct wiring still exists: FastGPT's classic environment pair points the platform at any OpenAI-compatible base, OPENAI_BASE_URL and CHAT_API_KEY in the docker-compose environment, with models declared in config.json under llmModels. It works, but the UI path is where the project has moved, and new deployments should start there.
The Asia angle: one balance for both model worlds.
FastGPT's user base is heavily Chinese-speaking, and its typical deployment mixes regional models with Western ones: GLM or Qwen for Chinese knowledge bases, DeepSeek for volume, Claude or GPT where answer polish is the product. Served directly, that mix means accounts at Zhipu, Alibaba, DeepSeek, Anthropic, and OpenAI, each with its own billing, some hard to pay from one side of the world or the other. Through one channel, the mix is a model list: glm-5.2, qwen3.7-plus, kimi-k2.6, deepseek-v4-flash, and claude-haiku-4-5-20251001 side by side, one prepaid balance, no card requirement, ids straight from the catalog. Teams in Asia get Claude and GPT without a Western card; Western teams get the Chinese models without regional sign-ups. The same knowledge base can answer Chinese queries on GLM and English queries on Claude, routed per app. If you run the legacy environment wiring instead, the same endpoint drops in directly; the base URL convention includes the /v1 suffix, and FastGPT appends route paths like /chat/completions to it.
# docker-compose environment, pre-AI-Proxy versions
OPENAI_BASE_URL=https://api.apisrouter.com/v1
CHAT_API_KEY=sk-YOUR-APISROUTER-KEY
# models declared in config.json under llmModelsChoosing models for knowledge bases and flows.
Because every enabled id bills through one key, comparing models is a node-setting change. Pin two candidates in two copies of the same app, run a week of real questions, and read the per-model split in the APIsRouter console next to your own read on answer quality.
- Dataset QA and answer generation over retrieved chunks is volume work: deepseek-v4-flash and glm-5.2 keep per-question cost flat on bilingual corpora.
- qwen3.7-plus and kimi-k2.6 are the regional picks worth testing when answers must read natively in Chinese; generation quality varies across Chinese models more than retrieval does.
- claude-haiku-4-5-20251001 is the fast Western tier for mixed-language deployments; step up to claude-sonnet-4-6 in the specific apps where synthesis quality is the product.
- Workflow nodes fire per run, so a five-node flow multiplies whatever id sits in each node; put fast ids in classification and routing nodes, and spend on the answer node.
- Index and extraction models are configured separately from chat models; confirm the endpoint serves whatever embedding id you bind before rebuilding an index around it.
Pay-as-you-go · transparent per-model pricing
Selected models are priced below official list prices. Exact input, output, cache, and per-request prices are shown for each model.
| Model | Official Price | Our Price |
|---|---|---|
| GLM-5.2 | $1.14 / $4.00 per M | $1.03 / $3.60 per M |
| DeepSeek V4 Flash | $0.14 / $0.28 per M | $0.13 / $0.25 per M |
| Qwen 3.7 Plus | $0.29 / $1.14 per M | $0.26 / $1.03 per M |
| Kimi K2.6 | $0.95 / $4.00 per M | $0.85 / $3.60 per M |
| Claude Haiku 4.5 20251001 | $1.00 / $5.00 per M | $0.80 / $4.00 per M |
Failure modes specific to FastGPT.
The base URL convention trips people crossing from other tools: FastGPT expects the /v1-suffixed base in the proxy field and appends /chat/completions itself, while its custom-model form (a different feature, for one-off models that bypass channels) wants the full request URL including /v1/chat/completions. Know which field you are in before pasting. A model that exists in the channel but is not selectable in apps means it was added to the channel but not enabled on the models side of the configuration; the two lists are separate, and the connectivity test only proves the channel. Old tutorials are the biggest hazard. Years of FastGPT guides assume a OneAPI sidecar and config.json edits; on current versions the Model Providers UI replaces both, and mixing the two approaches (env wiring plus channels) makes requests route somewhere you are not looking. Pick one layer and configure it fully. Model-not-found errors are the usual free-text problem: the id in the channel must match the gateway's /v1/models spelling exactly, including version suffixes. Copy, do not type.
Who routes FastGPT through a gateway.
- Bilingual teams mixing GLM, Qwen, Kimi, and DeepSeek with Claude and GPT ids in one deployment, one balance, one usage log.
- Teams in Asia who want Western frontier models on a prepaid balance without a Western card, and Western teams who want Chinese models without regional billing.
- Self-hosters replacing a OneAPI sidecar: the gateway serves the multi-vendor part, FastGPT's built-in channels serve the routing part.
- Agencies running client knowledge bases on FastGPT, metering each client with its own key so model spend reports itself per project.
- Builders comparing answer models on fixed corpora, where each candidate is a channel entry rather than a vendor account.
Verify the endpoint and debug the first question.
Curl the models listing first and copy ids from the output into the channel; then run one chat completion against the id you plan to make default. If both pass, the gateway half is proven. Inside FastGPT, use the channel connectivity test, then ask one question in a minimal app before involving datasets. Authentication errors point at the channel key; not-found at id spelling; connection errors at the proxy URL or container egress, since it is the FastGPT server that must reach the endpoint. If a dataset app fails where a plain chat app works, the problem is in the dataset's own model bindings, not the channel. Once questions flow, the APIsRouter console shows per-request model, token counts, and spend. Knowledge-base traffic is many small, input-heavy requests, and the per-key usage view is where a deployment's real cost profile shows up, per model, per day, Chinese and Western ids on one page.
curl -s https://api.apisrouter.com/v1/models \
-H "Authorization: Bearer $APISROUTER_API_KEY" | head -50
curl -s https://api.apisrouter.com/v1/chat/completions \
-H "Authorization: Bearer $APISROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.2",
"messages":[{"role":"user","content":"ping"}]}'FAQ
How do I add a custom base URL to FastGPT?
On current versions, through the UI: Account, Model Providers, Model Channels, Add Channel with protocol OpenAI, proxy URL https://api.apisrouter.com/v1, your key, and the model ids. On older versions, set OPENAI_BASE_URL and CHAT_API_KEY in the environment and declare models in config.json.
Does the proxy URL include /v1?
Yes, in the channel's proxy field enter the /v1-suffixed base and FastGPT appends /chat/completions itself. The separate custom-model form is the exception: it takes the full request URL including /v1/chat/completions. Match the convention to the field you are using.
Do I still need OneAPI with FastGPT?
No. Since v4.8.23 FastGPT bundles its own aggregation layer with channel management in the UI, and a multi-vendor gateway covers the part OneAPI handled. Running both layers at once works but makes routing harder to reason about; new deployments should configure channels only.
Can FastGPT mix Chinese and Western models in one channel?
Yes. The channel forwards each model id as a plain string, so glm-5.2, qwen3.7-plus, kimi-k2.6, deepseek-v4-flash, and claude-sonnet-4-6 can share one channel and one key, selectable per app and per workflow node.
Why is my channel model not selectable in apps?
Adding an id to a channel and enabling the model for use are separate steps in the Model Providers UI. Enable the model on the models list, then check the app or node dropdown again; per-app model permissions can also filter what a given team sees.
Which FastGPT docs should I trust for this?
The current model-configuration section on doc.fastgpt.io. FastGPT's configuration surface changed substantially in the v4.8.2x era, and older third-party tutorials describing OneAPI sidecars or hand-edited llmModels blocks no longer match the UI-first flow.