Skip to main content

Key Management API

A Management Key is a management credential dedicated to programmatically managing Regular API Keys, with the prefix sk-mgmt-. The Base URL is https://tokenplus.net, and the authentication method is Authorization: Bearer sk-mgmt-xxx.

A Management Key can only call the 7 endpoints listed here and can only manage the current user's own Regular API Keys.

Supported Endpoints​

MethodPathFunction
GET/v1/keysPaginated query of Regular API Keys
POST/v1/keysCreate a Regular API Key
GET/v1/keys/{key_id}Query Regular API Key details
PATCH/v1/keys/{key_id}Modify name, limit, and model policy
DELETE/v1/keys/{key_id}Delete a Regular API Key
POST/v1/keys/{key_id}/toggleEnable or disable a Regular API Key
GET/v1/keys/{key_id}/usageQuery Regular API Key usage

Unsupported Scenarios​

A Management Key cannot:

  • call model, task, file, or other business endpoints;
  • call /v1/models to query models;
  • call login-user, administrator, or legacy /api/token/* endpoints;
  • create, query, modify, or delete other Management Keys;
  • manage other users' Regular API Keys.

Management Keys can only be created and maintained by a user after logging into the site, on the Management → Management Keys page. The full key is displayed only once at creation.

General Request Conventions​

ItemConvention
Base URLhttps://tokenplus.net
Auth headerAuthorization: Bearer sk-mgmt-...
Write request typeContent-Type: application/json
Regular API Key identifierkey_...
Time formatUTC RFC 3339, e.g. 2026-08-04T08:00:00Z
Write request idempotency headerIdempotency-Key, optional, recommended, max 255 bytes

The Management API only accepts Authorization Bearer authentication; it does not accept sessions, system access tokens, or Regular API Keys.

Rate Limit Policy​

Rate limit bucketDefault limitDimension
Auth attempts180 per 180 secondsSource IP
Reads180 per 180 secondsManagement Key, user, source IP
Writes20 per 1200 secondsManagement Key, user, source IP
Usage queries10 per 1200 secondsManagement Key, user, source IP

Exceeding any dimension returns 429 rate_limit_exceeded.

Regular API Key Data Structure​

Main fields of the list and detail endpoints:

FieldTypeDescription
idstringRegular API Key public ID, format key_...
namestringKey name
key_typestringAlways regular
key_previewstringMasked preview, e.g. sk-abcd**********wxyz; not the full key
statusstringactive or disabled
status_reasonstring/nullReason for unavailability: pending_subscription, expired, limit_exhausted, or manual
disabledbooleanWhether currently unavailable
limitnumberDollar limit; 0 means no limit
limit_resetstringnever, daily, weekly, or monthly
remainingnumber/nullRemaining dollar limit in the current window; null when there is no limit
created_atstringUTC RFC 3339 creation time
last_used_atstring/nullMost recent use time
model_allowliststring[]Model allowlist returned by the detail endpoint
model_blockliststring[]Model blocklist returned by the detail endpoint
usagenumberCumulative stored usage amount of the Regular API Key

In the list and detail responses, status_reason is null when the status is active.

Error Responses​

All Management API errors use a fixed structure:

{
"error": {
"code": "invalid_parameter",
"message": "Invalid JSON request body.",
"param": null,
"request_id": "req_..."
}
}

Callers should determine the error based on the HTTP status code and error.code, and must not match on the message text.

Online Service