REST API
All endpoints take and return JSON. Authenticate with Authorization: Bearer <API key or OAuth access token> (see Authentication).
| Method and path | Does |
|---|---|
POST /v1/ai/transcript | Fetch a transcript, continue a pending one or read the next page |
GET /v1/ai/account | Plan, credits and free transcripts left today |
POST /v1/ai/uploads | Start a private file upload |
POST /v1/ai/uploads/{id}/complete | Finish an upload after sending its bytes |
GET /v1/ai/uploads/{id} | Check an upload's verification |
POST /v1/ai/podcasts/discover | Find a podcast feed's episodes and publisher transcripts |
GET /v1/ai/podcasts/discover/{id} | Check a podcast discovery |
GET /v1/me | Your user profile and workspaces |
GET /v1/ai/library · POST /v1/ai/library | List saved sources (query, kind, status, cursor, limit) · save 1–20 urls |
GET /v1/ai/library/{id} · DELETE /v1/ai/library/{id}?confirm=true | Read one saved source · delete it |
GET /v1/ai/projects · POST /v1/ai/projects | List projects · create one from 2–20 sources |
GET /v1/ai/projects/{id} · PATCH … · DELETE …?confirm=true | Read, rename or delete a project |
POST /v1/ai/projects/{id}/sources · DELETE …/sources/{source_id} | Add or remove project sources |
GET /v1/ai/publish-destinations | Connected accounts, Telegram chats and WordPress sites |
POST /v1/ai/posts · GET /v1/ai/posts · GET /v1/ai/posts/{id} | Publish or schedule text (confirm: true) · list deliveries · read one post |
POST /v1/ai/post-deliveries/{id}/reschedule · …/cancel | Move or cancel a scheduled delivery (confirm: true) |
Requests time out after 15 seconds. A transcript call waits up to about 10 seconds for a running job, then returns "pending" for you to poll.
POST /v1/ai/transcript
Send exactly one of these:
| Field | Meaning |
|---|---|
url | A YouTube video, article or public document (for example a PDF) URL |
media_url | A public video or audio page outside the known sources, to try native media discovery. A match doesn't guarantee media or captions. |
id | The id from an earlier answer: continue a pending item, or read another page |
upload_id | A verified upload (see Uploads) |
podcast | {"feed_url": "...", "episode_guid": "..."}, chosen from a podcast discovery |
Optional fields:
| Field | Default | Meaning |
|---|---|---|
format | text | text (inline [mm:ss] timestamps when timed), segments (structured timings) or srt (subtitles; timed transcripts only) |
cursor | – | next_cursor from the previous page. Send it with id. |
poll_only | false | With id: continue the current attempt without starting a new one if it failed |
allow_paid_transcription | false | Agree to paid speech-to-text when there are no captions. Set it only after the user agrees to the quoted cost. Not allowed with podcast. |
allow_image_ocr | false | Agree to paid AI text reading for an uploaded image or scanned PDF |
Unknown fields are rejected.
Ready: 200
{
"id": "0192f3c4-5b6a-7c8d-9e0f-112233445566",
"status": "ready",
"source": {
"title": "Video title",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"kind": "youtube",
"duration_sec": 213
},
"language": "en",
"transcript_source": "captions",
"transcript_source_verified": true,
"content": "[00:00] ...",
"next_cursor": "…",
"library_url": "https://<your TubeOnAI address>/library/0192f3c4-…"
}sourceappears on the first page only.kindisyoutube,article,pdfortext. Podcasts, uploads and other documents reporttext.transcript_sourceiscaptions,textorstt. It describes how the text was produced only whentranscript_source_verifiedistrue. Some older items reportfalse.contentholds the page fortextandsrt. Withsegments, asegmentsarray replaces it, with items{start_ms, end_ms, speaker, text}.- Pages hold about 15,000 tokens. Fetch the next page with
{"id": "...", "cursor": "<next_cursor>"}.next_cursorisnullon the last page.
Pending: 202
{
"id": "0192f3c4-5b6a-7c8d-9e0f-112233445566",
"status": "processing",
"reason": null,
"retry_after_sec": 5,
"eta_sec": 60
}status is processing (fetching or transcribing now) or waiting (waiting for something outside TubeOnAI, such as a premiere or captions that aren't published yet; reason explains). Wait retry_after_sec, then call again with {"id": "...", "poll_only": true}. Don't resend the original url.
Retrying a failure
A failed attempt returns an error. For most failures with retryable: true, a call with the same url or id, without poll_only, starts a new attempt. A new attempt counts against your daily allowance again.
These codes come with retryable: true but are not restarted by an API or MCP call. Calling again returns the same failure without starting work:
| Code | Meaning |
|---|---|
PROVIDER_AUTH, PROVIDER_QUOTA, GATEWAY_REJECTED | An outage at an upstream service |
CLAIM_TIMEOUT | Processing could not start in time |
UNKNOWN | An unexpected failure |
Don't loop on them. Tell the user, and retry later with Retry on the item in the web library (library_url). That keeps agents from using up the daily allowance during an outage.
No captions
If a video has no captions and paid transcription is on, the call returns 409 STT_CONSENT_REQUIRED:
{
"error": {
"code": "STT_CONSENT_REQUIRED",
"message": "This has no captions. Transcribing the audio costs about 32 credits and takes about 2 min. …",
"retryable": false,
"action": null,
"retry_after_sec": null,
"details": {"id": "0192f3c4-…", "estimate_credits": 32, "eta_sec": 120},
"request_id": "…"
}
}Only if the user agrees, call again with allow_paid_transcription: true and the same url or details.id. For an uploaded audio or video file, details holds upload_id (with estimate_credits and eta_sec) instead of id. Call again with the same upload_id and allow_paid_transcription: true. If paid transcription is off on the server, you get 422 STT_UNAVAILABLE instead, and calling again won't help. See Credits and limits.
GET /v1/ai/account
{
"email": "you@example.com",
"plan": "free",
"credits_left": 1200,
"free_transcripts_left_today": 47,
"resets_at": "2026-11-05T00:00:00Z"
}plan is your plan ID, or free with no plan. credits_left is the workspace's spendable credits (credits held for running work aren't included). resets_at is the next UTC midnight. This call never spends anything.
Uploads
Send a private file in four steps. TubeOnAI never takes a local path or base64.
-
Create.
POST /v1/ai/uploadswith a uniqueIdempotency-Keyheader. Reuse that key only to retry the same request.{"declared_size_bytes": 482133, "content_type": "application/pdf", "original_filename": "report.pdf", "expected_sha256": null}It returns
201with{id, expires_at_ms, grant: {upload_url, headers, object_key, expires_at_ms}}. -
Send the bytes.
PUTthe file togrant.upload_urland include every header ingrant.headers. SetContent-Lengthto the declared size andContent-Typeto the declared type. Don't send your TubeOnAI token to the storage URL. The grant expires. -
Complete.
POST /v1/ai/uploads/{id}/completereturns202and starts verification. -
Check.
GET /v1/ai/uploads/{id}returns the upload withready,failure_reasonandretry_after_sec. Waitretry_after_secand check again until it is0. That happens whenreadyistrue, or when verification failed or was cancelled (job_statusisfailedorcancelled;failure_reasonsays why).
Then call POST /v1/ai/transcript with {"upload_id": "<id>"}. Continue pending answers and pages with the returned library id, not the upload_id.
- Documents (PDF, DOCX, PPTX, text and others the server enables) are read as text at no credit cost.
- Audio and video need
allow_paid_transcription: true. Without it, the transcript call returns409 STT_CONSENT_REQUIREDwithdetails.upload_id. PNG/JPEG images or scanned PDFs needallow_image_ocr: true. Both cost credits and may be off on the server. - A scanned PDF fails with
SOURCE_UNSUPPORTED_FORMATwhen image text reading is off on the server. Public PDF links never use image text reading. - Server limits apply. By default, media is limited to 512 MiB and 60 minutes, and images to 10 MiB and 20 megapixels.
Podcasts
TubeOnAI reads only transcripts the publisher provides. It never transcribes podcast audio.
Podcast transcripts can be switched off on a server. Then discovery returns 503 SERVICE_UNAVAILABLE with "Podcast transcripts are not enabled on this server." Calling again won't help until the server turns them on.
POST /v1/ai/podcasts/discoverwith anIdempotency-Keyheader and{"url": "<RSS feed or episode page>"}. It returns202with{id, status, retry_after_sec, discovery, failure_reason}.- While
statusisprocessing, pollGET /v1/ai/podcasts/discover/{id}. - Choose one feed and episode from
discovery, then callPOST /v1/ai/transcriptwith{"podcast": {"feed_url": "...", "episode_guid": "..."}}.
An episode without a publisher transcript fails with SOURCE_TRANSCRIPT_UNAVAILABLE. Discovery costs nothing.
GET /v1/me
{
"user": {"id": "…", "email": "you@example.com", "display_name": "Ada", "avatar_url": null},
"workspace_id": "…",
"workspaces": [{"id": "…", "name": "Personal", "kind": "personal", "role": "owner"}]
}workspace_id is the workspace this call acted in, which is your token's workspace.
Library, projects and publishing
The same services the MCP tools use (see MCP). POST /v1/ai/library reports a URL whose item already failed instead of restarting it. GET /v1/ai/posts pages with cursor/limit. Project changes, library deletion and post creation need an Idempotency-Key header; reuse it only to retry that request. Reschedule and cancel take the delivery's expected_revision instead. Deleting and publishing, rescheduling or cancelling a post need confirm (?confirm=true on DELETE, "confirm": true in the body otherwise), sent only after the user's yes. Without it the request changes nothing and fails with 409 CONFIRMATION_REQUIRED. An OAuth token without the library:write or publish scope gets 403 INSUFFICIENT_SCOPE with details.required_scope.
Errors
Every error from these endpoints uses one envelope:
{
"error": {
"code": "RATE_LIMITED",
"message": "You've used all 50 free transcripts for today. They reset at midnight UTC; upgrade for more at https://<your TubeOnAI address>/settings.",
"retryable": true,
"action": "upgrade",
"retry_after_sec": 30512,
"request_id": "…"
}
}| Field | Meaning |
|---|---|
code | A stable code in upper case, such as RATE_LIMITED or SOURCE_PRIVATE. Branch on this, not on message. |
message | Plain English you can show to the user |
retryable | true if trying again later may work |
action | sign_in, upgrade, retry or null: what the user can do |
retry_after_sec | When set, wait this long before trying again |
details | Extra facts for some codes, such as estimate_credits for STT_CONSENT_REQUIRED |
request_id | Quote it when you contact support |
Common codes:
| HTTP | code | Meaning |
|---|---|---|
| 400 | BAD_REQUEST | Invalid body, or not exactly one of url, media_url, id, upload_id, podcast |
| 400 | SOURCE_UNSUPPORTED_URL | The link isn't a supported source |
| 401 | UNAUTHENTICATED | Missing, invalid, revoked or expired token, or a bearer token on a route that doesn't accept one |
| 402 | INSUFFICIENT_CREDITS | Not enough credits for paid transcription or image reading. action is upgrade. |
| 404 | NOT_FOUND | Unknown item or upload, or a workspace your token doesn't belong to |
| 409 | STT_CONSENT_REQUIRED | No captions. details quotes the cost. Ask the user first. |
| 409 | CONFLICT | For example, an upload that is still being verified (retry_after_sec is set) |
| 422 | SOURCE_PRIVATE, SOURCE_NOT_FOUND, SOURCE_BLOCKED, SOURCE_TRANSCRIPT_UNAVAILABLE, STT_UNAVAILABLE, NO_TRANSCRIPT, … | The source can't be processed. retryable says whether a new attempt may help. |
| 429 | RATE_LIMITED | Daily free transcript allowance used up. retry_after_sec counts down to UTC midnight. |
| 503 | SERVICE_UNAVAILABLE | AI tools are turned off (retryable: false); podcast transcripts are turned off on this server (see the message; don't retry); or the service is busy or a dependency is down (retryable: true) |