接口列表
大约 2 分钟
/token/info/<share token>
1. - 接口描述: 获取
Share Token
的详细信息 - HTTP方法:
GET
- 返回字段: 返回
Share Token
所的详细信息 - 频率控制: 无
- 特别说明:
Authorization
可选,值为Bearer <Access Token>
- 若提供有效
Share Token
注册用户的Access Token
,则返回Share Token
对各个模型的当日用度信息 - 此开共享
ChatGPT Plus
车必备统计数据功能
Curl
curl --location 'https://ai.fakeopen.com/token/info/<share token>'
javascript
var requestOptions = {
method: 'GET',
redirect: 'follow'
};
fetch("https://ai.fakeopen.com/token/info/<share token>", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
nodejs
const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://ai.fakeopen.com/token/info/<share token>',
headers: { }
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Python
import requests
url = "https://ai.fakeopen.com/token/info/<share token>"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
/token/register
2. - 接口描述: 注册或更新
Share Token
- HTTP方法:
POST
- 请求类型:
application/x-www-form-urlencoded
- 请求字段:
unique_name
:一个唯一的名字,这里要注意相同unique_name
和access_token
始终生成相同的Share Token
access_token
:ChatGPT
账号的Access Token
site_limit
:限制Share Token
使用的站点,格式为:https://xxx.yyy.com
,可留空不作限制expires_in
:Share Token
的有效期,单位为:秒
,为0
时表示与Access Token
同效,为-1
时吊销Share Token
show_conversations
:是否进行会话隔离,true
或false
,默认为false
show_userinfo
:是否隐藏邮箱
等账号信息,true
或false
,默认为false
- 返回字段: 返回
Share Token
等信息 - 频率控制: 无
Curl
curl --location 'https://ai.fakeopen.com/token/register' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'unique_name=fakeopen' \
--data-urlencode 'access_token=<accesstoken>' \
--data-urlencode 'site_limit=https://chat.xf233.net' \
--data-urlencode 'expires_in=0' \
--data-urlencode 'show_conversations=true' \
--data-urlencode 'show_userinfo=true'
javascript
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
var urlencoded = new URLSearchParams();
urlencoded.append("unique_name", "fakeopen");
urlencoded.append("access_token", "<accesstoken>");
urlencoded.append("site_limit", "https://chat.xf233.net");
urlencoded.append("expires_in", "0");
urlencoded.append("show_conversations", "true");
urlencoded.append("show_userinfo", "true");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://ai.fakeopen.com/token/register", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
nodejs
const axios = require('axios');
const qs = require('qs');
let data = qs.stringify({
'unique_name': 'fakeopen',
'access_token': '<accesstoken>',
'site_limit': 'https://chat.xf233.net',
'expires_in': '0',
'show_conversations': 'true',
'show_userinfo': 'true'
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://ai.fakeopen.com/token/register',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Python
import requests
url = "https://ai.fakeopen.com/token/register"
payload = 'unique_name=fakeopen&access_token=%3Caccesstoken%3E&site_limit=https%3A%2F%2Fchat.xf233.net&expires_in=0&show_conversations=true&show_userinfo=true'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)