Skip to content

openai-hk Related APIs

This page provides some APIs related to openai-hk.com.

1. Login with API Key

2. Create an Account

  • You need to provide us with your server's IP address for whitelist authentication
  • The created account receives an apikey that can be used for login, log queries, and API calls

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

Response

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

3. Get Usage Logs

shell
curl --request POST \
  --url https://www.openai-hk.com/openai/sk/log \
  --header 'Authorization: Bearer hk-your-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-your-key' \
  --header 'content-type: application/json' \
  --data '{
    "start":0
    ,"limit":30
}'

Request parameters

NameTypeRequiredDescription
startnumberYesStart cursor. Must be >= 0
limitnumberYesNumber of records. 0 < limit <= 300

Response

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": ""
}

Log field descriptions

NameTypeRequiredDescription
idstringYesRecord ID
user_idstringYesUser ID
ctimestringYesCreation timestamp
prompt_tokensstringYesTokens used in the prompt
completion_tokensstringYesTokens used in the response
fenstringYesCredits consumed
modelstringYesModel used
yufenstringYesRemaining credit balance
reqidstringYesUnique request ID
ipstringYesRequest IP address
notestringYesNote