Appearance
AI Keys API
kendo's AI features run on your own provider key. A key is stored either on one project or on the workspace. A project uses its own key first; without one, it uses the first workspace key that is open to it. A workspace key with no project list is open to every project.
Both kinds of key are behind the workspace's bring-your-own-key feature. When it is off, every endpoint here answers 403 with "feature_restricted": true. Project tokens cannot use the project key endpoints.
The key itself is never returned: a key reads back as its last four characters, key_hint.
Permissions
| Action | Required Permission | Scope |
|---|---|---|
| List project keys | Project AI Keys: Read | In accessible projects |
| Add a project key | Project AI Keys: Create | In accessible projects |
| Delete a project key | Project AI Keys: Delete (All) | In accessible projects |
| List workspace keys | Tenant AI Keys: Read | Workspace |
| Add a workspace key | Tenant AI Keys: Create | Workspace |
| Change a workspace key's projects | Tenant AI Keys: Update (All) | Workspace |
| Delete a workspace key | Tenant AI Keys: Delete (All) | Workspace |
Admins bypass all permission checks; project owners bypass them on their project's keys.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /api/projects/{projectId}/ai-keys | List a project's keys |
POST | /api/projects/{projectId}/ai-keys | Add a key to a project |
DELETE | /api/projects/{projectId}/ai-keys/{keyId} | Delete a project key |
GET | /api/admin/ai-keys | List the workspace keys |
POST | /api/admin/ai-keys | Add a workspace key |
PUT | /api/admin/ai-keys/{keyId}/projects | Set which projects a workspace key serves |
DELETE | /api/admin/ai-keys/{keyId} | Delete a workspace key |
The AI Key Object
| Field | Type | Description |
|---|---|---|
id | integer | Key ID |
provider | integer | See Provider |
key_hint | string | Last four characters of the key |
validated_at | string | null | When kendo last checked the key with the provider |
created_at | string | null | ISO 8601 timestamp |
created_by | integer | User who added it |
allowed_project_ids | integer[] | Workspace keys only. The projects the key serves; empty means every project |
Add a Key
POST /api/projects/{projectId}/ai-keys
POST /api/admin/ai-keys
Before storing it, kendo checks the key's format (sk-ant- for Anthropic, sk- for OpenAI) and sends one short request to the provider with it. A key that fails either check is not stored.
| Field | Type | Required | Description |
|---|---|---|---|
provider | integer | Yes | See Provider. One key per provider per project, and one per provider for the workspace |
api_key | string | Yes | The provider key |
project_ids | integer[] | No | Workspace keys only. Up to 500 project IDs; leave out for every project |
bash
curl -X POST https://{tenant}.kendo.dev/api/projects/1/ai-keys \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{"provider": 0, "api_key": "sk-ant-..."}'json
{
"id": 3,
"provider": 0,
"key_hint": "x9Qa",
"validated_at": "2026-11-20T09:00:00.000000Z",
"created_at": "2026-11-20T09:00:00.000000Z",
"created_by": 4
}List Keys
GET /api/projects/{projectId}/ai-keys and GET /api/admin/ai-keys return the keys, newest first.
Set a Workspace Key's Projects
PUT /api/admin/ai-keys/{keyId}/projects
Replaces the key's project list and returns the key.
| Field | Type | Required | Description |
|---|---|---|---|
project_ids | integer[] | No | 1 to 500 project IDs. Leave the key out to open the key to every project |
bash
curl -X PUT https://{tenant}.kendo.dev/api/admin/ai-keys/2/projects \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{"project_ids": [1, 4]}'Delete a Key
DELETE /api/projects/{projectId}/ai-keys/{keyId} and DELETE /api/admin/ai-keys/{keyId} return 204 No Content.
Error Responses
| Status | Cause |
|---|---|
403 | The caller lacks the permission, the feature is off, or a project token was used on a project key endpoint |
422 | The provider already has a key here, the key has the wrong format, or the provider refused it |
Enums
Provider
| Value | Provider |
|---|---|
0 | Anthropic |
1 | OpenAI |
See Also
- Issues API — AI story generation, which uses these keys