API Reference
TypeTeX provides a REST API that lets you compile LaTeX documents programmatically, manage projects, and integrate publication-quality rendering into your own applications or AI agents.
Authentication
All API requests require a Bearer token. Generate your API key from the Settings page in your TypeTeX dashboard.
curl -X POST https://api.typetex.dev/v1/compile \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content": "\\documentclass{article}\\begin{document}Hello, world!\\end{document}"}'
Core Endpoints
POST /v1/compile
Compile LaTeX or Markdown content into a publication-ready PDF.
Request Body
| Field | Type | Description |
|---|---|---|
content | string | LaTeX or Markdown source content |
template | string | Optional template ID (e.g., ieee_conference, nature, arxiv) |
format | string | Output format: pdf (default), latex, or docx |
Response
{
"success": true,
"pdf_url": "https://api.typetex.dev/v1/pdf/abc123...",
"expires_at": "2025-01-26T12:00:00Z"
}
GET /v1/templates
List available journal and conference templates.
Response
{
"templates": [
{ "id": "ieee_conference", "name": "IEEE Conference", "category": "engineering" },
{ "id": "nature", "name": "Nature", "category": "science" },
{ "id": "arxiv", "name": "arXiv Preprint", "category": "general" }
]
}
POST /v1/projects
Create a new project programmatically.
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Project name |
template | string | Optional template ID |
content | string | Optional initial content |
Rate Limits
| Plan | Requests/minute | Concurrent compilations |
|---|---|---|
| Free | 10 | 1 |
| Pro | 60 | 5 |
| Enterprise | Custom | Custom |
Error Handling
All errors return a consistent JSON structure:
{
"success": false,
"error": {
"code": "COMPILATION_ERROR",
"message": "Undefined control sequence on line 42",
"details": { "line": 42, "column": 15 }
}
}
SDKs and Integrations
We provide official SDKs for common languages:
- Python:
pip install typetex - JavaScript/Node:
npm install @typetex/sdk
Example: AI Agent Integration
import typetex
# Initialize with your API key
client = typetex.Client(api_key="YOUR_API_KEY")
# Compile markdown to PDF with a template
response = client.compile(
content="# Research Findings\n\nOur analysis shows...",
template="ieee_conference"
)
print(response.pdf_url)
# https://api.typetex.dev/v1/pdf/8f9a2b...
Need Help?
- Check our Guides for end-to-end workflows
- Contact us for enterprise API access
- Join our community for support and feature requests