Quickstart
1. Create an API key
Section titled “1. Create an API key”Sign in at md.tlelabs.com with Google, open API keys and create a key. The key (mdw_live_…) is shown once: store it in a secret manager or an environment variable.
New accounts start with 0 credits. Credits are added by the operator: write to md@tlelabs.com.
2. Convert a file
Section titled “2. Convert a file”POST /v1/convert with multipart/form-data; the file goes in the file field. Replace <YOUR_API_KEY> with your key.
curl -X POST 'https://api.md.tlelabs.com/v1/convert' \ -H 'Authorization: Bearer <YOUR_API_KEY>' \ -F 'file=@document.pdf' \ -F 'ocr=auto'import { readFile } from "node:fs/promises";
const form = new FormData();form.append("file", new Blob([await readFile("document.pdf")]), "document.pdf");form.append("ocr", "auto");
const response = await fetch("https://api.md.tlelabs.com/v1/convert", { method: "POST", headers: { Authorization: "Bearer <YOUR_API_KEY>" }, body: form,});const result = await response.json();console.log(result.markdown);import requests
with open("document.pdf", "rb") as file: response = requests.post( "https://api.md.tlelabs.com/v1/convert", headers={"Authorization": "Bearer <YOUR_API_KEY>"}, files={"file": file}, data={"ocr": "auto"}, )print(response.json()["markdown"])3. Read the result
Section titled “3. Read the result”The JSON response holds the Markdown and what the conversion cost:
{ "markdown": "# Quarterly report\n\nRevenue grew 12%…", "format": "pdf", "usage": { "pages": 10, "ocr_pages": 3, "credits_charged": 16, "credits_remaining": 9984, "ocr_page_credits": 3 }, "metadata": { "byte_size": 524288, "duration_ms": 1842, "ocr_model": "auto", "ocr_models_used": ["openparser/paddleocr-vl-1.6"] }, "warnings": []}Next steps
Section titled “Next steps”- Convert a file: OCR options and the plain Markdown response.
- Quote before converting: know the price before you spend credits.
- Errors: what to retry and what to fix.