-
Notifications
You must be signed in to change notification settings - Fork 8.4k
第三方API‐KEY接入指南
binary-husky edited this page Nov 11, 2023
·
32 revisions
注意!
高危设置! 常规情况下不要修改! 通过修改以下设置,您将把您的API-KEY和对话隐私完全暴露给您设定的中间人!
注意!
解释:apikey满足openai或者azure官方格式
LLM_MODEL = "gpt-3.5-turbo"
API_KEY = 'sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions":"https://xxxx.yyyy.zzzz/v1/chat/completions"}
# 极少数情况下,openai的官方KEY需要伴随组织编码(格式如org-xxxxxxxxxxxxxxxxxxxxxxxx)使用
API_ORG = ""
解释:apikey不满足官方格式或azure格式
LLM_MODEL = "gpt-3.5-turbo"
API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
CUSTOM_API_KEY_PATTERN = "用于匹配异形APIKEY的正则表达式"
API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions":"https://xxxx.yyyy.zzzz/v1/chat/completions"}
LLM_MODEL = "gpt-3.5-turbo"
API_KEY = 'fk195831-IaP9Pa3WaaCMUIbQwVX6MaSiyawqybyS'
CUSTOM_API_KEY_PATTERN = "fk[a-zA-Z0-9]{6}-[a-zA-Z0-9]{32}$"
API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions":"https://openai.api2d.net/v1/chat/completions"}
API_KEY = "fk-77ZFXnp2DMjJm9609uI54zNwFrzqf77-UM1kAHIhoqk"
CUSTOM_API_KEY_PATTERN = "fk-77ZFXnp2DMjJm9609uI54zNwFrzqf77-UM1kAHIhoqk"
API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://ai.fakeopen.com/v1/chat/completions"}
接入ChatGPT-to-API (需要将模型切换到chatgpt_website)
LLM_MODEL = "chatgpt_website"
API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "http://127.0.0.1:18080/v1/chat/completions"}
P.S. ChatGPT-to-API 的运行方法如下
$ git clone https://github.com/acheong08/ChatGPT-to-API.git && cd ChatGPT-to-API && go build
# Create the following configuration files and adjust their content according to your environment:
$ cat accounts.txt
username:password
$ cat proxies.txt
socks5://127.0.0.1:18890
$ SERVER_PORT=18080 ./freechatgpt
LLM_MODEL = "gpt-3.5-turbo"
API_KEY = 'sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://api.zeroai.link/v1/chat/completions"}
请第三方提交示例(+qq 505030475)