Skip to content

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 ​

ActionRequired PermissionScope
List project keysProject AI Keys: ReadIn accessible projects
Add a project keyProject AI Keys: CreateIn accessible projects
Delete a project keyProject AI Keys: Delete (All)In accessible projects
List workspace keysTenant AI Keys: ReadWorkspace
Add a workspace keyTenant AI Keys: CreateWorkspace
Change a workspace key's projectsTenant AI Keys: Update (All)Workspace
Delete a workspace keyTenant AI Keys: Delete (All)Workspace

Admins bypass all permission checks; project owners bypass them on their project's keys.

Endpoints ​

MethodEndpointDescription
GET/api/projects/{projectId}/ai-keysList a project's keys
POST/api/projects/{projectId}/ai-keysAdd a key to a project
DELETE/api/projects/{projectId}/ai-keys/{keyId}Delete a project key
GET/api/admin/ai-keysList the workspace keys
POST/api/admin/ai-keysAdd a workspace key
PUT/api/admin/ai-keys/{keyId}/projectsSet which projects a workspace key serves
DELETE/api/admin/ai-keys/{keyId}Delete a workspace key

The AI Key Object ​

FieldTypeDescription
idintegerKey ID
providerintegerSee Provider
key_hintstringLast four characters of the key
validated_atstring | nullWhen kendo last checked the key with the provider
created_atstring | nullISO 8601 timestamp
created_byintegerUser who added it
allowed_project_idsinteger[]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.

FieldTypeRequiredDescription
providerintegerYesSee Provider. One key per provider per project, and one per provider for the workspace
api_keystringYesThe provider key
project_idsinteger[]NoWorkspace 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.

FieldTypeRequiredDescription
project_idsinteger[]No1 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 ​

StatusCause
403The caller lacks the permission, the feature is off, or a project token was used on a project key endpoint
422The provider already has a key here, the key has the wrong format, or the provider refused it

Enums ​

Provider ​

ValueProvider
0Anthropic
1OpenAI

See Also ​

  • Issues API — AI story generation, which uses these keys