Skip to content
TutujinAPI

Integration guides

Using FastGPT

Connecting FastGPT to Tutujin API takes two things — a model channel with the request URL https://www.tutujin.com/v1 and your API key, and the model names enabled in model configuration. Environment variables at deploy time work too.

Connecting FastGPT to Tutujin API takes two steps: tell FastGPT where to send requests and which key to use (the request URL https://www.tutujin.com/v1 plus your Tutujin API key), then enable the models you want in model configuration, with model IDs matching the names in the Tutujin model hub.

Where you configure this differs a lot between FastGPT versions: newer versions manage model channels in the admin pages, older ones use environment variables and config files at deploy time. Pick the method that matches your version. Menu names may differ slightly from what you see.

Method 1: add a model channel in the admin pages

For versions that manage model channels in the web interface:

  1. Sign in as an admin and open the model provider (or model channel) settings.
  2. Add a channel with the OpenAI protocol type and fill in:
FieldValue
Channel nameAnything, e.g. "Tutujin"
Proxy URL / request URLhttps://www.tutujin.com/v1
API keyYour Tutujin API key
ModelsSelect or enter the model names this channel should serve
  1. In model configuration, make sure those models are enabled. For a model that is not listed, add a custom model with the model name as its ID, e.g. deepseek-v4.1-flash.
  2. Save; the models now appear in your apps' AI settings.

Method 2: environment variables at deploy time

If you deploy with docker compose and your version supports these variables, set the default request URL and key on the FastGPT service:

YAML
services:
  fastgpt:
    environment:
      - OPENAI_BASE_URL=https://www.tutujin.com/v1
      - CHAT_API_KEY=sk-your-key

Restart FastGPT, then enable the models you need in model configuration, with IDs matching the model hub names.

Embedding models for knowledge bases

FastGPT knowledge bases need an embedding model. In model configuration, add or enable an embedding (index) model such as text-embedding-3-small; it uses the same channel as your chat models. Once a knowledge base exists, avoid switching embedding models, or you will have to re-embed all of its data.

Testing and billing

Send a message from an app; a normal reply means the setup works. Every call is recorded under Usage in the Tutujin console and billed at the key's group price. A dedicated key for FastGPT with a spending limit is a good idea.

Troubleshooting

SymptomCause and fix
Model test fails or 404The request URL needs /v1; it should be https://www.tutujin.com/v1
401Wrong or invalid key
503 with model_not_foundThe model ID is misspelled, or the key's group lacks the model — see Choosing a group
Knowledge-base import errorsMake sure an embedding model is enabled with the correct ID

Still stuck? Add our WeChat support JsnonoChat and send the request id from the error message, and we will look into it.