Convert
Convert Document
Convert one document to another format — PDF ↔ Word, PDF → image, image → PDF and more. Synchronous, formatting-preserving, with an optional AI vision engine for hard scanned PDFs.
Free to try — no key required 40 credits / callAI vision: 200 creditsSynchronous
Overview
Upload a file and name a target_format; the source format is inferred from the uploaded filename’s extension. The response is a public R2 URL for the converted file. Like compression, this is on the free-try path.
POST
https://api.bytefuse.in/api/v1/conversion/singleRequest
Content type multipart/form-data:
filefilerequiredThe document to convert. Must be non-empty; the source format is its filename extension.
target_formatstringrequiredDestination format — e.g.
docx, pdf, png, jpg, txt.quality_presetstringoptionalOne of
standard, premium, maximum.Default: standardenginestringoptionalauto or vision. Any other value returns 422. vision only takes effect for PDF → DOCX.Default: autocustom_settingsstringoptionalA JSON string of custom settings. Accepted but not consumed on this path.Default:
nullEngines & quality
With engine=auto the API picks the right pipeline for your file:
- Digital PDF → Word uses
pdf2docx(quality ≈ 0.95). - Scanned PDF → Word is detected automatically (no text layer) and routed through OCR (
ocr+python-docx, quality ≈ 0.88). - PDF → image renders at 150 DPI; a multi-page PDF returns a ZIP of per-page images.
- Image → PDF and other pairs run through the conversion orchestrator.
When to use engine=vision
For complex or scanned PDF → Word where layout fidelity matters,engine=vision runs a premium AI pipeline (vision+python-docx). It applies only to PDF → DOCX; for other conversions the value is validated but ignored. It costs 200 credits instead of 40.Response
200 OK, application/json:
200 OK
{
"conversion_id": "b3c1e2a4-...-uuid",
"status": "completed",
"output_file_url": "https://<r2-host>/converted/report.docx",
"quality_score": 0.95,
"processing_time": 1.0,
"engine_used": "pdf2docx",
"metadata": {
"source_format": "pdf",
"target_format": "docx",
"quality_score": 0.95,
"processing_time": 1.0,
"engine_used": "pdf2docx",
"file_size": 48213
},
"created_at": "2026-07-04T12:00:00Z"
}conversion_idstringoptionalFresh UUID per call (not a persisted job id).
statusstringoptionalAlways
"completed" on success (synchronous).output_file_urlstringoptionalPublic R2/CDN URL of the converted file.
quality_scorefloatoptional0–1 estimate of conversion fidelity.
processing_timefloatoptionalSeconds spent converting.
engine_usedstringoptionalThe pipeline chosen — e.g.
pdf2docx, ocr+python-docx, vision+python-docx, pymupdf-render, pymupdf-image.metadataobjectoptionalSource/target formats, quality, timing, engine and output
file_size.created_atstringoptionalISO-8601 UTC timestamp.
The response header X-Credits-Charged reports the credits billed.
Credits
Any conversion (default)
convert.document40engine=vision, PDF → DOCX
convert.pdf_to_docx.ai200Examples
curl -X POST https://api.bytefuse.in/api/v1/conversion/single \
-H "X-API-Key: dt_live_your_key" \
-F "file=@report.pdf" \
-F "target_format=docx" \
-F "quality_preset=premium" \
-F "engine=vision"Errors
400Missing filename, or the uploaded file is empty.
422
engine isn’t auto or vision, or the conversion engine couldn’t process the file.402 / 429 / 503Insufficient credits, rate limited, or capacity/config error.
500Unexpected internal conversion error.
See Errors for the full error shape, and PDF to Excel for table extraction.
