Skip to content

openai-hk 関連API

こちらでは openai-hk.com 関連のAPIを提供しています

1.APIキーでログイン

2.アカウント開設

  • サーバー側のIPをお知らせください。ホワイトリスト認証が必要です
  • 開設されたアカウントで取得したapikeyは、ログイン、ログ照会、API呼び出しなどに使用できます

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はいID
user_idstringはいユーザーID
ctimestringはい作成時刻
prompt_tokensstringはいプロンプト(質問)のトークン
completion_tokensstringはい補完(回答)のトークン
fenstringはい消費ポイント
modelstringはいモデル
yufenstringはいポイント残高
reqidstringはいリクエスト一意ID
ipstringはいリクエストIP
notestringはい備考