Compile LaTeX through an HTTP API
LaTeX-on-HTTP takes your LaTeX sources — inline content, files or remote URLs — and returns the compiled PDF. No local TeX installation required: call it from server code, CI pipelines or the browser.
Quickstart
The quickest way to compile is the synchronous builds endpoint. Pass your
document in a content parameter — the response body is the PDF:
curl -G https://latex.ytotech.com/builds/sync \
--data-urlencode 'content=\documentclass{article} \begin{document} Hello World LaTeX-On-HTTP \end{document}' \
--output hello_world.pdf
curl -X POST https://latex.ytotech.com/builds/sync \
-H "Content-Type: application/json" \
-d '{
"compiler": "lualatex",
"resources": [
{
"main": true,
"content": "\\documentclass{article}\n\\usepackage{graphicx}\n\\begin{document}\n Hello World\\\\\n \\includegraphics[height=2cm,width=7cm,keepaspectratio=true]{logo.png}\n \\include{page2}\n\\end{document}"
},
{
"path": "logo.png",
"url": "https://www.ytotech.com/images/ytotech_logo.png"
},
{
"path": "page2.tex",
"file": "VGhpcyBpcyB0aGUgc2Vjb25kIHBhZ2UsIHdoaWNoIHdhcyBwYXNzZWQgYXMgYSBiYXNlNjQgZW5jb2RlZCBmaWxl"
}
]
}' \
--output hello_world.pdf
Open the playground to try every endpoint from your browser, with no setup at all.
Where to call it from
Server code
Generate invoices, reports or user documents on demand, from Python,
Node.js or any language that speaks HTTP.
CI pipelines
Build PDFs in GitLab CI or GitHub Actions pipelines, and upload them as
artifacts — without maintaining a TeXLive runner image.
Browser (JSON)
Call the JSON API with
fetch and display the returned PDF
directly in the page.
Browser (multipart)
Upload local files with
FormData and the multipart API —
the natural way to send user-selected files for compilation.
API summary
| Endpoint | Methods | Purpose |
|---|---|---|
/builds/sync |
GET POST | Compile a LaTeX document (querystring, JSON or multipart input) and get back the PDF. |
/texlive/information |
GET | TeXLive installation information (version, modules, tlmgr revision). |
/fonts |
GET | List fonts usable in compilations. |
/packages, /packages/<name> |
GET | List installed LaTeX packages, or get one package's details. |
/caches/resources |
GET DELETE | Inspect or reset the resources cache. |
/caches/resources/check_cached |
POST | Check whether resources (by content hash) are already cached server-side. |
Running your own instance
The service is available as an open beta on latex.ytotech.com. You can also run it yourself with Docker:
git clone https://github.com/YtoTech/latex-on-http.git
cd latex-on-http
docker compose up
# The service is available on http://localhost:8088
Prebuilt Docker images are also published: yoant/latexonhttp-python (Python + TeXLive) and yoant/docker-texlive (the base TeXLive distribution). See the README for details.