Skip to content
KugelAudioDocs

Projects API

REST reference for projects: create one project per end customer, issue and revoke its API keys, and offboard customers with an organization admin key.

The Projects API is for platforms that serve many end customers. Give each end customer its own KugelAudio project, with its own pronunciation dictionaries and its own API key, and automate onboarding and offboarding without the dashboard.

A synthesis request made with a project's API key applies that project's dictionaries without naming the project, so each end customer's vocabulary is used automatically. See project_id for the details.

Organization admin key

Every endpoint on this page needs an API key with the Organization projects permission. Create it like any other key (see Getting your API key), choose the permission setting Restricted, and set Organization projects to Read (list projects) or Write (everything on this page).

  • Only organization owners and admins can grant this permission.
  • It is never part of the All setting; it must be granted explicitly.
  • The key acts as the person who created it, and only while that person is an owner or admin of the organization. Otherwise every call answers 403 PERMISSION_DENIED; create a new key.

Send the key in the same Authorization: Bearer header as every other endpoint. Keep it on your server: it can create and delete projects.

Onboard an end customer

1. Create a project with your admin key:

Bash
curl -X POST "https://api.kugelaudio.com/v1/projects" \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Autohaus Schmidt"}'
JSON
{ "id": 314, "name": "Autohaus Schmidt", "slug": "314", "created_at": "2026-10-09T09:00:00+00:00" }

2. Issue the customer's API key. For a key that only synthesizes speech and maintains its own dictionaries, grant tts and dictionaries:

Bash
curl -X POST "https://api.kugelaudio.com/v1/projects/314/api-keys" \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Autohaus Schmidt TTS", "permissions": {"tts": "write", "dictionaries": "write"}}'

Store secret from the response now; it is never shown again.

3. Create a dictionary and add an entry with the new key (see the Dictionaries API):

Bash
curl -X POST "https://api.kugelaudio.com/v1/dictionaries" \
  -H "Authorization: Bearer YOUR_CUSTOMER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Vehicle models", "language": "de"}'

curl -X POST "https://api.kugelaudio.com/v1/dictionaries/DICT_ID/entries" \
  -H "Authorization: Bearer YOUR_CUSTOMER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"word": "GTI", "replacement": "G T I"}'

4. Generate speech with the new key and no project_id. The customer's active dictionaries apply:

Bash
curl -X POST "https://api.kugelaudio.com/v1/tts/generate" \
  -H "Authorization: Bearer YOUR_CUSTOMER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Ihr GTI ist abholbereit.", "voice_id": 1071, "language": "de"}' \
  --output output.pcm

Offboard an end customer

Delete the project. This revokes its API keys and deletes its dictionaries and request logs in one call.

Response Objects

Project responses contain:

FieldTypeDescription
idintegerProject ID
namestringDisplay name
slugstringThe project's name in dashboard URLs. A project created over the API starts with its id as slug
created_atstringCreation timestamp

API key responses contain:

FieldTypeDescription
idintegerAPI key ID, used to revoke the key
project_idintegerProject the key belongs to
namestring | nullDisplay name
key_prefixstringFixed prefix every key starts with
key_last4stringLast four characters of the key
permissionsobject | nullResource to level; null means full access within the project
created_atstringCreation timestamp
secretstringThe full API key. Returned only in the response that issues it

List Projects

Return every project of the key's organization, oldest first. Needs Organization projects: Read.

GET/v1/projects

Response

JSON
{
  "projects": [
    { "id": 12, "name": "Default", "slug": "default", "created_at": "2026-01-15T10:00:00+00:00" },
    { "id": 314, "name": "Autohaus Schmidt", "slug": "314", "created_at": "2026-10-09T09:00:00+00:00" }
  ]
}

Example

cURL
curl -X GET "https://api.kugelaudio.com/v1/projects" \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY"

Create Project

Needs Organization projects: Write. Returns 201 with the project object. An organization can have at most 1000 projects.

POST/v1/projects

Body

name
string
body
required

Display name (1-200 characters, not blank).

Example

cURL
curl -X POST "https://api.kugelaudio.com/v1/projects" \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Autohaus Schmidt"}'

Delete Project

Needs Organization projects: Write.

DELETE/v1/projects/{project_id}

Response

JSON
{ "deleted": true }

Example

cURL
curl -X DELETE "https://api.kugelaudio.com/v1/projects/314" \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY"

Issue API Key

Issue a new API key for a project of your organization. Needs Organization projects: Write. Returns 201 with the API key object, including secret.

POST/v1/projects/{project_id}/api-keys

Body

name
string
body

Display name (maximum 200 characters).

permissions
object
body

Resource to level. Omit it for full access within the project (text to speech, realtime sessions, speech enhancement, voices and dictionaries). Resources and levels:

ResourceLevels
ttsnone, write
realtimenone, write
enhancenone, write
voicesnone, read, write
dictionariesnone, read, write

stt (speech to text) takes none or write, and full access includes it.

What each resource covers is in Key permissions. An issued key can never hold the projects permission. For a text-to-speech key per end customer, use {"tts": "write", "dictionaries": "write"}.

Response

JSON
{
  "id": 9001,
  "project_id": 314,
  "name": "Autohaus Schmidt TTS",
  "key_prefix": "sk-kug-proj",
  "key_last4": "a9d2",
  "permissions": { "tts": "write", "dictionaries": "write" },
  "created_at": "2026-10-09T09:01:00+00:00",
  "secret": "sk-kug-proj_..."
}

Example

cURL
curl -X POST "https://api.kugelaudio.com/v1/projects/314/api-keys" \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Autohaus Schmidt TTS", "permissions": {"tts": "write", "dictionaries": "write"}}'

Revoke API Key

Revoke an active API key of a project of your organization. Needs Organization projects: Write. A key cannot revoke itself.

DELETE/v1/projects/{project_id}/api-keys/{key_id}

Response

JSON
{ "deleted": true }

Example

cURL
curl -X DELETE "https://api.kugelaudio.com/v1/projects/314/api-keys/9001" \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY"

Error responses

Errors use the standard error body.

StatusCodeMeaning
400VALIDATION_ERRORMissing, blank or invalid field, an unknown permission resource or level, or a request to issue a key with the projects permission.
401UNAUTHORIZEDAPI key missing or invalid.
403PERMISSION_DENIEDThe key lacks the Organization projects permission, or its creator is no longer an owner or admin of the organization.
404NOT_FOUNDThe project does not exist or belongs to another organization, or the API key does not exist or is already revoked.
409VALIDATION_ERRORThe organization already has 1000 projects, the key tried to delete its own project, or the key tried to revoke itself.
503INTERNAL_ERRORProject management is unavailable on this deployment (for example a self-hosted one).