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/api-reference/introduction.md, and every docs URL returns Markdown when requested with Accept: text/markdown.

Diffio API reference: base URL, auth and errors
Use this reference to integrate the Diffio API. Every endpoint speaks JSON over HTTPS at https://api.diffio.ai/.
Check your key with a first request (pip install diffio or npm install diffio). It lists your account's projects; see List projects for the response shape.
import os
from diffio import DiffioClient
key = os.environ["DIFFIO_API_KEY"]
client = DiffioClient(api_key=key)
page = client.projects.list()- URL base URL + resource path
- Header
Authorization: Bearer <apiKey> - Response
snake_caseJSON resource or page
API reference essentials
- Your code or SDK
GET · POST · PUT · DELETEresource path, Bearer key header - Success
200OK.201Created.202Accepted: the work continues in the background.JSONsnake_casefields for each resource - Error
4xx{"error": {...}}code,message,request_id, optionaldetails
- 1
Base URL and OpenAPI spec
Append each endpoint path to the production base URL.
https://api.diffio.ai/ v2 Fetch the machine-readable OpenAPI 3.1.0 specification at
GET https://api.diffio.ai/v2/openapi.json(public, no API key required).The API version is in the path; within it, changes only add. Releases and the versioning rules are in the Changelog.
- 2
Authentication
Send your API key in the
Authorizationheader on every non-public request. Create and manage keys on the API keys page in the developer dashboard.Authorization: Bearer <apiKey>
Each endpoint page lists the scope it requires (
projects:read,projects:write,generations:read,generations:write,artifacts:read,usage:read, orwebhooks:write). List models, Get a share, andGET /openapi.jsonare public and need no key. - 3
Request conventions
snake_caseJSON fieldsContent-Type: application/jsonIdempotency-KeyDiffio-End-UserlimitandcursorpaginationX-Request-Idresponse headerOPTIONSfor CORS preflight
- JSON bodies:
POSTandPUTcalls that take fields accept a JSON object ({...}) withsnake_casekeys such asfile_name,size_bytes, andpreview_seconds. Idempotency-Key: Optional header (up to 255 characters) honoured on Create a project, Create a generation, and Edit a generation's transcript. Repeating the same request returns the original resource without charging twice; changing any body field returns409with codeidempotency_key_conflict. Both SDKs send anIdempotency-Keyautomatically when you omit one.Diffio-End-User: Optional header (up to 128 characters) for multi-tenant apps. Requests carrying this header assign new projects to thatend_userand scope project reads, generations, shares, and Get usage reports to that end user. Omit it on account-wide calls such as Open the webhook portal.- Cursor pagination: List projects and List a project's generations return
{"object": "list", "data": [...], "next_cursor": "..."}newest first. Passlimit(1to100, default20) and passnext_cursorascursoruntilnext_cursorisnull.
Uploads, playback URLs, and models
- Create a project returns
upload.requests(start,partin 32 MiB chunks,complete, andabort) authenticated withAuthorization: Bearer {upload.upload_token}(valid for 24 hours). Files can be up to 2 GB (2,147,483,648bytes) with no media length limit. Call Complete a project's upload for immediate readiness, or let the upload edge report completion after about 30 seconds. Both official SDKs handle multipart uploads and retries automatically. - Get a playback grant returns signed media URLs in
files(audio,video,hls_master,transcript,stems_manifest,original, and waveforms) valid for 6 hours untilexpires_at, with no API key required. Append?download=<filename>to a media URL to trigger a browser file download. - List models returns hosted models (
diffio-4.7-flashat $5/hour anddiffio-4.7-proat $10/hour), rolling tier aliases (diffio-flashanddiffio-pro), and retired model names. Retired model names run on the current hosted model of the same tier (substituted: true) at the lower of the two list prices (Models).
- 4
Error responses
Every 4xx and 5xx response returns one JSON shape:
error.code(stablesnake_caseidentifier to branch on),error.message,error.request_id(also sent in theX-Request-Idheader), and an optionalerror.detailsobject when structured context applies.Error response shape{ "error": { "code": "unknown_model", "message": "nope is not a Diffio model. See GET /v2/models.", "request_id": "f064e4099097414da3fb5b37684ab1bb", "details": { "field": "model", "models": [ "diffio-4.7-flash", "diffio-4.7-pro", "diffio-flash", "diffio-pro" ] } } }Common error codes
Status and codeWhen it happens 400Bad request.invalid_field·missing_fieldMalformed JSON ( invalid_json), missing or invalid body field (details.field), bad query parameter (invalid_parameter,details.parameter), oversized header (invalid_header), or unknown model (unknown_model).401Unauthorized: the API key is missing or invalid.missing_api_key·invalid_api_keyNo API key was sent, or the API key was not recognized. 403Forbidden: the key lacks permission.permission_deniedThe key is inactive, lacks the required scope, or sent Diffio-End-Userto an account-only route.404Not found.*_not_foundUnknown resource for this account or end user ( project_not_found,generation_not_found,export_not_found,share_not_found,transcript_not_found,route_not_found).405Client error.method_not_allowedThe path exists, but does not accept this HTTP method; check the Allowheader.409Conflict: see error.code for which one.not_ready·not_available·revision_conflictState conflict: prerequisite still running ( not_ready), permanently unavailable (not_available), stale save revision (revision_conflict,details.current_revision), or reusedIdempotency-Keywith a different body (idempotency_key_conflict).413Payload too large.upload_too_large·415Client error.unsupported_media_typeFile exceeds 2 GB ( upload_too_large), draft JSON exceeds 900,000 bytes (transcript_draft_too_large), or file extension/MIME type is not supported audio or video (unsupported_media_type).429Too many requests.rate_limitedToo many requests of this kind in a short time (for example, more than 10 assistant feedback reports in an hour); retry later with backoff, honouring Retry-Afterwhen sent.500Server error.internal_error·503Service unavailable.unavailableA transient server error occurred ( internal_error,generation_start_failed,unavailable); retry with exponential backoff.Every code, with its retry rule and the codes a failed resource reports: Errors.
Billing error codes (
402)Status and codeMeaning What to do 402Payment required: see error.code for the billing problem.insufficient_creditYour API credit is used up, or cannot cover this file. Add credit on the Billing page. 402Payment required: see error.code for the billing problem.needs_payment_methodThe credit is used up, or cannot cover this file, and no payment method is saved. Add a payment method on the Billing page. 402Payment required: see error.code for the billing problem.payment_failedA payment for API usage failed, or the last invoice of ended card billing is unpaid. On the Billing page, select Update payment method and choose a card for your subscription, or Pay invoice once card billing has ended. 402Payment required: see error.code for the billing problem.usage_limit_reachedUnbilled usage reached $100; it is being charged now. Wait for the charge to complete; the API continues as soon as it does. needs_payment_method,payment_failedandusage_limit_reachedreach only accounts with card billing (a card added before prepaid credit).Example 402 responses and billing details
402 insufficient_credit{ "error": { "code": "insufficient_credit", "message": "This file needs about $1.25 of API credit and your balance is $0.40. Add credit in the developer dashboard to continue.", "request_id": "f064e4099097414da3fb5b37684ab1bb", "details": { "estimated_cost_cents": 125, "remaining_credit_cents": 40 } } }402 payment_failed{ "error": { "code": "payment_failed", "message": "A payment for API usage failed. On the developer dashboard's Billing page, select Update payment method and choose a card for your subscription.", "request_id": "f064e4099097414da3fb5b37684ab1bb" } }402 payment_failed, card billing ended{ "error": { "code": "payment_failed", "message": "The last invoice of your API card billing is unpaid. Pay it from the developer dashboard's Billing page to continue.", "request_id": "f064e4099097414da3fb5b37684ab1bb" } }402 usage_limit_reached{ "error": { "code": "usage_limit_reached", "message": "Your unbilled API usage reached $100.00. It is being billed to your payment method now, and the API continues as soon as that payment completes.", "request_id": "f064e4099097414da3fb5b37684ab1bb" } }An
insufficient_creditorneeds_payment_methodrefusal from a credit check includesdetails.estimated_cost_centsanddetails.remaining_credit_cents; treatdetailsas optional. A generation created before its upload finishes is checked again when processing starts, and fails with the same error code ingeneration.error.codeif credit cannot cover the recording. Billing explains credit and card billing. - 5
Rate limits
No general per-key quota: Most endpoints set no per-key request limit; when workers are busy, generations wait in a queue (see
queueon Get a generation). A few actions have their own limits, per end user (or per account withoutDiffio-End-User):- Ask the edit assistant: up to 30 turns per 10 minutes plus a daily cap; a turn over the limit ends
failedwitherror.coderate_limited. - Send assistant feedback: up to 10 reports per hour; more answer
429Too many requests.rate_limited.
Treat any
429as "retry later with backoff"; both SDKs do this for calls that are safe to repeat and honourRetry-After. Usage is billed per second (API pricing). - Ask the edit assistant: up to 30 turns per 10 minutes plus a daily cap; a turn over the limit ends
Endpoints
Browse all 30 endpoints across 8 categories: models, projects, generations, separated tracks, transcripts, shares, usage, and webhooks.
Models
1 endpoint
| Endpoint, method and path | What it does |
|---|---|
List modelsGET / | List every hosted model, tier alias, and retired model name with hourly list pricing. |
Projects
6 endpoints
| Endpoint, method and path | What it does |
|---|---|
Create a projectPOST / | Create a project for one audio or video file and receive multipart upload instructions. |
List projectsGET / | List projects on the account newest first with cursor pagination. |
Get a projectGET / | Retrieve one project's upload status, media metadata, and latest generation. |
Delete a projectDELETE / | Delete a project and all of its stored uploads, generations, exports, and shares. |
Get new upload instructionsPOST / | Mint fresh 24-hour multipart upload instructions for a project awaiting its file. |
Complete a project's uploadPOST / | Verify and prepare a finished multipart upload immediately instead of waiting for edge callback. |
Generations
6 endpoints
| Endpoint, method and path | What it does |
|---|---|
Create a generationPOST / | Start a speech restoration generation on a project with a chosen model. |
List a project's generationsGET / | List every restore and transcript edit generation on a project, newest first. |
Get a generationGET / | Check one generation's status, live stage progress, queue position, available files, or failure reason. |
Get a playback grantGET / | Mint 6-hour signed playback and download URLs for a generation's audio, video, HLS, stems, and transcript files. |
Estimate a transcript editPOST / | Estimate the changed word runs, 30-second windows, and maximum billable seconds of a Pro transcript edit. |
Edit a generation's transcriptPOST / | Edit a finished Pro generation's transcript and re-restore only the windows around changed words. |
Separated tracks
4 endpoints
| Endpoint, method and path | What it does |
|---|---|
Get the saved mixGET / | Read the saved background gain, speech leveling setting, and revision for a generation's separated tracks. |
Save the mixPUT / | Save the background track gain and speech leveling setting for a generation's separated tracks. |
Create an exportPOST / | Render a downloadable or inline-playable file from a generation's separated speech and background tracks. |
Get an exportGET / | Poll an export's render status and mint a fresh 6-hour download or playback URL once ready. |
Transcripts
7 endpoints
| Endpoint, method and path | What it does |
|---|---|
Get a generation's transcriptGET / | Retrieve a generation's normalized word-timed transcript for display, assistant turns, or Pro edits. |
Get the transcript draftGET / | Read the saved JSON editor draft and compare-and-swap revision for a generation's transcript. |
Save the transcript draftPUT / | Save an editor's JSON draft state (up to 900,000 bytes) for a generation's transcript. |
Delete the transcript draftDELETE / | Delete a generation's saved transcript editor draft with optional revision checking. |
Ask the edit assistantPOST / | Start an asynchronous edit-assistant chat turn on a finished Pro generation's transcript. |
Get an edit assistant turnGET / | Poll an edit-assistant turn for its reply, word-level edit proposals, moments, or failure details. |
Send assistant feedbackPOST / | Send the Diffio team a bug report or an idea about the edit assistant, with the conversation if wanted. |
Shares
4 endpoints
| Endpoint, method and path | What it does |
|---|---|
Publish a project's sharePUT / | Publish or update a project's public playback share, optionally pinned to one generation or preview length. |
Get a project's shareGET / | Read a project's currently published share and its playback URLs using your API key. |
Revoke a project's shareDELETE / | Revoke a project's published share so its public share ID and media URLs stop working. |
Get a shareGET / | Fetch a published share's playback metadata and signed media URLs without an API key. |
Usage
1 endpoint
| Endpoint, method and path | What it does |
|---|---|
Get usageGET / | Report generation counts, billable seconds, and USD list-price usage in total and by model. |
Webhooks
1 endpoint
| Endpoint, method and path | What it does |
|---|---|
Open the webhook portalPOST / | Create a short-lived login link to the hosted webhook portal to manage endpoints and secrets. |