Skip to content

API Documentation

Generate professional PDFs from structured data.

Base URL

https://doc.chut.me

Authentication

Pass your API key in the X-API-Key header.

X-API-Key: pk-your-api-key

Get your key at /dashboard/keys

Endpoints

POST /render

Render a document from template + data to PDF.

{
  "template": "be.accounting.invoice",
  "data": { ... },
  "options": {
    "language": "fr",
    "strict": true
  }
}

Returns application/pdf on success.

POST /validate

Validate data against a template schema (dry run, no rendering).

{
  "template": "be.accounting.invoice",
  "data": { ... }
}
GET /packs

List all installed template packs and their templates.

GET /health

Service health check.

Error Codes

CodeMeaning
400Schema validation failed
401Missing or invalid API key
404Template not found
422LaTeX render failed

Examples

Python
import httpx

res = httpx.post(
    "https://doc.chut.me/render",
    headers={"X-API-Key": "pk-your-key"},
    json={
        "template": "be.accounting.invoice",
        "data": {
            "company": {"name": "Chut SRL", "vat": "BE0795886652"},
            "client": {"name": "ACME Corp"},
            "invoice": {
                "number": "2026-042",
                "date": "2026-03-28",
                "lines": [{"description": "Consulting", "quantity": "3", "unit_price": "120.00", "vat_rate": "21"}],
                "total_excl_vat": "360.00",
                "total_vat": "75.60",
                "total_incl_vat": "435.60"
            }
        },
        "options": {"language": "fr"}
    }
)

with open("invoice.pdf", "wb") as f:
    f.write(res.content)
Node.js
const res = await fetch("https://doc.chut.me/render", {
  method: "POST",
  headers: {
    "X-API-Key": "pk-your-key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    template: "be.accounting.invoice",
    data: { /* ... */ },
    options: { language: "fr" },
  }),
});

const pdf = await res.arrayBuffer();
fs.writeFileSync("invoice.pdf", Buffer.from(pdf));