lattedit

Compile LaTeX through a small API.

The lattedit API accepts a complete project, runs the selected TeX engine in a restricted temporary workspace, and returns the PDF and compiler log as JSON. It requires no key and is described by an OpenAPI 3.1 contract.

Base URL

https://lattedit.xyz/api/v1

Authentication

None. No registration or token.

Rate limit

20 compiles per client IP per minute.

Check availability

curl https://lattedit.xyz/api/v1/health

The health response reports whether TeX is available and how many requests are active or queued. The compiler runs on a free instance that may need to wake after inactivity, so latency-sensitive automation should call health while it prepares the project.

Use the MCP server

https://lattedit.xyz/mcp

The stateless Streamable HTTP endpoint exposes lattedit_compiler_health and lattedit_compile_project. It requires no token and returns both a concise text result and structured JSON. Discover it through the MCP Registry manifest, server card, or AI catalog.

Compile a project

curl -sS https://lattedit.xyz/api/v1/compile \
  -H 'Content-Type: application/json' \
  --data '{
    "compiler": "pdflatex",
    "main": "main.tex",
    "stopOnFirstError": true,
    "files": [{
      "path": "main.tex",
      "encoding": "utf8",
      "content": "\\documentclass{article}\\begin{document}Hello\\end{document}"
    }]
  }'

Send every file the project reads. Text content uses UTF-8; binary images and PDFs use base64. A random workspaceKey of at least sixteen URL-safe characters enables short-lived incremental state. Reusing that key with identical input returns the cached PDF without starting TeX. Never use a user identifier, document name, email address, or other personal value as the workspace key.

Responses and recovery

A successful response contains status, a base64 pdf, log, total durationMs, engineMs, syncMs, and the cache mode. A document-level LaTeX error can still return HTTP 200 because the API request itself succeeded; inspect both status and log. Request errors use JSON with a stable message, while unsupported lattedit API routes and methods use RFC 9457 problem details with code, detail, and resolution.

Versioning and deprecation

The stable surface begins at /api/v1. Backward-compatible response fields may be added within v1. A breaking change requires a new major path. The complete, durable contract is published in the API versioning and deprecation policy.

Agent use

This API is appropriate when an agent already holds a user-approved LaTeX project and needs compilation or diagnostic output. It is not storage, a document search service, or permission to upload private files. Keep the project in the user's chosen repository, send only files required by TeX, and discard the returned PDF when the task no longer needs it. Read llms.txt for concise when-to-use guidance.