Three job endpoints, one auth header, one polling loop. Everything on this page documents the deployed v1 surface — the machine-readable version is openapi.json, and the coding-agent version is agents.md.
Upload a file, point a voice at it, poll until it is done, download the result. Five curl calls, under five minutes. The base URL and key come from your environment — never hardcode a domain.
Location, obey the server's Retry-After, and use ETag/If-None-Match for cheap 304 polling. Never re-send a mutation without its original Idempotency-Key.wrangler dev and automated tests. Staging and production refuse billable work until their real Stripe configuration is complete — billing fails closed, never open.Every request carries a bearer token. Keys start with vsk_ (256-bit, random), are stored only as a SHA-256 hash, and the plaintext is shown exactly once — at creation or rotation.
Keys are scoped: each key carries an endpoint allowlist and a voice allowlist (or all). Missing, invalid, or revoked credentials return 401 with a Bearer challenge; a valid key outside its scope returns 403 forbidden before any billing artifact exists.
Rotation keeps the key's id, scopes, limits and usage history but swaps the secret; the old token stops resolving immediately. Revocation propagates to the enforcement cache in ≤ 60 seconds, with an immediate push in the normal path. There is no grace window.
To verify a key and see what it can reach:
Audio bytes never travel in a job request — jobs reference an upload. Three ways to get the bytes in, all landing in workspace-scoped storage keys that only your keys can reference:
rights_attestation: true. The direct-body route uses x-voiceswap-rights-attestation: true. Clone/training datasets require a separate declaration when that currently-disabled capability is enabled. The server records the current voice-rights policy version, document hash, signer, subject, context and time in append-only evidence. A missing or false declaration returns 400 input_invalid before an upload row or job can be created.Returns a presigned URL you PUT the file to, valid 1 h. Mandatory for files over 50 MB; recommended for everything.
| FIELD | MEANING | |
|---|---|---|
| content_length | optional | Size in bytes — lets the server floor the credit hold honestly. |
| rights_attestation | required | Must be literal true; confirms ownership or all permissions needed for this upload and use. |
Raw request body streamed to storage — the API never buffers the file. Content-Length and x-voiceswap-rights-attestation: true are required; when sending Idempotency-Key, send Content-Digest so retries can compare the bytes. Anything over 50 MB is refused with 400 input_invalid.
Initiate a multipart session, then sign parts, upload each part to its URL, and complete with the ETags. Re-request part URLs any time to resume.
| STEP | CALL | NOTES |
|---|---|---|
| initiate | POST /v1/uploads/multipart | body { "rights_attestation": true } → 201 { upload_id, r2_key } |
| sign parts | POST /v1/uploads/multipart/{id}/parts | body { "part_numbers": [1, 2, …] } — 1–100 numbers per call, part numbers 1–10000 → { parts: [{ part_number, put_url }] } |
| complete | POST /v1/uploads/multipart/{id}/complete | body { "parts": [{ "part_number", "etag" }] } (ETags from each part PUT) → { r2_key } |
| abort | POST /v1/uploads/multipart/{id}/abort | → { "aborted": true } |
multipart/form-data file bodies are not accepted on /v1/swap · /v1/vocals · /v1/instrumental; upload first, then reference input.upload_id.Public, unauthenticated reports are rate-limited by the same anonymous edge limiter used for signup recovery. Intake is durable in the admin review queue. Until an email vendor is configured, acknowledgement and action notices are recorded with delivery status stubbed; the API does not claim an email was sent.
Required: requester_email, target_type, a target_id or target_url, category, and description.
The same target fields plus literal good_faith: true, accurate: true, and signature: true. Read the versioned takedown policy before submitting.
Replace the singer (or speaker — see the speech-beta note) in a recording. The model aims to retain performance features, but separation and conversion can alter them; review each result.
| FIELD | MEANING | |
|---|---|---|
| input | required | { "upload_id": "…" } or { "r2_key": "…" } — an upload owned by your workspace. The object must exist before the POST. If both fields are sent, upload_id takes precedence. |
| voice | required | A voice id from GET /v1/voices with "status": "ready". A voice outside the key's scope is 403; an unknown one is 404 voice_not_found; a not-ready one is 409 conflict. |
| params.pitch | optional | Semitone shift applied at conversion. Integer, −24 to 24, default 0. Validated on the processing engine, not at the POST — an out-of-range value is accepted with 202, then the job fails with input_invalid (never billed). |
| params.preserve_timing | optional | Boolean, default true. Currently no effect — conversion is always frame-exact (timing is always preserved); the flag is accepted for forward compatibility only. |
| params.denoise | optional | Boolean, default false. Applies only when the input is classified as speech (the separation-bypass path); a music mix goes through separation instead and denoise is ignored. |
| format | optional | wav, mp3 or flac. Default wav. |
| duration_hint_seconds | optional | Sizes the temporary credit hold — any number greater than 0, at most 1800 (fractions allowed; the hold rounds up to whole seconds). It can only enlarge the hold and is floored by the upload's byte size; billing always uses the measured duration, never this hint. When a workspace spend cap (including the first-week ceiling) or a key minute/spend cap applies, the hint is ignored and the hold is the 1800-second job maximum, so queued jobs can never settle above the cap. |
Send Idempotency-Key: <uuid> on every mutation. The same key and parameters replay the stored success or executed failure for 24 h; different parameters return 409. Validation failures release the key, and abandoned executions become retryable after a short lease.
Return only the vocal from a mixed recording — the first stage of what /v1/swap does internally. Same request shape as swap, minus the voice.
| FIELD | MEANING | |
|---|---|---|
| input | required | { "upload_id" } or { "r2_key" } — upload_id wins if both are sent. |
| params.denoise | optional | Boolean, default false. Speech-bypass only: applied when the input is classified as speech; a music mix is separated instead and denoise is ignored. |
| format | optional | wav | mp3 | flac, default wav. |
| duration_hint_seconds | optional | As on /v1/swap. |
Responds 202 with the same job object ("endpoint": "vocals", "voice_id": null); poll and fetch the result the same way.
Return the backing track with the vocal removed. Same separator as /v1/vocals, opposite half; both halves bill from the same meter — the length of the input.
| FIELD | MEANING | |
|---|---|---|
| input | required | { "upload_id" } or { "r2_key" } — upload_id wins if both are sent. |
| format | optional | wav | mp3 | flac, default wav. |
| duration_hint_seconds | optional | As on /v1/swap. |
Responds 202 with the job object ("endpoint": "instrumental").
The lifecycle is queued → processing → succeeded | failed, with queued | processing → cancelled. Queued/processing responses include Retry-After; every representation has an ETag and honors If-None-Match → 304. Durations are integer seconds. Failures use failure: {code, detail, retryable}.
Cancel a queued or processing job. The credit hold is released and the GPU task is terminated; a cancelled job is never billed, even if the GPU finishes late — the late result is discarded and reconciled. Cancelling an already-cancelled job returns 200 again (idempotent); a job that already succeeded or failed is 409 conflict.
A signed download URL for the output of a succeeded job.
Content-Disposition download filename; call the endpoint again any time for a fresh one.409 conflict ("poll GET /v1/jobs/:id"). Failed or cancelled → 409, no result exists.404 not_found with an explicit message. The default retention is zero plus a 1 h download grace window — download promptly.Every voice the calling key can reach: published library voices plus your workspace's own, filtered by the key's voice scope. Only a voice with "status": "ready" can be used in /v1/swap.
All list endpoints use ?limit=25&cursor=…; limit defaults to 25 and is bounded to 1–100. Cursors are opaque.
Use an admin key with the explicit voices:import action. Imported voices start private. When imports are disabled, these endpoints return HTTP 503 with code import_unavailable and retryable: false.
PUT the ZIP (only model.pth and an optional model.index, up to 500 MiB) to model_put_url. If requested, PUT a WAV, MP3 or FLAC preview up to 20 MiB to sample_put_url. Rename Applio files to those exact names at the ZIP root. Declare the exact ZIP byte count in model_size_bytes. Include sample_size_bytes only when sample is true. Each PUT must send the matching Content-Length. Use a protocol-2 torch.save checkpoint with data.pkl up to 2 MiB and a FAISS index if supplied. Each entry may expand to 1 GiB. For DEFLATE entries over 1 MiB expanded, the ratio limit is 20:1. Send If-None-Match: * with both PUTs and omit x-amz-copy-source. Set Content-Type to application/zip for the model and application/octet-stream for the preview. The URLs expire after 15 minutes.
After uploading, complete the import with an empty body. A ready voice can be used immediately in a swap. Invalid uploads return 400.
Returns the voice ID and status. A failed import includes its reason.
Register an HTTPS endpoint and Voiceswap POSTs you events instead of making you poll. Delivery is at-least-once and asynchronous; the event insert is transactional with the state change that caused it, so an event you receive is always true — but you may receive it twice. Deduplicate on vs-event-id.
| FIELD | MEANING | |
|---|---|---|
| url | required | Your HTTPS endpoint. |
| event_types | optional | Subset of the event types below. Default includes succeeded, failed, and cancelled jobs. |
Cursor page → { "data": [{ id, url, event_types, active, created_at }], "has_more", "next_cursor" }.
Deactivate an endpoint → { "deleted": true }.
Cursor page of delivery attempts; unknown or foreign endpoints return 404.
Put any delivery — including a dead-lettered one — back in the queue now → { "replayed": true }.
Every delivery uses one envelope: { id: "evt_…", type, created_at, data }. Job lifecycle events are a discriminated union on type; all three carry the same full data.job resource. job.succeeded additionally carries data.billing: { amount, currency }. Failed-job details use the same public taxonomy text as polling and never expose provider diagnostics.
| TYPE | WHEN |
|---|---|
| job.succeeded | A job finished and was billed. LIVE |
| job.failed | A job ended in a failure class — nothing billed. LIVE |
| job.cancelled | Cancellation committed; billing is irreversibly released while provider cleanup may continue. LIVE |
| workspace.spend_alert | A measured settle pushed the workspace over its spend cap. LIVE |
| workspace.payment_failed | An overage charge permanently declined — new billable work refuses until resolved. LIVE |
| workspace.payment_method_saved · workspace.topup_succeeded · workspace.clone_paid · workspace.refund_issued · workspace.dispute_created | Implemented billing lifecycle events. LIVE |
| voice.ready · voice.failed | Reserved for voice training — emitted once the training control plane ships. RESERVED |
Every delivery is signed with your endpoint's secret. Headers:
Verify against the unmodified raw body, reject timestamps older than five minutes, use constant-time comparison, and ignore unknown future event types. Webhook deliveries do not follow redirects. A 3xx response counts as a failed attempt. Failed deliveries retry after 1 m → 5 m → 30 m → 2 h → 8 h, then dead-letter; replay revives them.
Every non-2xx JSON response is application/problem+json with RFC 9457 fields plus stable code, request_id, and retryable. The nested error member is a deprecated v1 compatibility extension. Every type URI resolves to the public error registry, which lists meaning and remediation.
| HTTP | CODE | BILLED | MEANING |
|---|---|---|---|
| 400 | input_invalid | never | A parameter, body, or the input audio is missing or malformed; this includes a missing/false upload rights_attestation (or direct-upload attestation header). |
| 401 | unauthorized | never | Key missing, unknown, or revoked; includes a Bearer challenge. |
| 402 | payment_required | never | No payment method on the workspace (card-first, no free minutes), or a previous charge failed and must be resolved. |
| 403 | insufficient_scope | never | Valid key lacks endpoint or voice scope. |
| 403 | forbidden | never | The authenticated actor lacks permission for the action. |
| 404 | not_found | never | No such route or object — including outputs already deleted by retention. |
| 404 | voice_not_found | never | The referenced voice does not exist for this workspace. |
| 409 | conflict | never | Idempotency-Key reused with a different body, job in the wrong state, voice not ready, upload session not open. |
| 429 | rate_limited | never | rpm limit, per-key monthly minute cap, or workspace spend cap. Carries Retry-After. |
| 429 | queue_full | never | Only when an operator-configured per-workspace concurrent-job cap is reached (none by default — extra jobs are accepted and queue). Carries Retry-After. |
| 500 | separation_failed | never | The separation stage failed on this input. |
| 500 | quality_reject | never | The engine rejected its own output. |
| 400 | webhook_destination_blocked | never | The webhook destination is private, local, reserved, or otherwise prohibited. |
| 502 | provider_rejected | never | The GPU provider rejected the control request. |
| 502 | provider_auth_failed | never | The GPU provider rejected the configured credential. |
| 503 | provider_rate_limited | never | The GPU provider requested a deferred retry. |
| 503 | provider_degraded | never | The GPU circuit breaker is open after repeated provider failures. |
| 500 | internal | never | Something failed on our side. Retry once with backoff. |
| 501 | not_implemented | never | The surface exists but this action ships in a later release — do not retry. |
| 503 | oom_retry | never | Transient GPU memory pressure — safe to retry with backoff. |
| 504 | timeout | never | The job exceeded its processing deadline. |
The BILLED column is the taxonomy's per-class billable flag: today it is never for every class — a failed or refused call does not bill, period. Job failures appear as the structured failure object on the job.
Every response authenticated to an API-key quota bucket carries RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, and RateLimit-Policy. An unauthenticated 401 omits them; authenticate and retry. A 429 also carries Retry-After.
| CEILING | SCOPE | DEFAULT | ON HIT |
|---|---|---|---|
| Requests / minute | per key | plan rpm — 30 payg · 60 starter · 300 producer · 1000 scale (settable per key) | 429 rate_limited, short Retry-After |
| Monthly minutes | per key | none (set per key, with on_cap: block | overage) | block: 429 rate_limited, Retry-After = seconds to month end · overage: keeps converting and bills at the plan rate |
| Concurrent jobs | per workspace | no cap — extra jobs are accepted (queued) and become processing once handed to the GPU provider, including while they wait there for a free GPU worker; rpm, minute and spend caps still apply | never refused for concurrency by default · only an operator-configured cap returns 429 queue_full, short Retry-After |
| Monthly spend | per workspace | $50 (raiseable in settings; new workspaces carry a first-week ceiling) | 429 rate_limited, Retry-After = seconds to month end |
Failure posture (deliberate, documented): the rpm limiter fails open — if the limiter is unreachable, non-metered requests still work. Caps fail closed — a job-creating POST whose cap state cannot be verified is refused. Spend safety beats availability.
ceil(seconds × rate / 60).402 payment_required.| PLAN | PER MINUTE | MONTHLY | ANNUAL (per mo) | INCLUDED MIN | RPM |
|---|---|---|---|---|---|
| Pay as you go | $0.10 | $0 | $0 | 0 | 30 |
| Starter | $0.08 | $14 | $8 | 150 | 60 |
| Producer | $0.06 | $28 | $16 | 450 | 300 |
| Scale | $0.04 | $79 | $49 | 1800 | 1000 |
| PLAN | PRIVATE CLONING | AVAILABILITY |
|---|---|---|
| Pay as you go | $9 | $19 |
| Starter | $7 | $9 |
| Producer | $5 | $9 |
| Scale | $3 | $9 |
What is fixed today: outputs come back in the format you asked for — wav, mp3 or flac — at the same length and timing as the input, loudness-matched to the source with a gate and limiter in the render path.
What is not final yet: the numeric loudness target (LUFS), output sample-rate/bit-depth guarantees, and per-format encode settings are pinned by the GPU performance bench (plan item P1.11), which has not run on built images yet. This section will carry the exact numbers when the bench lands; until then, do not build to an assumed LUFS value.