openai原生接口 任意模型 调用 有速率限制
懂的自然懂 不懂不解释
APIKey需要搭配第三方软件或者插件使用,如浏览器插件ChatGPTSidebar, ChatBox等。
支持国内使用,无需梯子!
ChatBox
ChatGPT开源桌面应用,支持全部桌面平台。
下载链接:https://github.com/Bin-Huang/chatbox/releases
网页版地址: https://web.chatboxai.app
使用方法:如图在设置中填入购买的密钥,并将代理设置为https://openai.gthree-sky.com/v1/chat/completions 即可
curl --location --request POST 'https://openai.gthree-sky.com/v1/chat/completions' \
--header 'Authorization: Bearer sk-TJVDbPJQtSQX1N64zQeyxoWfjqnoCWDGfJBZeHrUagIrUG02iTmJhuWi6mHwayXmVHq' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}'
JS 调用示例
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer sk-TJVDbPJQtSQX1N64zQeyxoWfjqnoCWDGfJBZeHrUagIrUG02iTmJhuWi6mHwayXmVHq");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"model": "gpt-40",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://openai.gthree-sky.com/v1/chat/completions", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Base Url: https://openai.gthree-sky.com/v1/chat/completions
API Key: sk-TJVDbPJQtSQX1N64zQeyxoWfjqnoCWDGfJBZeHrUagIrUG02iTmJhuWi6mHwayXmVHq
评论区