For AI agents: every API docs page in one plain-text file is at /docs/llms-full.txt, and the documentation index is at /llms.txt. This page is available as Markdown at https://diffio.ai/docs/developers/full-api-guide.md, and every docs URL returns Markdown when requested with Accept: text/markdown.

Full API guide: workflow, topics and limits
The Diffio API on one page: the workflow, where each topic lives, and the rules and limits that apply to every call.
Workflow
Create a project with a media file, run one or more generations with different models, then download the results.
- 1Create projectwith your audio or video file
- 2Generations
diffio-4.7-flashdiffio-4.7-pro - 3Download resultsrestored audio, video or transcript
Create a project, upload the file, run one or more generations, then read their media. A webhook tells your server when each one finishes.
Topics
Start and build
- Quickstart: Key, install and a restore in one call, Python or Node.
- Podcast cleanup in a SaaS app: Browser uploads, one end user per customer, signed webhooks.
- All use-case guides: Video streaming, Flash vs Pro, bulk restores, transcript edits, tracks, shares and billing.
- Webhooks: Events, signatures, retries and the webhook portal.
Concepts
- Projects and uploads: A project holds one uploaded recording; its status moves from awaiting_upload to ready as the file arrives.
- Generations: A generation is one restore of a project with one model; follow its status and stage, then read its media.
- Transcripts and edits: Every generation has a word-timed transcript; change its words on a Pro result and Diffio restores the changed parts again.
- Separated tracks: Each restore separates speech from background; save a balance of the two and render it as a downloadable export.
- Shares: A share is a revocable public link to one project's result that anyone with its id can play without an API key.
- End users: Send Diffio-End-User with each request to keep every customer's projects, usage and events apart under one API key.
Limits
| Limit | Value |
|---|---|
| File size | up to 2 GB (2,147,483,648 bytes); larger is 413 upload_too_large |
| Media length | no limit |
| Upload part size | 32 MiB (33,554,432 bytes) |
| Upload token | 24 hours (upload.expires_at) |
| Media URLs | 6 hours (expires_at); call GET …/media again |
| Share URLs | until the share is revoked or changed, then stop within about a minute |
| Webhook timestamp tolerance | 300 seconds |
| Restore billing | whole seconds, 60 second minimum per restore |
| Transcript edit billing | 30 seconds per restored window, no minimum |
| Idempotency-Key | up to 255 characters |
| Diffio-End-User | up to 128 characters |
| Generation label | up to 120 characters |
| metadata | 50 keys; keys up to 40 characters, values up to 500 |
| List page | limit 1 to 100, default 20 |
| Usage period | up to 366 days and 20,000 generations |
| Rate limits | no general per-key quota; the edit assistant allows 30 turns per 10 minutes plus a daily cap, assistant feedback 10 per hour; 429 rate_limited means retry with backoff |
| SDK defaults | 60 second timeout; 2 retries on 408, 429, 5xx and network errors, honouring Retry-After |
Pagination
GET /projects and GET /projects/{project_id}/generations answer newest first with { object: "list", data, next_cursor }. Pass next_cursor as cursor until it is null; the SDKs can walk every page for you.
- GET
/projects? limit=20 data[]newest first,next_cursor - GET
/untilprojects? cursor={next_ cursor} next_cursorisnull - Next/
projects/ with a project's{project_ id}/ generations id
from diffio import DiffioClient
client = DiffioClient() # reads DIFFIO_API_KEY
page = client.projects.list(limit=20)
print([project.id for project in page.data], page.next_cursor)
for project in client.projects.iter(limit=50): # fetches every page as needed
latest = project.latest_generation
print(project.id, project.file_name, latest.status if latest else "no generation")Idempotency
POST /projects (per account and end user), POST …/generations (per project) and POST …/edits (per edited generation) honour Idempotency-Key. The SDKs send a fresh key when you pass none, so their own retries never create twice; pass your own (an order or job id) when your queue may retry from a new process.
- POST/
projects id - POST
/projects/ {project_ id}/ generations id - GET/
projects/ {project_ id}/ generations/ {generation_ id} status - GET/
projects/ {project_ id}/ generations/ {generation_ id}/ media files
Replays and conflicts, case by case
- First request
201Created. new generation - Same
Idempotency-Key, same body201Created. the same generationid - Same
Idempotency-Key, othermodel,samplingorlabel409Conflict: see error.code for which one.idempotency_key_conflict
- Same
Idempotency-Key+ same body201Created. with the existing resource, never billed twice - Same
Idempotency-Key+ different body409Conflict: see error.code for which one.idempotency_key_conflict
# The same key on a retry returns the same generation and bills it once.
generation = client.generations.create(
project_id,
model="diffio-pro",
idempotency_key="order-1042-restore",
)End users
Send Diffio-End-User to act for one of your customers: their projects, usage and events stay apart under one API key. How it works and its limits: End users.
customer_client = DiffioClient(end_user="customer-42") # every call acts for this end user
customer_projects = customer_client.projects.list()
# Or scope a single call on an account-wide client:
customer_usage = client.usage.get(end_user="customer-42")Errors
Every failure answers { "error": { "code", "message", "request_id", "details" } }. The common ones and their fixes are below; every code is on Errors.
401Unauthorized: the API key is missing or invalid.403Forbidden: the key lacks permission.PassAuthorization: Bearer <key>with an active key that has Write permission.The key is missing (
missing_api_key), invalid (invalid_api_key), inactive, or lacks Write permission (permission_denied).402Payment required: see error.code for the billing problem.insufficient_creditAdd credit on the Billing page of the developer dashboard.Your API credit is used up, or cannot cover the file.
402Payment required: see error.code for the billing problem.needs_payment_methodAdd a payment method in the developer dashboard.Accounts with card billing only: the credit is used up, or cannot cover the file, and no payment method is saved.
402Payment required: see error.code for the billing problem.payment_failedOn the Billing page, select Update payment method and choose a card for your subscription, or Pay invoice once card billing has ended.A payment for API usage failed, or the last invoice of ended card billing is unpaid. API usage is blocked until that invoice is paid. Accounts with card billing only.
402Payment required: see error.code for the billing problem.usage_limit_reachedWait for the charge to complete; the API continues as soon as it does.Unbilled usage reached $100; it is being charged now. Accounts with card billing only.
409Conflict: see error.code for which one.not_readyPoll the generation untilstatusiscomplete, or finish uploading first.The generation, transcript, or separated tracks are still processing (
not_ready), orupload/completeran before the upload arrived (upload_missing).404Not found.transcript_not_foundCheckerror.codeand confirm anyDiffio-End-Userheader matches the project.This generation has no transcript, or the project or generation id does not exist for this end user (
project_not_found,generation_not_found).