Skip to main content

Documentation Index

Fetch the complete documentation index at: https://trygradient.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

API Keys

API keys provide programmatic access to the Gradient API. Keys are scoped to your organization and can be used for automation, CI/CD integration, and building custom tooling.

List API Keys

GET /api/api-keys
Returns all API keys for your organization. The full key value is never returned after creation.
Requires admin role (owner or admin).
{
  "apiKeys": [
    {
      "id": "uuid",
      "orgId": "uuid",
      "name": "Production Automation",
      "keyPrefix": "gai_abc12345",
      "scopes": [],
      "expiresAt": null,
      "lastUsedAt": "2025-01-15T10:00:00Z",
      "createdBy": "uuid",
      "createdAt": "2025-01-10T09:00:00Z",
      "isActive": true
    }
  ]
}

Create API Key

POST /api/api-keys
name
string
required
Human-readable label for the key
expiresAt
string
ISO 8601 expiry date
scopes
string[]
Reserved for future use
The key field is only returned once, at creation time. Store it securely - it cannot be retrieved again.
{
  "apiKey": {
    "id": "uuid",
    "name": "Production Automation",
    "keyPrefix": "gai_abc12345",
    "scopes": [],
    "expiresAt": null,
    "createdAt": "2025-01-10T09:00:00Z",
    "isActive": true
  },
  "key": "gai_abc123def456..."
}

Revoke API Key

DELETE /api/api-keys/:id
Deactivates an API key immediately. Any requests using this key will be rejected.
{
  "ok": true
}