API Keys
Manage platform and end-user API keys. Platform keys (sk-plat_*) control management operations. End-user keys (sk-eu_*) control runtime operations like chat completions and tool use.
/v1/platforms/{platformId}/api-keysReturns a paginated list of API keys for the platform.
Auth: Platform key.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| type | string | Optional | "platform" or "end_user". Filters by key type.Default: "platform" |
| page | integer | Optional | Page number.Default: 1 |
| limit | integer | Optional | Items per page. Max 100.Default: 20 |
The key_prefix (first 8 chars) is the only part of the key visible after creation. Full key hashes are never exposed.
# List platform keys
curl "https://api.assistiv.ai/v1/platforms/{platformId}/api-keys?type=platform" \
-H "Authorization: Bearer sk-plat_your_key"
# List end-user keys
curl "https://api.assistiv.ai/v1/platforms/{platformId}/api-keys?type=end_user" \
-H "Authorization: Bearer sk-plat_your_key"{
"data": [
{
"id": "uuid",
"platform_id": "uuid",
"key_prefix": "sk-plat_f",
"name": "Default key",
"scopes": [],
"is_active": true,
"last_used_at": "2026-04-08T10:30:00Z",
"expires_at": null,
"created_at": "2026-01-01T00:00:00Z"}
],
"total": 1, "page": 1, "limit": 20
}/v1/platforms/{platformId}/api-keysCreates a new platform API key.
Auth: Platform key.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | Key display name. 1-100 chars. |
| scopes | string[] | Optional | Permission scopes. Defaults to ["inference"] if omitted. |
| expires_at | string | Optional | ISO 8601 expiration timestamp. Omit for no expiry. |
⚠One-time display
The raw_key is only included in the creation response. Store it securely immediately.
curl -X POST https://api.assistiv.ai/v1/platforms/{platformId}/api-keys \
-H "Authorization: Bearer sk-plat_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "CI/CD key",
"scopes": ["inference"],
"expires_at": "2027-01-01T00:00:00Z"
}'{
"id": "uuid",
"key_prefix": "sk-plat_a",
"name": "CI/CD key",
"scopes": ["inference"],
"is_active": true,
"created_at": "2026-04-08T10:30:00Z",
"raw_key": "sk-plat_a1b2c3d4e5f6..."}/v1/platforms/{platformId}/api-keysCreates an end-user API key. Include end_user_id to create an end-user key instead of a platform key.
Auth: Platform key.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| end_user_id | string | Required | UUID of the end user this key belongs to. |
| name | string | Optional | Key display name. 1-100 chars. |
| scopes | string[] | Optional | Permission scopes. Defaults to ["inference"]. |
| expires_at | string | Optional | ISO 8601 expiration timestamp. |
curl -X POST https://api.assistiv.ai/v1/platforms/{platformId}/api-keys \
-H "Authorization: Bearer sk-plat_your_key" \
-H "Content-Type: application/json" \
-d '{
"end_user_id": "end-user-uuid",
"name": "Mobile app key",
"expires_at": "2027-01-01T00:00:00Z"
}'/v1/platforms/{platformId}/api-keys/{keyId}Retrieves an API key by ID. Returns metadata only (never the raw key).
Auth: Platform key.
curl https://api.assistiv.ai/v1/platforms/{platformId}/api-keys/{keyId} \
-H "Authorization: Bearer sk-plat_your_key"/v1/platforms/{platformId}/api-keys/{keyId}Updates a key's name or revokes it. Setting is_active to false revokes — Redis cache invalidated immediately.
Auth: Platform key.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| type | string | Optional | "end_user" when updating an end-user key. |
Request Body (all optional)
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | Updated display name. |
| is_active | boolean | Optional | Set to false to revoke. |
# Revoke an end-user key
curl -X PATCH "https://api.assistiv.ai/v1/platforms/{platformId}/api-keys/{keyId}?type=end_user" \
-H "Authorization: Bearer sk-plat_your_key" \
-H "Content-Type: application/json" \
-d '{ "name": "Renamed", "is_active": false }'/v1/platforms/{platformId}/api-keys/{keyId}Soft-deletes (revokes) an API key. Takes effect immediately via Redis cache invalidation.
Auth: Platform key. Returns 204 No Content.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| type | string | Optional | "end_user" when deleting an end-user key. |
curl -X DELETE "https://api.assistiv.ai/v1/platforms/{platformId}/api-keys/{keyId}?type=end_user" \
-H "Authorization: Bearer sk-plat_your_key"