All docs

API & automation

REST API

Use LLMtoMD from scripts and CI with a simple HTTP API — convert, poll, and fetch Markdown without an agent.

Everything the MCP tools do is backed by a REST API you can call directly — from a script, a CI job, or your own backend. Authenticate with the same connection key (mic_…) you use for your agent, passed as the X-API-Key header.

Base URL:

https://api.llmtomd.com/v1

Generate a key under Settings → Connect to Claude (or API keys in the dashboard).

Convert a URL

curl -X POST https://api.llmtomd.com/v1/convert \
  -H "X-API-Key: $LLMTOMD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/report"}'

# → { "job_id": "…", "status": "queued" }

Conversion is asynchronous: you get a job_id back immediately.

Poll the job, then fetch the Markdown

# Poll until status is "completed"
curl https://api.llmtomd.com/v1/jobs/$JOB_ID \
  -H "X-API-Key: $LLMTOMD_API_KEY"

# Then fetch the document as Markdown
curl "https://api.llmtomd.com/v1/documents/$DOC_ID?format=md" \
  -H "X-API-Key: $LLMTOMD_API_KEY"

Upload a local file

Reserve an upload, PUT the bytes to the presigned URL, then convert:

# 1. Reserve — returns { upload_id, presigned_url, expires_in }
curl -X POST https://api.llmtomd.com/v1/uploads \
  -H "X-API-Key: $LLMTOMD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename": "report.pdf", "content_type": "application/pdf", "size_bytes": 482113}'

# 2. PUT the bytes with the SAME content type the upload was signed for
curl -X PUT --upload-file report.pdf \
  -H "Content-Type: application/pdf" \
  "$PRESIGNED_URL"

# 3. Convert it
curl -X POST https://api.llmtomd.com/v1/convert \
  -H "X-API-Key: $LLMTOMD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"upload_id": "'"$UPLOAD_ID"'"}'

Search and ask

# Semantic search
curl -X POST https://api.llmtomd.com/v1/search \
  -H "X-API-Key: $LLMTOMD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "webhook retries", "k": 5}'

# Ask (retrieval-augmented, cited answer)
curl -X POST https://api.llmtomd.com/v1/ask \
  -H "X-API-Key: $LLMTOMD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "What status code for a duplicate upload?"}'

Common parameters

EndpointKey fields
POST /converturl or upload_id, crawl, options.ocr_langs
POST /uploadsfilename, content_type, size_bytes
GET /jobs/{id}poll until status: "completed"
GET /documents/{id}?format=mdfetch stored Markdown
POST /searchquery, k, optional document_id / collection_id
POST /askquery, optional document_id / collection_id

Notes

  • The PUT to a presigned upload URL must send the same Content-Type you passed to POST /uploads, or storage rejects it.
  • Credits, rate limits, and your plan's file-size limit apply exactly as they do through the agent — it's the same backend.

Related