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

FieldTypeDescription
contentstringLaTeX or Markdown source content
templatestringOptional template ID (e.g., ieee_conference, nature, arxiv)
formatstringOutput 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

FieldTypeDescription
namestringProject name
templatestringOptional template ID
contentstringOptional initial content

Rate Limits

PlanRequests/minuteConcurrent compilations
Free101
Pro605
EnterpriseCustomCustom

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
API Reference | TypeTeX Docs | TypeTeX Docs