Metadata-Version: 2.4
Name: audiokit-ai
Version: 0.1.0
Summary: Generated Python client and webhook verification for the AudioKit API
Project-URL: Homepage, https://audiokit.ai/docs/sdks/
Project-URL: Repository, https://github.com/epsilon-records/audiokit
License-Expression: LicenseRef-Proprietary
Requires-Python: >=3.11
Requires-Dist: httpx<1,>=0.28.1
Requires-Dist: typing-extensions<5,>=4.13
Description-Content-Type: text/markdown

# AudioKit for Python

Generated from AudioKit's OpenAPI contract; includes raw-body webhook verification. Python 3.11+.

**0.1.0 release candidate — not yet on PyPI.** After publication, install with pip install audiokit-ai. For local testing, install the wheel built from this directory.

```python
import os
from audiokit_ai import AudioKit, ApiError, verify_webhook
from audiokit_ai.models import JobRequest

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

# In a webhook handler, before parsing JSON:
if not verify_webhook(raw_body, signature_header, webhook_secret):
    # Return 401. Do not use the event.
    raise ValueError('Invalid webhook signature')
# After verification, parse the body and deduplicate event_id.
```

Set base_url for another API instance. Methods include get_health, get_capabilities, get_open_api, submit_job, get_job and cancel_job. Generated models are TypedDicts, so requests and responses are ordinary dictionaries. Use the context manager or call close() to release connections.

HTTP failures raise ApiError with status and code. Network failures are native httpx exceptions. Unknown API codes are preserved; treat unfamiliar ones as internal failures. There are no automatic retries or redirects; requests have a 30-second timeout. The verifier takes raw bytes and returns a boolean with a 300-second tolerance in both time directions. Its optional now argument is Unix seconds for deterministic tests. It does not deduplicate events.

[API documentation](https://audiokit.ai/docs/) · [SDK guide](https://audiokit.ai/docs/sdks/)
