Skip to main content

Admin

API Keys

List and revoke API keys across your organization. These endpoints are intended for security automation — for example, revoking keys belonging to a compromised account.

To create API keys interactively, navigate to the Developer Console at /developer on your Nomic instance.

Listing and revoking keys requires admin scopes — the API key owner must be an organization admin. Any valid key can call Get current API key to inspect itself.

Get current API key​

GET /api-keys/current

Describe the calling credential: its owner, the scopes it can exercise right now, and the operations it may call. Use it to verify a key before doing work.

Scope: none — any valid key · Rate limit: Standard (300 req / min)

Response​

{
"data": {
"apiKeyId": "019abc12-3456-7890-abcd-ef1234567890",
"user": {
"id": "019abc12-3456-7890-abcd-ef1234567891",
"email": "alice@example.com"
},
"organizationId": "org_01HXYZ...",
"scopes": ["developer"],
"operations": ["create_project", "get_agent", "launch_agent", "list_agents"]
}
}
FieldTypeDescription
apiKeyIdstring (uuid) or nullID of the calling API key; null for browser sessions.
userobjectOwner of the key (id and email).
organizationIdstring or nullThe owner's organization ID, or null if they have none.
scopesstring[]Scopes this credential can exercise right now. Admin scopes are listed only while the key owner is an organization admin.
operationsstring[]operationIds from the API reference this credential may call. Resource-level checks (ownership, project roles) still apply per call.

Example​

curl "https://<your-domain>.nomic.ai/api/v0/api-keys/current" \
-H "Authorization: Bearer $NOMIC_API_KEY"

List API keys​

GET /api-keys

Returns a paginated list of API keys in the organization.

Scope: admin:api-keys:read · Rate limit: Standard (300 req / min)

Query parameters​

ParameterTypeRequiredDescription
limitstringNoMaximum number of results per page.
cursorstringNoPagination cursor from a previous response's nextCursor.
userIdstringNoFilter to keys owned by a specific user ID.
includeRevokedstringNoSet to "true" to include revoked keys. Omit or "false" to exclude them.

Response​

{
"data": [
{
"id": "019abc12-3456-7890-abcd-ef1234567890",
"keyPrefix": "npk_abc12",
"name": "CI/CD Pipeline",
"scopes": ["developer:parse", "developer:files"],
"createdAt": "2026-02-01T10:00:00.000Z",
"lastUsedAt": "2026-04-04T18:30:00.000Z",
"expiresAt": null,
"revokedAt": null,
"user": {
"id": "019abc12-3456-7890-abcd-ef1234567891",
"email": "alice@example.com"
}
}
],
"nextCursor": "019abc12-3456-7890-abcd-ef1234567899",
"totalCount": 15
}
FieldTypeDescription
idstring (uuid)API key ID.
keyPrefixstringFirst characters of the key (e.g. npk_abc12). The full key is never returned.
namestringDisplay name given when the key was created.
scopesstring[]Scopes granted to this key.
createdAtstring (ISO 8601)When the key was created.
lastUsedAtstring (ISO 8601) or nullLast time the key was used.
expiresAtstring (ISO 8601) or nullExpiration date, or null if the key does not expire.
revokedAtstring (ISO 8601) or nullWhen the key was revoked, or null if active.
userobjectOwner of the key (id and email).

Example​

curl "https://<your-domain>.nomic.ai/api/v0/api-keys?includeRevoked=true" \
-H "Authorization: Bearer $NOMIC_API_KEY"

Revoke an API key​

POST /api-keys/{id}/revoke

Permanently revokes an API key. Revoked keys cannot be restored. The action is recorded in the audit log.

Scope: admin:api-keys:write · Rate limit: Write (60 req / min)

Path parameters​

ParameterTypeDescription
idstring (uuid)API key ID.

Request body (optional)​

FieldTypeDescription
reasonstringReason for revoking (recorded in audit log).

Response​

{
"success": true,
"apiKey": {
"id": "019abc12-3456-7890-abcd-ef1234567890",
"keyPrefix": "npk_abc12",
"revokedAt": "2026-04-05T12:00:00.000Z"
}
}

Errors​

StatusCause
401Missing or invalid API key.
403API key lacks admin:api-keys:write scope, or key owner is not an admin.
404API key not found.
409Key is already revoked.

Example​

curl -X POST "https://<your-domain>.nomic.ai/api/v0/api-keys/019abc12-3456-7890-abcd-ef1234567890/revoke" \
-H "Authorization: Bearer $NOMIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "reason": "Rotating credentials" }'