Docs/API Reference
Get an API key →

Reference

API Documentation

Convert PDF, Office, HTML, and image files to clean Markdown over a single REST endpoint. Use the official Python or TypeScriptSDK, or call the endpoint directly — authenticate with an API key and you're converting in one call.

Quickstart

#
  1. 1Create an API key in your dashboard. The raw key (sk_…) is shown once — store it securely.
  2. 2Install an SDK (pip install emdi / npm install emdi) or call the convert endpoint directly with your key as a Bearer token.
  3. 3Read the Markdown from the JSON response. That's it.

Authentication

#

Every request is authenticated with an API key passed as a Bearer token. Keys carry the permissions and monthly allowance of the account that created them.

Authorization: Bearer sk_your_key

Keep secret keys server-side. Treat a leaked key like a password — revoke it in the dashboard and issue a new one.

POST/api/v1/convert

Convert a file

#

Send multipart/form-data with a single file field. Files are converted and discarded immediately — never stored.

curl -X POST https://api.emdi.pw/api/v1/convert \
  -H "Authorization: Bearer sk_your_key" \
  -F "file=@document.pdf"

Response

{
  "markdown": "# Title\n\nConverted content…",
  "credits_used": 1,
  "filename": "document.pdf",
  "credits_remaining": 1862,
  "credits_limit": 2000
}

Supported file types

PDFDOCXPPTXXLSXHTMLTXTCSVJPGPNGGIFWEBPMP3WAV

Maximum file size: 50 MB.

GET/api/v1/me/usage

Check your usage

#

Returns your current plan and allowance usage for the period.

curl https://api.emdi.pw/api/v1/me/usage \
  -H "Authorization: Bearer sk_your_key"

Errors & rate limits

#

Errors return a standard HTTP status with a JSON detail field. Allowance limits return 429 with a machine-readable code.

401unauthorized
Missing, malformed, invalid, or revoked token.
413payload too large
File exceeds the 50 MB limit.
415unsupported type
File type isn't in the supported list.
422unprocessable
Empty file, or the document couldn't be parsed.
429credit_limit_reached
Monthly allowance exhausted — upgrade or wait for reset.
504timeout
Conversion took too long; try a smaller file.

Ready to start?

Get an API key →