mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
@@ -32,7 +32,7 @@ FastGPT 的 API Key **有 2 类**,一类是全局通用的 key (无法直接
|
||||
OpenAPI 中,所有的接口都通过 Header.Authorization 进行鉴权。
|
||||
|
||||
```
|
||||
baseUrl: "https://api.fastgpt.in/api"
|
||||
baseUrl: "https://api.tryfastgpt.ai/api"
|
||||
headers: {
|
||||
Authorization: "Bearer {{apikey}}"
|
||||
}
|
||||
@@ -41,7 +41,7 @@ headers: {
|
||||
**发起应用对话示例**
|
||||
|
||||
```sh
|
||||
curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions' \
|
||||
curl --location --request POST 'https://api.tryfastgpt.ai/api/v1/chat/completions' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
|
@@ -29,7 +29,7 @@ weight: 852
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions' \
|
||||
curl --location --request POST 'https://api.tryfastgpt.ai/api/v1/chat/completions' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
|
@@ -22,7 +22,7 @@ weight: 853
|
||||
**新例子**
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/usage/createTrainingUsage' \
|
||||
curl --location --request POST 'https://api.tryfastgpt.ai/api/support/wallet/usage/createTrainingUsage' \
|
||||
--header 'Authorization: Bearer {{apikey}}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
@@ -34,7 +34,7 @@ curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/usage/
|
||||
**x例子**
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/bill/createTrainingBill' \
|
||||
curl --location --request POST 'https://api.tryfastgpt.ai/api/support/wallet/bill/createTrainingBill' \
|
||||
--header 'Authorization: Bearer {{apikey}}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
@@ -466,7 +466,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"link":"https://doc.fastgpt.in/docs/course/quick-start/",
|
||||
"link":"https://doc.tryfastgpt.ai/docs/course/quick-start/",
|
||||
"datasetId":"6593e137231a2be9c5603ba7",
|
||||
"parentId": null,
|
||||
|
||||
@@ -718,7 +718,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
"tmbId": "65422be6aa44b7da77729ec9",
|
||||
"type": "link",
|
||||
"name": "快速上手 | FastGPT",
|
||||
"rawLink": "https://doc.fastgpt.in/docs/course/quick-start/",
|
||||
"rawLink": "https://doc.tryfastgpt.ai/docs/course/quick-start/",
|
||||
"updateTime": "2024-01-20T13:54:53.031Z",
|
||||
"dataAmount": 3,
|
||||
"trainingAmount": 0,
|
||||
@@ -935,7 +935,7 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/collect
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/data/pushData' \
|
||||
curl --location --request POST 'https://api.tryfastgpt.ai/api/core/dataset/data/pushData' \
|
||||
--header 'Authorization: Bearer apikey' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
@@ -1272,7 +1272,7 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/data/de
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/searchTest' \
|
||||
curl --location --request POST 'https://api.tryfastgpt.ai/api/core/dataset/searchTest' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
|
@@ -53,9 +53,9 @@ weight: 860
|
||||
|
||||
在分享链接的地址中,增加一个额外的参数: authToken。例如:
|
||||
|
||||
原始的链接:`https://share.fastgpt.in/chat/share?shareId=648aaf5ae121349a16d62192`
|
||||
原始的链接:`https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192`
|
||||
|
||||
完整链接: `https://share.fastgpt.in/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345`
|
||||
完整链接: `https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345`
|
||||
|
||||
这个`authToken`通常是你系统生成的用户唯一凭证(Token之类的)。FastGPT 会在鉴权接口的`body`中携带 token={{authToken}} 的参数。
|
||||
|
||||
@@ -387,9 +387,9 @@ export default async function (ctx: FunctionContext) {
|
||||
|
||||
### 3. 修改分享链接参数
|
||||
|
||||
源分享链接:`https://share.fastgpt.in/chat/share?shareId=64be36376a438af0311e599c`
|
||||
源分享链接:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c`
|
||||
|
||||
修改后:`https://share.fastgpt.in/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt`
|
||||
修改后:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt`
|
||||
|
||||
### 4. 测试效果
|
||||
|
||||
|
Reference in New Issue
Block a user