Translate a file
translate_fileTranslate whole files into another language, preserving layout, tables, images, and formulas. Works with documents, subtitles, images, audio, and video.
Instructions
Translate a whole file into another language and save the result, keeping its layout, tables, images and formulas. Documents (pdf, docx, pptx, xlsx, epub, html, txt), subtitles (srt, vtt), pictures (jpg, png, webp, bmp), and recordings (mp3, m4a, wav, flac, ogg, aac, opus, mp4, mov, webm, mkv), which come back as translated subtitles. Answers with the paths written, never the contents. COSTS THE USER'S CREDITS: say what it will cost and get their agreement first -- estimate_cost gives the number for a file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | The file: an absolute path on this machine, or a public http(s) URL (fetched by Equalang, not downloaded here). Omit when passing file_id. | |
| file_id | No | A file already uploaded by estimate_cost, instead of source: starts the job without uploading again. | |
| bilingual | No | Subtitles and recordings only: keep the original line above each translated one. | |
| output_dir | No | Directory for the results. Defaults to beside a local source. A URL source has no "beside": without this the answer carries temporary links. | |
| wait_seconds | No | Seconds to wait before answering with a job_id instead (default 50, at most 240). | |
| output_formats | No | Recordings only: the formats to write (default srt). | |
| source_language | No | Language of the file; omit to detect it. | |
| target_language | Yes | Language to translate into. A language code such as en, zh-CN, zh-TW, ja, ko, es, fr, de. list_languages has the codes: fewer for files than for text. |