Manage tenant inference API keys (sk- prefix) via OpenAPI. Base URL: https://www.51kik.com. Auth: Access tokens.

Endpoints

MethodPathDescription
GET/openapi/api-keysPaginated list
POST/openapi/api-keysCreate (apiKey plaintext returned once)
GET/openapi/api-keys/:idSingle key
PATCH/openapi/api-keys/:idUpdate
DELETE/openapi/api-keys/:idDelete
GET/openapi/api-keys/:id/plaintextFull key plaintext

Key object fields

List items[], GET detail, and successful PATCH responses return this key object (no plaintext apiKey):

FieldTypeDescription
idnumberKey ID
descriptionstringLabel / description
keyPreviewstringMasked preview (e.g. sk-xxxx…yyyy)
createTimestringCreation time (UTC ISO 8601)
enabledbooleanWhether the key is enabled
creditLimitnumber | nullCredit quota cap; null = unlimited
creditResetIntervalstringQuota reset interval: none / daily / weekly / monthly
expiresAtstring | nullExpiration time (UTC ISO 8601); null when created with never
usedQuotaCostCreditnumber | nullCredits consumed in the current billing window; null when creditLimit is not set
totalUsedCostCreditnumberLifetime credits consumed; 0 when there is no usage
whitelistModelCountnumberModel whitelist entry count; 0 = no model restriction
whitelistIpCountnumberIP whitelist entry count; 0 = no IPv4 source restriction
lastUsedAtstring | nullMost recent call time (UTC ISO 8601); null if never used
tagsstring[]Tags (stored lowercase, lexicographic order)
employeeNostring | nullBound org member employee number
orgUserDisplayNamestring | nullBound org member display name

List

curl -sS "https://www.51kik.com/openapi/api-keys?page=1&page_size=20" \
  -H "X-Access-Token: $ACCESS_TOKEN"

Query:

ParamTypeDescription
pagenumberPage number, default 1
page_sizenumberPage size, default 20, max 100
qstringDescription substring search
tagstringExact tag filter
employee_nostringFilter by org member employee number; returns an empty list if the employee does not exist

Example data:

{
  "items": [
    {
      "id": 1,
      "description": "prod",
      "keyPreview": "sk-xxxx…yyyy",
      "createTime": "2026-06-01T08:00:00.000Z",
      "enabled": true,
      "creditLimit": 1000,
      "creditResetInterval": "monthly",
      "expiresAt": null,
      "usedQuotaCostCredit": 120,
      "totalUsedCostCredit": 580,
      "whitelistModelCount": 0,
      "whitelistIpCount": 2,
      "lastUsedAt": "2026-06-10T12:30:00.000Z",
      "tags": ["prod"],
      "employeeNo": "E001",
      "orgUserDisplayName": "Alice"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 20
}

Pagination fields:

FieldTypeDescription
itemsarrayCurrent page of key objects
totalnumberTotal matching count
pagenumberCurrent page number
pageSizenumberPage size

Get by ID

curl -sS "https://www.51kik.com/openapi/api-keys/123" \
  -H "X-Access-Token: $ACCESS_TOKEN"

On success, data is a single key object (see fields above). Returns HTTP 404 when the key does not exist.

Create

curl -sS -X POST "https://www.51kik.com/openapi/api-keys" \
  -H "X-Access-Token: $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "automation-key",
    "creditLimit": 500,
    "creditResetInterval": "monthly",
    "expiration": "never",
    "tags": ["automation"],
    "employee_no": "E001"
  }'

Body fields (all optional):

FieldTypeDescription
descriptionstringLabel, max 128 chars
creditLimitnumber | nullCredit quota cap; null = unlimited; default null
creditResetIntervalstringnone / daily / weekly / monthly; default none
expirationstringnever / 1h / 1d / 7d / 30d / 90d / 180d / 1y; default never
tagsstring[]Up to 20 tags
employee_nostringBind org member by employee number; if the employee does not exist, the key is created without binding

Success data example:

{
  "id": 123,
  "apiKey": "sk-xxxxxxxxxxxxxxxx",
  "description": "automation-key"
}
FieldTypeDescription
idnumberNew key ID
apiKeystringFull plaintext key (returned only in this response)
descriptionstringLabel

Update

curl -sS -X PATCH "https://www.51kik.com/openapi/api-keys/123" \
  -H "X-Access-Token: $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false, "description": "disabled-key"}'

Body fields (at least one required):

FieldTypeDescription
descriptionstringLabel, max 128 chars
enabledbooleanEnable or disable the key
creditLimitnumber | nullCredit quota cap; null = unlimited
creditResetIntervalstringnone / daily / weekly / monthly
expirationstringnever / 1h / 1d / 7d / 30d / 90d / 180d / 1y
tagsstring[]Replace all tags (max 20)
clearOrgEmployeebooleanWhen true, clears org member binding
employee_nostringRebind by employee number; empty string clears binding; returns HTTP 400 if the employee does not exist

On success, data is the updated key object. Returns HTTP 404 when the key does not exist.

Delete

curl -sS -X DELETE "https://www.51kik.com/openapi/api-keys/123" \
  -H "X-Access-Token: $ACCESS_TOKEN"

Success data: { "id": 123 }. Returns HTTP 400 when the key does not exist.

Plaintext

curl -sS "https://www.51kik.com/openapi/api-keys/123/plaintext" \
  -H "X-Access-Token: $ACCESS_TOKEN"

Success data example:

{
  "id": 123,
  "apiKey": "sk-xxxxxxxxxxxxxxxx"
}
FieldTypeDescription
idnumberKey ID
apiKeystringFull plaintext key

Returns HTTP 400 when the key does not exist.

Errors

HTTPcodeScenario
401401Missing X-Access-Token, or token invalid / disabled / expired
400400Invalid query/body; empty PATCH body; employee number not found; key not found on delete or plaintext
404404Key id not found on GET detail or PATCH

Related