OtherGuides

API key permissions

Limit what each Soniox API key can do, so each key has only the access it needs.

Overview

Every API key in a project has a list of permissions. Each permission lets the key use one part of the Soniox API, such as real-time transcription or file management. A call to anything else is refused with permission_denied.

Give each key only the access it needs. For example, if your server uses a key only to create temporary API keys for a browser, that key does not need access to your files or your usage data. If it leaks, the damage is limited.

Keys created before permissions were introduced have full access and keep working as before.


Setting permissions

  1. In the Soniox Console, open your project and go to API keys.
  2. Select Create API key and give the key a name.
  3. Turn on Full access, or choose a level for each permission the key needs.
  4. Create the key and copy it. The full key is shown only once.

Only organization admins can create and edit keys.


Permissions

Async transcription, files and cloned voices have two levels. Read allows listing and fetching. Write allows everything Read does, plus creating and deleting. The other permissions are either on or off.


Temporary API keys

Creating a temporary API key needs two permissions: Temporary API keys, and the permission for the service in usage_type.

usage_typeThe API key also needs
transcribe_websocketSpeech-to-text, real-time
tts_rtText-to-speech, real-time

Temporary API keys have no permissions of their own. A temporary key can do what its usage_type allows.


Editing a key

You can change the name and permissions of a key at any time. The key itself stays the same.

A change can take a few minutes to apply. Streams that are already running and temporary API keys that were already created are not affected.


Errors

A call that the key has no permission for is refused with HTTP status 403. This means the key is valid but does not have the permission. An invalid or deleted key gets 401 unauthenticated instead.

{
  "status_code": 403,
  "error_type": "permission_denied",
  "message": "The API key does not have permission for this product. Edit the key's permissions at https://console.soniox.com",
  "validation_errors": [],
  "request_id": "b4c1f4d5-8d8e-4a1c-9a8c-2a0e6f7c1d3e",
  "more_info": "https://soniox.com/docs/api-reference/errors#permission-denied"
}