mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 21:12:47 +00:00
Some checks are pending
Document deploy / sync-images (push) Waiting to run
Document deploy / generate-timestamp (push) Blocked by required conditions
Document deploy / build-images (map[domain:https://fastgpt.cn suffix:cn]) (push) Blocked by required conditions
Document deploy / build-images (map[domain:https://fastgpt.io suffix:io]) (push) Blocked by required conditions
Document deploy / update-images (map[deployment:fastgpt-docs domain:https://fastgpt.cn kube_config:KUBE_CONFIG_CN suffix:cn]) (push) Blocked by required conditions
Document deploy / update-images (map[deployment:fastgpt-docs domain:https://fastgpt.io kube_config:KUBE_CONFIG_IO suffix:io]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / get-vars (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Blocked by required conditions
* doc * fix: home app name * fix: char init error status * fix: index * fix: secret input
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
---
|
||
title: 通过 API 访问应用
|
||
description: 通过 API 访问 FastGPT 应用
|
||
---
|
||
|
||
import { Alert } from '@/components/docs/Alert';
|
||
|
||
在 FastGPT 中,你可以为每一个应用创建多个 API 密钥,用于访问应用的 API 接口。每个密钥仅能访问一个应用。完整的接口可以[查看应用对话接口](/docs/introduction/development/openapi/intro)。
|
||
|
||
## 获取 API 密钥
|
||
|
||
依次选择应用 -> 「API访问」,然后点击「API 密钥」来创建密钥。
|
||
|
||
<Alert context="warning">
|
||
密钥需要自己保管好,一旦关闭就无法再复制密钥,只能创建新密钥再复制。
|
||
</Alert>
|
||
|
||

|
||
|
||
<Alert icon="🍅" context="success">
|
||
Tips: 安全起见,你可以设置一个额度或者过期时间,防止 key 被滥用。
|
||
</Alert>
|
||
|
||
## 替换三方应用的变量
|
||
|
||
```bash
|
||
OPENAI_API_BASE_URL: https://localhost:3000/api (改成自己部署的域名)
|
||
OPENAI_API_KEY = 上一步获取到的密钥
|
||
```
|
||
|
||
**[ChatGPT Next Web](https://github.com/Yidadaa/ChatGPT-Next-Web) 示例:**
|
||
|
||

|
||
|
||
**[ChatGPT Web](https://github.com/Chanzhaoyu/chatgpt-web) 示例:**
|
||
|
||

|