Convert API
Source + Intent
Same sentence as the workspace: upload a file (Source), choose Markdown or a Design (Intent). Auth with a fw_live_ API key from Profile. Accepts PDF, Word, Excel, PowerPoint, images, and text (up to 50 MB).
This environment
- API host
- https://api.fileworks.ai
- Status
- Checking…
Auth
Send Authorization: Bearer fw_live_… (or X-Api-Key). Workspace sign-in tokens are not accepted. GET convert catalog works without a key; POST convert bills AI page credits only.
Convert
POST /api/v1/convert — multipart file (Source) plus Intent: target and/or design. JSON returns extracted markdown and exported content. Use download=true to receive the file body instead.
- file
- Source document (required). PDF, Office, images, Markdown, TXT, CSV — up to 50 MB.
- target
- Intent output format:
markdown(default),txt,html,json, ordocx. - use_ai
truefor OCR on scans and images (1 AI credit / page).- target_lang
- Translate after reading (e.g.
en,zh). Omit or useoriginalto skip. - design
- Intent Design starter id (
invoice,family_daily, …). Fills that Design from the extracted Markdown — the API twin of Produce as. List ids onGET /api/v1/convert→designs. - design_fill
- With
design:defaults(samples),auto(AI-fill, 1 credit / page), ornoneplusdesign_variablesJSON.
GET /api/v1/convert returns the live catalog (inputs, targets, languages, Design starters as produce targets, and which options are available now).
Examples
Replace YOUR_API_KEY with a key from Profile. Markdown Intent first; Design Intent second — same endpoint.
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
-F file=@report.pdf \
-F target=markdown \
-F download=true \
-o report.md \
https://api.fileworks.ai/api/v1/convertcurl -s -H "Authorization: Bearer YOUR_API_KEY" \
-F file=@report.pdf \
-F target=markdown \
https://api.fileworks.ai/api/v1/convert \
| jq -r .markdowncurl -s -H "Authorization: Bearer YOUR_API_KEY" \
-F file=@invoice-scan.pdf \
-F target=html \
-F design=invoice \
-F design_fill=defaults \
-F download=true \
-o invoice.html \
https://api.fileworks.ai/api/v1/convertimport requests
from pathlib import Path
base = "https://api.fileworks.ai"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
# Optional: list inputs, targets, and Design starter ids
catalog = requests.get(f"{base}/api/v1/convert", headers=headers).json()
print(catalog["capabilities"], [d["id"] for d in catalog.get("designs", [])])
with open("report.pdf", "rb") as fh:
res = requests.post(
f"{base}/api/v1/convert",
headers=headers,
files={"file": ("report.pdf", fh, "application/pdf")},
data={"target": "markdown", "use_ai": "false", "target_lang": "original"},
)
res.raise_for_status()
Path("report.md").write_text(res.json()["markdown"], encoding="utf-8")const base = "https://api.fileworks.ai";
const headers = { Authorization: "Bearer YOUR_API_KEY" };
const body = new FormData();
body.append("file", fileInput.files[0]);
body.append("target", "markdown");
const res = await fetch(`${base}/api/v1/convert`, { method: "POST", headers, body });
const data = await res.json();
console.log(data.markdown);Quota
Standard convert is free (monthly page cap). AI reading, translation, or Design design_fill=auto is 1 credit per page. API Free includes 1,000 standard pages and 25 AI pages / month. See Pricing. Questions: support@fileworks.ai.