Skip to main content

Create Key

Create a new API key for authenticating with the AudioSpliter API.

POST /api/v1/api-keys

Authentication

JWT Bearer Token required via Authorization header.

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer <jwt_token>
Content-TypeYesapplication/json

Request Body

FieldTypeRequiredDescription
namestringYesHuman-readable key name
scopesstring[]NoPermissions: splits:read, splits:write, keys:manage. Defaults to all.
expiresAtstringNoISO 8601 expiration date. Omit for no expiration.

Example Request

{
"name": "Production Server",
"scopes": ["splits:read", "splits:write"],
"expiresAt": "2027-01-01T00:00:00Z"
}

Response

201 Created

{
"id": "key_abc123",
"name": "Production Server",
"key": "as_live_sk_abc123def456ghi789",
"scopes": ["splits:read", "splits:write"],
"createdAt": "2026-03-29T10:00:00Z",
"expiresAt": "2027-01-01T00:00:00Z"
}
caution

The key field is only returned once at creation time. Store it securely -- you cannot retrieve it later.

401 Unauthorized

{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired JWT token",
"status": 401
}
}

Code Examples

cURL

curl -X POST https://api.audiospliter.com/api/v1/api-keys \
-H "Authorization: Bearer your_jwt_token" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Server",
"scopes": ["splits:read", "splits:write"]
}'

Node.js

const response = await fetch('https://api.audiospliter.com/api/v1/api-keys', {
method: 'POST',
headers: {
'Authorization': `Bearer ${jwtToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Production Server',
scopes: ['splits:read', 'splits:write'],
}),
});
const { key } = await response.json();
// Store key securely - it won't be shown again

Python

import requests

response = requests.post(
'https://api.audiospliter.com/api/v1/api-keys',
headers={
'Authorization': f'Bearer {jwt_token}',
'Content-Type': 'application/json',
},
json={
'name': 'Production Server',
'scopes': ['splits:read', 'splits:write'],
},
)
data = response.json()
# Store data['key'] securely

Rate Limiting

This endpoint counts toward your per-minute rate limit. See Rate Limits.