labring / FastGPT

FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.
https://tryfastgpt.ai
Other
17.5k stars 4.7k forks source link

调用对话接口报错Key is error. You need to use the app key rather than the account key. #869

Closed Brotherxu6 closed 8 months ago

Brotherxu6 commented 8 months ago

例行检查

你的版本 v4.6.7

问题描述 调用对话接口报错Key is error. You need to use the app key rather than the account key. 复现步骤 `import requests

url = "http://XXXXXXX:3000/api/v1/chat/completions" # 替换为目标URL data = { "model": "gpt-4-turbo-preview", "chatId": "2", "messages": [ { "role": "user", "content": "你叫什么" }, ] } headers = { "Authorization": "Bearer fastgpt-MR6gEYaQY1a9n7O2742K7m890vTN0KYFNOI" } response = requests.post(url, json=data, headers=headers, timeout=600) print(response.text) json_data = response.json()

print(json_data["choices"][0]["message"]["content"])` 预期结果

相关截图 image image

apas008 commented 6 months ago

我也报这个错误

LuckyGJX commented 5 months ago

我也是,请问怎么解决的呀