Documentation

Guides and API reference for uploads, image transforms and video.

npm install @cd2/fileboy-react
API https://api.fileboy.io

Translated captions

Subtitles in other languages without paying for human translation: translate any caption track into as many languages as you need. OpenAI translates the words, and the new tracks are marked machine-translated.

Needs the AI add-on (£9/month with 375 AI credits, then 2.5p a credit). Without it, starting this answers 402 ai_addon_required and automatic runs are skipped; anything already made stays. Cost in AI credits: translated captions: 10 credits per million tokens sent, 50 per million written (about 0.4 credits a language for a 30 minute video). See the AI add-on.

What it does

Pick one of a video's caption tracks (one you uploaded or wrote, or an auto-generated one) and the languages you want. For each language Fileboy:

  • sends the track's caption text to OpenAI, in batches of cues, each with an id, up to 4 batches at once (one at a time when a failed translation is tried again). The times are never sent;
  • checks the answer has the same cues, in the same order, before using it. One that doesn't is asked for again, and if it still doesn't match the translation fails and nothing is changed;
  • stores a new caption track in that language, with the source's cue timing lines copied as they were written, so every cue starts and ends exactly when the source's does, and only the words are different. Cue identifiers and settings (position, alignment) are kept; inline tags such as italics and speaker names are not carried over;
  • marks the track machine-translated. The player labels it Français (machine-translated) in its caption menu, and the transcript panel follows it like any language;
  • sends a video.captions_translated webhook.
1
2
3
4
5
WEBVTT

intro
00:00:00.500 --> 00:00:02.000 align:start
Hello and welcome to the demo.
1
2
3
4
5
6
7
WEBVTT

NOTE Machine-translated from en to fr by OpenAI gpt-6-luna. Check it before relying on it.

intro
00:00:00.500 --> 00:00:02.000 align:start
Bonjour et bienvenue dans la démo.

Translate a track

In the dashboard, open the video's Captions & AI tab and use Translated captions: choose the track, choose languages (or type any code, like fr-CA) and translate. Each language shows Queued, Translating and then Done a minute or so later. From your server, with the private key (or a scoped key with videos:write to translate and videos:read to look):

// translate a caption track (uploaded or auto-generated) into two languages (private key, or videos:write)
const [fr, pt] = await fileboy.translateCaptions(video.id, track.id, ["fr", "pt-BR"])
fr.status // "pending"; video.captions_translated is sent when it is made

// where each translation is, and whether its source has changed since
const { translations } = await fileboy.listCaptionTranslations(video.id)
translations[0].status // "done"
translations[0].trackId // the machine-translated caption track players show
translations[0].stale // true when the source captions changed: translate again to update it
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "data": {
    "translations": [
      {
        "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
        "videoId": "9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10",
        "sourceTrackId": "5e0c7a12-3d4b-4f6a-9e21-8c7b6a5d4e3f",
        "sourceLanguage": "en",
        "language": "fr",
        "status": "done",
        "message": null,
        "reason": "request",
        "trackId": "c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f",
        "trackUrl": "https://api.fileboy.io/videos/9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10/transcripts/c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f",
        "trackEdited": false,
        "stale": true,
        "model": "gpt-6-luna",
        "cues": 48,
        "characters": 2310,
        "queuedAt": "2026-11-18T03:00:00Z",
        "translatedAt": "2026-11-18T03:00:40Z"
      }
    ],
    "available": true,
    "maxLanguages": 10,
    "autoLanguages": []
  }
}

POST /videos/:id/transcripts/:transcriptId/translate takes languages (language codes, up to 20 at a time) and answers 202 at once with a translation per language, pending. GET /videos/:id/translations lists them all, and GET /videos/:id/translations/:translationId gets one. status is pending, processing, done, failed or skipped (the track has no words, is too long, or was deleted before it ran); message says why. Asking again for a language that is queued leaves it as it is.

The video's public data marks the track, so players and pages can label it:

1
2
3
4
"transcripts": [
  { "id": "5e0c7a12-3d4b-4f6a-9e21-8c7b6a5d4e3f", "language": "en", "autoGenerated": true, "machineTranslated": false },
  { "id": "c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f", "language": "fr", "autoGenerated": false, "machineTranslated": true }
]

Where the text goes

Fileboy uses OpenAI as the processor for translated captions. Only when you ask (or when you set automatic languages, below) the track's caption text is sent to OpenAI's API, cue by cue. The video and its sound are not sent, and nothing is sent for a track you don't translate. Requests ask OpenAI not to store them, and the text is treated as content to translate, never as instructions.

If the captions contain what your users say, translating them sends it to a third party. Make sure that fits what you tell them, for example in your privacy policy.

Edit it, or translate again

A translated track is yours to fix, in the caption editor or with PUT /videos/:id/transcripts/:transcriptId. Translating again never overwrites a track you edited: a new track is made beside it, and the one you edited stays as an ordinary track that you can keep or delete. A track you haven't edited just gets the new words.

When the track a translation was made from changes, the translation says so:stale: true in the API and an Out of date warning in the dashboard. That is when you edit the source in the editor or with the API, or when auto-generated captions are made again (for example after the video's source is replaced). The translation keeps serving until you translate again, which is your call because it sends the captions to OpenAI again. A track you haven't edited is replaced; one you have is kept beside the new one.

Delete a translated track like any other: the translation's row stays, as track deleted, and translating again makes a new track. Delete the source and the translations stay as ordinary tracks, which can no longer be translated again.

Trims, cuts and replacements

A trim, cut or trim reset moves every caption track with the video, translations included, by the same edit and exactly as it moves the source, so they stay in step. The words in a removed section are removed from each. These are not changes to what the source says, so nothing goes stale and nothing is sent to OpenAI again.

Replacing a video's source file keeps its caption tracks as they are, like every other track, so translations of tracks you uploaded stay. Auto-generated captions are made again for a replaced video when auto captions are on, and a translation of the track they replace goes stale; if the app has automatic languages (below) they are translated again straight away. A track you edited is kept, as is its translation.

Translate new auto-generated captions automatically

It is off by default. In the app's Settings, under Auto-generated captions, add the languages to translate into, or set autoTranslateLanguages in the app settings (up to 10). Whenever a video's auto-generated captions are made, including again after its source was replaced, they are translated into those languages too, so the text goes to OpenAI a second time. Videos whose captions were made before aren't translated: do it from their Captions & AI tab.

# translate every new auto-generated caption track into French and Spanish (needs auto captions on)
curl -X PATCH https://api.fileboy.io/app/settings \
  -H "Authorization: token YOUR_SIGNED_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"autoCaptions": true, "autoTranslateLanguages": ["fr", "es"]}'

# turn it off again
curl -X PATCH https://api.fileboy.io/app/settings \
  -H "Authorization: token YOUR_SIGNED_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"autoTranslateLanguages": []}'

The webhook

video.captions_translated is sent when a translation is made, once for each language. Video filters apply and it can be replayed, like the other video events. trackCreated is false when the track a previous translation made was replaced, and true for a new track; when it is new because you had edited the old one, keptEditedTrackId names it. reason is request or auto. A failure sends no webhook, email or alert; its message is on the translation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "type": "video.captions_translated",
  "resource": {
    "id": "9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10",
    "name": "demo.mp4",
    "status": "ready",
    "translation": {
      "status": "done",
      "reason": "request",
      "sourceTrackId": "5e0c7a12-3d4b-4f6a-9e21-8c7b6a5d4e3f",
      "sourceLanguage": "en",
      "language": "fr",
      "trackId": "c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f",
      "trackUrl": "https://api.fileboy.io/videos/9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10/transcripts/c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f",
      "trackCreated": true,
      "cues": 48,
      "characters": 2310,
      "model": "gpt-6-luna"
    }
  }
}

Limits and failures

  • A video can be translated into up to 10 languages (tracks Fileboy made that still exist, plus those queued).
  • An app can ask for 120 languages an hour. A request over that is refused with 429 and nothing in it is queued: try again later. The processor starts up to 40 translations an hour per app, and the rest wait their turn.
  • These limits are per app and count every start on all of Fileboy's servers together, retries included. They reset at the top of each UTC hour, and come from your plan, which can also set a monthly cap (none do today). Jobs over a limit stay pending until the next hour or month; documents and questions answer 429 rate_limited. See each feature's use this hour and month in the app's Usage page (AI usage and limits) or with GET /usage/ai.
  • A translation can't be asked for while the video is being trimmed, cut or blurred (409). Ask once that is done.
  • Tracks of more than 6,000 cues or 400,000 characters, or with a cue longer than 2,000 characters, are skipped, and so are tracks with no words in them.
  • If OpenAI is busy or has an error, a translation is tried again after 1, 5 and 30 minutes, then marked failed. The first batch that fails stops the others. An answer that doesn't match the cues fails straight away so that no more is spent on it, and so does a server whose OpenAI account is out of credit. Translate again to retry.
  • Fileboy counts each app's finished translations, and the calls, characters and tokens sent to OpenAI (tries that failed included): GET /usage/translation, and the last 30 days on the settings card.
Machine translation makes mistakes, more so with names, jokes, technical terms and languages it knows less well. Read a translation through before you rely on it, and edit what is wrong.

Related guides