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
- Python
- Node.js
- cURL
import os
from vocafuse import Client
client = Client(
api_key='sk_live_...',
api_secret='...'
)
api_keys = client.api_keys.list()
const { Client } = require('vocafuse-node');
const client = new Client({
apiKey: process.env.VOCAFUSE_API_KEY,
apiSecret: process.env.VOCAFUSE_API_SECRET,
});
async function listApiKeys() {
const apiKeys = await client.apiKeys.list();
console.log(apiKeys.data);
}
curl -X GET "https://api.vocafuse.com/v1/account/api-keys" \
-H "X-VocaFuse-API-Key: sk_live_..." \
-H "X-VocaFuse-API-Secret: ..."
Response
{
"api_keys": [
{
"id": "3d8414c4-3e5b-4089-a94c-9f14e6d662e7",
"tenant_id": "63f8fa32-0740-4263-9bed-578156b3526b",
"name": "test",
"key_prefix": "sk_live_ky",
"scopes": [
"recordings:read",
"recordings: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
- Python
- Node.js
- cURL
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']}")
const { Client } = require('vocafuse-node');
const client = new Client({
apiKey: process.env.VOCAFUSE_API_KEY,
apiSecret: process.env.VOCAFUSE_API_SECRET,
});
async function createApiKey() {
const newKey = await client.apiKeys.create({
name: 'Test API Key',
description: 'API key for testing purposes',
});
console.log(`Key: ${newKey.data.api_key}`);
console.log(`Secret: ${newKey.data.api_secret}`); // Only shown once
}
curl -X POST "https://api.vocafuse.com/v1/account/api-keys" \
-H "X-VocaFuse-API-Key: sk_live_..." \
-H "X-VocaFuse-API-Secret: ..." \
-H "Content-Type: application/json" \
-d '{
"name": "Test API Key",
"description": "API key for testing purposes"
}'
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": [
"recordings:read",
"recordings: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
- Python
- Node.js
- cURL
import os
from vocafuse import Client
client = Client(
api_key='sk_live_...',
api_secret='...'
)
client.api_keys('key_id_123').delete()
const { Client } = require('vocafuse-node');
const client = new Client({
apiKey: process.env.VOCAFUSE_API_KEY,
apiSecret: process.env.VOCAFUSE_API_SECRET,
});
async function deleteApiKey() {
await client.apiKeys('key_id_123').delete();
}
curl -X DELETE "https://api.vocafuse.com/v1/account/api-keys/{key_id}" \
-H "X-VocaFuse-API-Key: sk_live_..." \
-H "X-VocaFuse-API-Secret: ..."
Response
Status Code: 204 No Content