FastGPTFastGPT
App Building/App Publishing

Access App via API

Access FastGPT app via API

In FastGPT, the API entry under Publish Channels only creates App API Keys. App API Keys are isolated by app: each key belongs to the current app only and can only access that app's chat endpoint.

If you need to call general OpenAPI endpoints such as Knowledge Base or app management APIs, or use authProxy in chat/completions to proxy a team member identity, create a Global API Key in account settings. For the full distinction, see the OpenAPI Introduction.

Get an App API Key

Go to App -> "Publish Channels" -> "API", then click "New" to create a key.

App API Keys can only access the current app. Keep your key safe. To copy it again later, use the copy button in this app's API publish channel list.

🍅

Tip: For security, you can set a quota or expiration time to prevent key abuse.

Replace Variables in Third-Party Apps

OPENAI_API_BASE_URL: http://localhost:3000/api (replace with your deployed domain)
OPENAI_API_KEY = the key obtained in the previous step

ChatGPT Next Web Example:

ChatGPT Web Example: