Manage tenant inference API keys (sk- prefix) via OpenAPI. Base URL: https://www.51kik.com. Auth: Access tokens.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /openapi/api-keys | Paginated list |
| POST | /openapi/api-keys | Create (apiKey plaintext returned once) |
| GET | /openapi/api-keys/:id | Single key |
| PATCH | /openapi/api-keys/:id | Update |
| DELETE | /openapi/api-keys/:id | Delete |
| GET | /openapi/api-keys/:id/plaintext | Full key plaintext |
Key object fields
List items[], GET detail, and successful PATCH responses return this key object (no plaintext apiKey):
| Field | Type | Description |
|---|---|---|
id | number | Key ID |
description | string | Label / description |
keyPreview | string | Masked preview (e.g. sk-xxxx…yyyy) |
createTime | string | Creation time (UTC ISO 8601) |
enabled | boolean | Whether the key is enabled |
creditLimit | number | null | Credit quota cap; null = unlimited |
creditResetInterval | string | Quota reset interval: none / daily / weekly / monthly |
expiresAt | string | null | Expiration time (UTC ISO 8601); null when created with never |
usedQuotaCostCredit | number | null | Credits consumed in the current billing window; null when creditLimit is not set |
totalUsedCostCredit | number | Lifetime credits consumed; 0 when there is no usage |
whitelistModelCount | number | Model whitelist entry count; 0 = no model restriction |
whitelistIpCount | number | IP whitelist entry count; 0 = no IPv4 source restriction |
lastUsedAt | string | null | Most recent call time (UTC ISO 8601); null if never used |
tags | string[] | Tags (stored lowercase, lexicographic order) |
employeeNo | string | null | Bound org member employee number |
orgUserDisplayName | string | null | Bound 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:
| Param | Type | Description |
|---|---|---|
page | number | Page number, default 1 |
page_size | number | Page size, default 20, max 100 |
q | string | Description substring search |
tag | string | Exact tag filter |
employee_no | string | Filter 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:
| Field | Type | Description |
|---|---|---|
items | array | Current page of key objects |
total | number | Total matching count |
page | number | Current page number |
pageSize | number | Page 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):
| Field | Type | Description |
|---|---|---|
description | string | Label, max 128 chars |
creditLimit | number | null | Credit quota cap; null = unlimited; default null |
creditResetInterval | string | none / daily / weekly / monthly; default none |
expiration | string | never / 1h / 1d / 7d / 30d / 90d / 180d / 1y; default never |
tags | string[] | Up to 20 tags |
employee_no | string | Bind 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"
}
| Field | Type | Description |
|---|---|---|
id | number | New key ID |
apiKey | string | Full plaintext key (returned only in this response) |
description | string | Label |
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):
| Field | Type | Description |
|---|---|---|
description | string | Label, max 128 chars |
enabled | boolean | Enable or disable the key |
creditLimit | number | null | Credit quota cap; null = unlimited |
creditResetInterval | string | none / daily / weekly / monthly |
expiration | string | never / 1h / 1d / 7d / 30d / 90d / 180d / 1y |
tags | string[] | Replace all tags (max 20) |
clearOrgEmployee | boolean | When true, clears org member binding |
employee_no | string | Rebind 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"
}
| Field | Type | Description |
|---|---|---|
id | number | Key ID |
apiKey | string | Full plaintext key |
Returns HTTP 400 when the key does not exist.
Errors
| HTTP | code | Scenario |
|---|---|---|
| 401 | 401 | Missing X-Access-Token, or token invalid / disabled / expired |
| 400 | 400 | Invalid query/body; empty PATCH body; employee number not found; key not found on delete or plaintext |
| 404 | 404 | Key id not found on GET detail or PATCH |
Related
- Inference calls: API keys
- OpenAPI overview