Bytefusedocs

AI Tools

AI Translate

Translate a PDF into any target language while keeping its structure intact — headings, tables, lists and links survive. The document is converted to Markdown first, then translated chunk by chunk.

PRO / ENTERPRISE only 200 credits / callSynchronous

Overview

Upload a PDF and name a target language; the translated Markdown comes back inline (no download URL). Billed a flat 200 credits per call.

POSThttps://api.bytefuse.in/api/v1/ai/translate

Paid plans only

Requires a PRO or ENTERPRISE plan — anonymous → 401, free-tier → 403.

Request

Content type multipart/form-data:

filefilerequired
The PDF to translate (must end in .pdf, else 415).
target_langstringrequired
Target language as free text — Spanish, fr, Hindi, etc. Blank returns 422.
source_langstringoptional
Source language, or auto to detect.Default: auto

Field names

The fields are target_lang and source_langnot target_language / source. The translated output is returned in a field called markdown.

Response

200 OK, application/json:

200 OK
{
  "success": true,
  "markdown": "# Título\n\nPárrafo traducido…\n\n| A | B |\n|---|---|\n| 1 | 2 |",
  "credits_charged": 200,
  "target_lang": "Spanish",
  "source_lang": "auto",
  "chunks": 2,
  "word_count": 640,
  "processing_time_ms": 8120
}
markdownstringoptional
The translated text, as Markdown with structure preserved. (The field is markdown, not translation.)
target_langstringoptional
Echo of the requested target language.
source_langstringoptional
Echo of the requested source (or auto).
chunksintoptional
Number of translation chunks processed.
word_countintoptional
Word count of the translated output.
credits_chargedintoptional
Always 200. Mirrors X-Credits-Charged.

Examples

curl -X POST https://api.bytefuse.in/api/v1/ai/translate \
  -H "X-API-Key: dt_live_your_key" \
  -F "file=@contract.pdf" \
  -F "target_lang=Spanish" \
  -F "source_lang=auto"

Errors

401Anonymous / no valid credential.
403Free-tier account — AI tools need PRO or ENTERPRISE.
415Missing filename or not a .pdf.
422target_lang is blank, or the PDF has no extractable text.
402 / 429 / 503Insufficient credits, rate limited, or capacity/config error.
500AI processing failed unexpectedly.