POST /api/v1/projects/{project_id}/api-keys, exactly as documented in the Cloud API reference.
Key Format
API Keys use the following format: Prefix:ak_ (API Key)
Full format: ak_ + 32 alphanumeric characters (a-zA-Z0-9)
Example: ak_abc123XYZ789def456ghi012jkl345mn
Total length: 35 characters (3 character prefix + 32 character key)
Key Properties
- Hashing: Keys are hashed with SHA-256 before storage for security
- Prefix storage: Only the first 8 characters (e.g.,
ak_abc12) are stored inkey_prefixfor identification - One-time display: The full key is shown once during generation; only the hash is persisted
- Project scoping: Each key is bound to a specific project via
project_id - Multi-tenant: Backend projectors enforce scoping to prevent cross-project access
Environment Variable
In your Starter Kit deployment, set the generated key as:The environment variable is named
DEVKIT4AI_PROJECT_KEY for clarity about scope, but the keys themselves use the ak_ prefix (not pk_).Generation Flow
- Cloud Admin UI calls the API endpoint with optional
nameparameter - Backend generates key with
ak_prefix and 32 random alphanumeric characters - Full key is hashed with SHA-256
- Hash and prefix (first 8 chars) are stored in the database
- Full key is returned in response and displayed once
- Key becomes valid immediately for API requests

