# doclinth
> doclinth turns your HTML/Handlebars templates plus structured JSON into
> pixel-perfect PDFs over a single API call. You create a template once (by hand
> or with AI), then generate documents from data forever. The render path is
> fully deterministic — it never calls an LLM — so the same template + data
> always produce the same PDF. Built to be called by both code and AI agents.
## Authentication
All API requests use a bearer API key: `Authorization: Bearer dl_live_…`
(or `dl_test_…` for test mode). Create a key at https://doclinth.com/dashboard/keys.
## API endpoints
- POST https://doclinth.com/v1/generate: Render a template with `data` into a PDF. Returns
PDF bytes by default, or a 24h signed URL with `options.output:"url"`. Async
delivery via `options.webhook_url` (202 + HMAC webhook). Per-request render
options: format, landscape, margins, metadata, filename, watermark (paid),
and validate (checks data against the template JSON Schema before rendering).
Idempotency-Key supported.
- GET https://doclinth.com/v1/templates: List your templates and their ids.
- POST https://doclinth.com/v1/templates: AI-author a new template from a prompt (saved as a
draft). Consumes your AI-authoring allowance.
- GET https://doclinth.com/v1/templates/{id}: A template's data contract — json_schema,
sample_data, variables, rendered html, and latest test summary.
- GET https://doclinth.com/v1/templates/{id}/schema: JSON Schema; add ?format=typescript,
zod, or pydantic for generated source.
- GET/POST https://doclinth.com/v1/templates/{id}/fixtures: Manage named edge-case payloads.
- POST https://doclinth.com/v1/templates/{id}/tests: Queue document layout stress tests.
- GET https://doclinth.com/v1/templates/{id}/tests/{run_id}: Poll results and diagnostics.
- GET https://doclinth.com/v1/generations/{id}: Status metadata for one generation.
## For AI agents
- MCP server (streamable HTTP): https://doclinth.com/mcp — authenticate with your API key as
the bearer token. Tools: list_templates, get_template, create_template,
generate_pdf, run_template_tests, get_template_test_run. Docs: https://doclinth.com/docs/agents
- Full reference: https://doclinth.com/llms-full.txt
- OpenAPI 3.1 spec: https://doclinth.com/openapi.json
## Docs
- Quickstart: https://doclinth.com/docs/quickstart
- Authentication: https://doclinth.com/docs/authentication
- Template syntax: https://doclinth.com/docs/templates
- Data contracts (JSON Schema, codegen, validate, fixtures): https://doclinth.com/docs/contracts
- Document tests: https://doclinth.com/docs/testing
- Free PDF stress test: https://doclinth.com/tools/pdf-stress-test
- For AI agents (MCP + tool-use): https://doclinth.com/docs/agents
- Node.js / TypeScript SDK (@doclinth/sdk): https://doclinth.com/docs/sdk
- Python SDK (doclinth): https://doclinth.com/docs/python
- Errors: https://doclinth.com/docs/errors