1. Overview
Management API Keys are intended for scenarios such as:- Issuing separate Model API Keys for different customers, projects, or environments
- Applying usage limits and automatic reset cycles to downstream Model API Keys
- Rotating, disabling, or revoking keys programmatically
- Enforcing least-privilege key management in SaaS, multi-tenant, and compliance-focused workflows
- Strict permission isolation for key management operations
- Full lifecycle automation for Model API Keys
- Configurable usage limits and reset cycles
- Designed for server-side services, internal tools, and automated provisioning workflows
2. API Surfaces and Authentication Boundaries
Key management is split into two API surfaces, each with its own authentication model:| API Surface | Purpose | Authentication |
|---|---|---|
/v1/management-keys | Manage Management API Keys | JWT |
/api/v1/model-router/keys | Manage Model API Keys using a Management API Key | Authorization: Bearer <management_key> |
- A
Management API Keycan only be used with/api/v1/model-router/keys - A
Management API Keycannot be used with/v1/management-keys /v1/management-keysonly supportsJWTauthentication- The full secret is returned only once when a key is created and cannot be retrieved later
3. Basic Rules
- Each account can create up to
10Management API Keys - Management API Keys are enabled immediately after creation
- The full Management API Key secret is returned only once
- Subsequent list and detail responses return masked key values only
- Model API Keys are currently soft-deleted rather than permanently deleted
4. Base URL
The public API base URL is:5. Create a Management API Key
Before using the Management API, first create a Management API Key in the DGrid console:If you expose this flow in your own UI, clearly inform users that the secret is shown only once and should be stored immediately.
6. Authentication
This document covers two authentication modes:- Endpoints under
/v1/management-keysrequireJWT - Endpoints under
/api/v1/model-router/keysrequire a Management API Key
/api/v1/model-router/keys endpoints:
7. Management API Key Lifecycle Endpoints
These endpoints are used to create, view, update, enable, disable, and delete Management API Keys. All of them requireJWT authentication.
| Operation | Method | Path | Notes |
|---|---|---|---|
| Create management key | POST | /v1/management-keys | Returns the full key only once |
| List management keys | GET | /v1/management-keys | Supports pagination |
| Update management key | PUT | /v1/management-keys/{id} | Currently only name can be updated |
| Delete management key | DELETE | /v1/management-keys/{id} | Soft delete |
| Enable management key | POST | /v1/management-keys/{id}/enablement | Takes effect immediately |
| Disable management key | POST | /v1/management-keys/{id}/disablement | Takes effect immediately |
keyis returned only once at creation timekeyPreviewis the masked display value
8. Manage Model API Keys with a Management API Key
All endpoints in this section use:8.1 Request Fields
The current implementation supports the following fields when creating or updating a Model API Key:| Field | Type | Required | Description |
|---|---|---|---|
name | string | Required on create | Key name |
limit | number | No | Usage limit |
cycle | daily | weekly | monthly | No | Reset cycle for the limit |
expiredAt | string | No | Expiration timestamp in UTC |
groupId | string | No | Group ID |
- If you are familiar with OpenRouter’s
limit_reset, the closest equivalent in the current DGrid implementation iscycle expiredAtshould use an ISO 8601 UTC timestamp such as2026-12-31T23:59:59Z
8.2 List Keys
- Method:
GET - Path:
/api/v1/model-router/keys - Query parameters:
page: page number, default1size: page size, default20, maximum100
- Pagination uses
pageandsize, notlimitandoffset - Partial name search is not currently supported
disabledfiltering is not currently supported
key: masked API key valueusageInCycle: usage within the current cycleusageInTotal: cumulative usageenabled: current enabled stategroupName: group name
8.3 Create a Model API Key
- Method:
POST - Path:
/api/v1/model-router/keys
keyis the full API key value and is returned only once- Store it immediately in a secure secrets management system
8.4 Get Key Details
- Method:
GET - Path:
/api/v1/model-router/keys/{id}
- The current implementation uses
id (UUID), notkey_hash
8.5 Update a Model API Key
- Method:
PUT - Path:
/api/v1/model-router/keys/{id}
namelimitcyclegroupId
- The current update method is
PUT, notPATCH
8.6 Disable a Model API Key
- Method:
POST - Path:
/api/v1/model-router/keys/{id}/disablement
8.7 Enable a Model API Key
- Method:
POST - Path:
/api/v1/model-router/keys/{id}/enablement
8.8 Delete a Model API Key
- Method:
DELETE - Path:
/api/v1/model-router/keys/{id}
- Deletion is currently a soft delete rather than a physical delete
9. Example Usage
10. HTTP Status and Error Codes
| HTTP Status | Error Code | Description |
|---|---|---|
400 | 40001 | Invalid request parameters |
401 | 40101 | Missing Management API Key in request header |
401 | 40102 | Invalid, expired, or disabled Management API Key |
403 | 40301 | Insufficient permissions or invalid key type for this endpoint |
404 | 40401 | Target key not found or does not belong to the current account |
429 | 42901 | Rate limit exceeded |
500 | 50001 | Internal server error |
11. Standard Response Format
Successful responses use the following envelope:- Successful requests return HTTP
200 - Create responses may include the full secret key in
data - List and detail endpoints usually return masked key values
- Full secrets for both Management API Keys and Model API Keys are returned only once

