Compile API
A high-performance LaTeX compilation service featuring intelligent caching and incremental compilation for fast PDF generation.
Base URL
https://compile.useoctree.comPerformance
Up to 49x faster on cache hits (~10ms) and 30-40% faster on text edits.
GETHealth Check
Verify the compilation service is running and accessible.
curl https://compile.useoctree.com/healthPOSTCompile Multi-File Project
RecommendedSend a JSON payload with multiple files, assets, and project identifiers to take full advantage of intelligent caching and incremental compilation.
Headers
Payload Parameters
path and content for each file.Example Request
curl -X POST https://compile.useoctree.com/compile \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"files": [
{
"path": "main.tex",
"content": "\\documentclass{article}\n\\begin{document}\nHello World!\n\\end{document}"
}
],
"projectId": "my-project-123",
"lastModifiedFile": "main.tex"
}' \
--output output.pdfResponse Structure
// Returns binary PDF data directly.
Content-Type: application/pdf
Content-Disposition: attachment; filename="output.pdf"Caching & Performance Strategy
When providing a projectId in the JSON payload, the API uses a robust caching strategy to optimize compilation times significantly:
Content Hashing
Entire file sets are hashed. If the hash matches a cached entry, the resulting PDF is returned instantly in approximately 10ms.
Incremental Builds
Temp directories preserve .aux and .bbl files. When only .tex files change, the compiler intelligently skips bibtex, resulting in 30-40% faster compiles.
Eviction Policy
Projects are automatically evicted from memory after 30 minutes of inactivity, with a maximum of 15 actively cached projects maintained via an LRU cache.
Interested in an API key for this endpoint? Reach out for API key at basil@useoctree.online for $20 USD / month (unlimited files).