Skip to content

openai-hk 相关API

这边提供一些 openai-hk.com 相关的api

1.使用 apikey 登录

2.开账号

  • 需要告知我们您服务端的IP,白名单认证
  • 开的账号 获得apikey可以用于登录、查询日志、调用等

get https://www.openai-hk.com/openai/sk/create

返回

json
{
	"data": {
        "apikey":"hk-xxxx"
    },
	"error": 0,
	"error_des": ""
}
{
	"data": {
        "apikey":"hk-xxxx"
    },
	"error": 0,
	"error_des": ""
}

3.获取使用日志

shell
curl --request POST \
  --url https://www.openai-hk.com/openai/sk/log \
  --header 'Authorization: Bearer hk-你的key' \
  --header 'content-type: application/json' \
  --data '{
    "start":0
    ,"limit":30
}'
curl --request POST \
  --url https://www.openai-hk.com/openai/sk/log \
  --header 'Authorization: Bearer hk-你的key' \
  --header 'content-type: application/json' \
  --data '{
    "start":0
    ,"limit":30
}'

请求

名称类型必填说明
startnumber开始游标.必须大于等于0
limitnumber取几条 0<limit<=300

返回

json
{
	"data": {
		"logs": [
			{
				"id": "6438975",
				"user_id": "9",
				"ctime": "1703405714",
				"prompt_tokens": "59",
				"completion_tokens": "11",
				"fen": "3",
				"model": "gpt-3.5-turbo",
				"yufen": "141434",
				"reqid": "vS0cNCTLSlXej4w1",
				"ip": "43.154.119.189",
				"note": ""
			},
        ]
    },
    "error": 0,
	"error_des": ""
}
{
	"data": {
		"logs": [
			{
				"id": "6438975",
				"user_id": "9",
				"ctime": "1703405714",
				"prompt_tokens": "59",
				"completion_tokens": "11",
				"fen": "3",
				"model": "gpt-3.5-turbo",
				"yufen": "141434",
				"reqid": "vS0cNCTLSlXej4w1",
				"ip": "43.154.119.189",
				"note": ""
			},
        ]
    },
    "error": 0,
	"error_des": ""
}

日志字段说明

名称类型必填说明
idstring名称
user_idstring用户id
ctimestring创建时间
prompt_tokensstring提示(提问)的token
completion_tokensstring补齐(回答)的token
fenstring消耗积分
modelstring模型
yufenstring积分余额
reqidstring请求唯一ID
ipstring请求ip
notestring备注