LaTeX API

Introduction

What LaTeX API is, where it lives and how to talk to it.

LaTeX API compiles LaTeX projects to PDF over HTTP. You send a .tex file, a set of files or a zip; the server runs pdfLaTeX, XeLaTeX or LuaLaTeX from TeX Live 2026 inside a throwaway container and returns the PDF together with a parsed log: every error and warning with its file, line and context.

It is open source (MIT) and self-hostable. A public instance runs at the base URL below.

Base URL

https://latex-api.crafter.run

All API routes live under /v1. The OpenAPI 3.1 document is served at /openapi.json and an interactive reference at /reference.

Authentication

Protected routes take an API key in either header:

Authorization: Bearer <key>
X-API-Key: <key>

Keys are issued by whoever operates the instance. See Authentication for the public endpoints and rate limits.

Content types

You sendContent-TypeNotes
A single documenttext/x-texBody is the file; ?entrypoint= names it (main.tex)
Several files as JSONapplication/jsonfiles[] with path, content, optional encoding
Files or a zip as form fieldsmultipart/form-datafiles parts and/or a project zip part
A zip archiveapplication/zipOptions go in the query string

Responses are a PDF (application/pdf) or, with Accept: application/json, a JSON job envelope. Errors are always application/problem+json (RFC 9457); see Errors.

Where to go next

On this page