TubeOnAITubeOnAIDevelopers
Skip to Content
TubeOnAITubeOnAIDevelopers
REST API

REST API

All endpoints take and return JSON. Authenticate with Authorization: Bearer <API key or OAuth access token> (see Authentication).

Method and pathDoes
POST /v1/ai/transcriptFetch a transcript, continue a pending one or read the next page
GET /v1/ai/accountPlan, credits and free transcripts left today
POST /v1/ai/uploadsStart a private file upload
POST /v1/ai/uploads/{id}/completeFinish an upload after sending its bytes
GET /v1/ai/uploads/{id}Check an upload's verification
POST /v1/ai/podcasts/discoverFind a podcast feed's episodes and publisher transcripts
GET /v1/ai/podcasts/discover/{id}Check a podcast discovery
GET /v1/meYour user profile and workspaces
GET /v1/ai/library · POST /v1/ai/libraryList saved sources (query, kind, status, cursor, limit) · save 1–20 urls
GET /v1/ai/library/{id} · DELETE /v1/ai/library/{id}?confirm=trueRead one saved source · delete it
GET /v1/ai/projects · POST /v1/ai/projectsList projects · create one from 2–20 sources
GET /v1/ai/projects/{id} · PATCH … · DELETE …?confirm=trueRead, rename or delete a project
POST /v1/ai/projects/{id}/sources · DELETE …/sources/{source_id}Add or remove project sources
GET /v1/ai/publish-destinationsConnected 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 · …/cancelMove 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:

FieldMeaning
urlA YouTube video, article or public document (for example a PDF) URL
media_urlA public video or audio page outside the known sources, to try native media discovery. A match doesn't guarantee media or captions.
idThe id from an earlier answer: continue a pending item, or read another page
upload_idA verified upload (see Uploads)
podcast{"feed_url": "...", "episode_guid": "..."}, chosen from a podcast discovery

Optional fields:

FieldDefaultMeaning
formattexttext (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_onlyfalseWith id: continue the current attempt without starting a new one if it failed
allow_paid_transcriptionfalseAgree 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_ocrfalseAgree 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-…"
}
  • source appears on the first page only. kind is youtube, article, pdf or text. Podcasts, uploads and other documents report text.
  • transcript_source is captions, text or stt. It describes how the text was produced only when transcript_source_verified is true. Some older items report false.
  • content holds the page for text and srt. With segments, a segments array 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_cursor is null on 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:

CodeMeaning
PROVIDER_AUTH, PROVIDER_QUOTA, GATEWAY_REJECTEDAn outage at an upstream service
CLAIM_TIMEOUTProcessing could not start in time
UNKNOWNAn 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.

  1. Create. POST /v1/ai/uploads with a unique Idempotency-Key header. 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 201 with {id, expires_at_ms, grant: {upload_url, headers, object_key, expires_at_ms}}.

  2. Send the bytes. PUT the file to grant.upload_url and include every header in grant.headers. Set Content-Length to the declared size and Content-Type to the declared type. Don't send your TubeOnAI token to the storage URL. The grant expires.

  3. Complete. POST /v1/ai/uploads/{id}/complete returns 202 and starts verification.

  4. Check. GET /v1/ai/uploads/{id} returns the upload with ready, failure_reason and retry_after_sec. Wait retry_after_sec and check again until it is 0. That happens when ready is true, or when verification failed or was cancelled (job_status is failed or cancelled; failure_reason says 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 returns 409 STT_CONSENT_REQUIRED with details.upload_id. PNG/JPEG images or scanned PDFs need allow_image_ocr: true. Both cost credits and may be off on the server.
  • A scanned PDF fails with SOURCE_UNSUPPORTED_FORMAT when 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.

  1. POST /v1/ai/podcasts/discover with an Idempotency-Key header and {"url": "<RSS feed or episode page>"}. It returns 202 with {id, status, retry_after_sec, discovery, failure_reason}.
  2. While status is processing, poll GET /v1/ai/podcasts/discover/{id}.
  3. Choose one feed and episode from discovery, then call POST /v1/ai/transcript with {"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": "…"
  }
}
FieldMeaning
codeA stable code in upper case, such as RATE_LIMITED or SOURCE_PRIVATE. Branch on this, not on message.
messagePlain English you can show to the user
retryabletrue if trying again later may work
actionsign_in, upgrade, retry or null: what the user can do
retry_after_secWhen set, wait this long before trying again
detailsExtra facts for some codes, such as estimate_credits for STT_CONSENT_REQUIRED
request_idQuote it when you contact support

Common codes:

HTTPcodeMeaning
400BAD_REQUESTInvalid body, or not exactly one of url, media_url, id, upload_id, podcast
400SOURCE_UNSUPPORTED_URLThe link isn't a supported source
401UNAUTHENTICATEDMissing, invalid, revoked or expired token, or a bearer token on a route that doesn't accept one
402INSUFFICIENT_CREDITSNot enough credits for paid transcription or image reading. action is upgrade.
404NOT_FOUNDUnknown item or upload, or a workspace your token doesn't belong to
409STT_CONSENT_REQUIREDNo captions. details quotes the cost. Ask the user first.
409CONFLICTFor example, an upload that is still being verified (retry_after_sec is set)
422SOURCE_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.
429RATE_LIMITEDDaily free transcript allowance used up. retry_after_sec counts down to UTC midnight.
503SERVICE_UNAVAILABLEAI 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)

On this page