Management Keys
What Is a Management Key?
A Management Key is a special key dedicated to programmatically managing API Keys (prefix sk-mgmt-). It differs from a regular API Key as follows:
- A management key cannot call model endpoints; it can only manage API Keys through the REST API (create / edit / delete / enable-disable / query usage).
- A regular API Key is used to call the model API and cannot manage other keys.
Managing API Keys via Endpoints
The Management APIs page provides all the endpoints for key management, including create, edit, delete, enable/disable, and usage queries.
All endpoints use Authorization: Bearer sk-mgmt-xxx for authentication, with a Base URL of https://tokenplus.net/v1. There are 7 endpoints in total:
| Method | Path | Description |
|---|---|---|
GET | /v1/keys | List all API Keys (supports limit/page/key_type/status pagination and filtering) |
POST | /v1/keys | Create an API Key (regular / management) |
GET | /v1/keys/{key_id} | Get key details |
PATCH | /v1/keys/{key_id} | Update a key (name / limit / model restrictions) |
DELETE | /v1/keys/{key_id} | Delete a key (irreversible) |
POST | /v1/keys/{key_id}/toggle | Enable / disable a key |
GET | /v1/keys/{key_id}/usage | Query usage records (aggregated by day / hour / model) |
The Full Key Is Shown Only Once
The full key returned upon creation appears only once in the response and cannot be retrieved again afterward — once missed, it can never be recovered. Save it to a secure location immediately.
Deletion is irreversible. After deletion, any application using that key will immediately receive a 401 error.
Impact of Deleting a Management Key
Deleting a management key does not affect the API Keys it created (the page will show: "Keys created by it will NOT be affected.").
Call Examples
The Management APIs page includes call examples in curl / Python / Node.js, covering listing keys, creating keys, updating limits, and querying usage.