TypeScript and Python SDKs

Submit jobs and verify webhooks without writing your own HTTP client. Both SDKs are generated from the OpenAPI contract; the signature helpers use the same published test vector as the API.

Release status: version 0.1.0 is being prepared for npm and PyPI under the name audiokit-ai. Registry publication is pending; the install commands below apply after release. For now, use the HTTP quickstart.

TypeScript · Node.js 20+

After publication: npm install audiokit-ai. The package is ESM and server-side only; never ship your API key to a browser.

submit a job
import { AudioKit, ApiError, verifyWebhook } from 'audiokit-ai';

const client = new AudioKit({ apiKey: process.env.AUDIOKIT_API_KEY! });
const job = await client.submitJob({
  job_id: 'my-first-job',
  operation: 'probe',
  input: { url: signedInputUrl, sha256: inputSha256 },
  webhook: { url: 'https://example.com/audiokit/webhook' },
});
const status = await client.getJob(job.provider_job_id);
verify before parsing
// rawBody is the original Buffer, not JSON.stringify(parsedBody).
if (!verifyWebhook(rawBody, request.headers['x-signature'], webhookSecret)) {
  response.writeHead(401).end();
  return;
}
const event = JSON.parse(rawBody.toString('utf8'));
// Store event.event_id and ignore events you have already processed.

Python · 3.11+

After publication: pip install audiokit-ai. Import it as audiokit_ai. Requests and responses are ordinary dictionaries; generated TypedDict models are available in audiokit_ai.models.

submit a job
import os
from audiokit_ai import AudioKit, ApiError, verify_webhook

with AudioKit(api_key=os.environ['AUDIOKIT_API_KEY']) as client:
    job = client.submit_job({
        'job_id': 'my-first-job',
        'operation': 'probe',
        'input': {'url': signed_input_url, 'sha256': input_sha256},
        'webhook': {'url': 'https://example.com/audiokit/webhook'},
    })
    status = client.get_job(job['provider_job_id'])
verify before parsing
import json

# Read the original request body as bytes; do not reserialize JSON.
if not verify_webhook(raw_body, signature_header, webhook_secret):
    raise ValueError('Invalid webhook signature')  # Respond with 401.
event = json.loads(raw_body)
# Store event['event_id'] and ignore events already processed.

Use a context manager as above, or call client.close() to release connections.

Shared behavior

  • Set baseUrl / base_url for another API instance. The default is https://api.audiokit.ai.
  • Service methods: getHealth, getCapabilities, getOpenApi (snake-case in Python). Job methods: submitJob, getJob, cancelJob. Admin endpoints are not customer SDK methods.
  • HTTP failures throw ApiError with status and code. Unknown server codes are preserved; treat unfamiliar ones as internal failures. Non-JSON gateway errors use internal. Network failures remain native fetch/httpx exceptions.
  • No automatic retries or redirects. Requests have a 30-second timeout. Keep your job_id when manually retrying an unchanged request: it is the API's idempotency key.
  • Webhook verification returns a boolean, rejects timestamps more than 300 seconds in either direction, and compares HMACs in constant time. It does not deduplicate events. The optional now argument is Unix seconds for deterministic tests.

See the API reference for request fields, results and error codes, or the webhook guide for the wire format and test vector.