Skip to main content

API Keys

Manage API keys for authentication and access control.


List API Keys

GET /v1/account/api-keys

Retrieve all API keys for your account.

Request
import os
from vocafuse import Client

client = Client(
api_key='sk_live_...',
api_secret='...'
)

api_keys = client.api_keys.list()
Response
{
"api_keys": [
{
"id": "3d8414c4-3e5b-4089-a94c-9f14e6d662e7",
"tenant_id": "63f8fa32-0740-4263-9bed-578156b3526b",
"name": "test",
"key_prefix": "sk_live_ky",
"scopes": [
"voicenotes:read",
"voicenotes:write",
"webhooks:read",
"webhooks:write",
"account:read",
"account:write"
],
"status": "active",
"last_used_at": "2025-10-06T17:50:56",
"usage_count": 79,
"expires_at": null,
"created_at": "2025-10-06T15:18:10",
"updated_at": "2025-10-06T17:50:56",
"uri": "/v1/account/api-keys/3d8414c4-3e5b-4089-a94c-9f14e6d662e7"
}
],
"uri": "/v1/account/api-keys",
"first_page_uri": "/v1/account/api-keys",
"next_page_uri": null,
"previous_page_uri": null,
"page": 0,
"page_size": 1,
"total": 1
}

Create API Key

POST /v1/account/api-keys

Generate a new API key pair.

Request
import os
from vocafuse import Client

client = Client(
api_key='sk_live_...',
api_secret='...'
)

new_key = client.api_keys.create(
name='Test API Key',
description='API key for testing purposes'
)

print(f"Key: {new_key['data']['api_key']}")
print(f"Secret: {new_key['data']['api_secret']}")
Response
{
"id": "aaf9aa0d-7c23-42bf-a455-692fb29b7867",
"name": "Test API Key",
"key_prefix": "sk_live_so",
"api_key": "sk_live_soqyhfh6ccjZsKCuAsA_6Q",
"api_secret": "nl8-PSrHFW0CDmdLXQLvwM6Q4yn9pZswWhpfikyfZtA",
"scopes": [
"voicenotes:read",
"voicenotes:write",
"webhooks:read",
"webhooks:write",
"account:read",
"account:write"
],
"status": "active",
"created_at": "2025-10-06T18:10:11.848979Z",
"uri": "/v1/account/api-keys/aaf9aa0d-7c23-42bf-a455-692fb29b7867",
"code": "API_KEY_CREATED"
}
danger

IMPORTANT: The api_key and api_secret are only returned once during creation. Save them immediately - they cannot be retrieved again.


Delete API Key

DELETE /v1/account/api-keys/{key_id}

Revoke an API key.

Request
import os
from vocafuse import Client

client = Client(
api_key='sk_live_...',
api_secret='...'
)

client.api_keys.delete('key_id_123')
Response
Status Code: 204 No Content