# Getting Started

> For AI agents: a documentation index is available at https://makespdf.com/llms.txt — every docs page also has a markdown twin (append .md to the page URL), including this one: https://makespdf.com/docs/getting-started.md

Go from sign-up to your first PDF in under five minutes. This guide walks
through the web UI — for AI agent setup, see
[AI & Agent Setup](https://makespdf.com/docs/ai-setup).

## 1. Create an account

Head to the [registration page](https://makespdf.com/auth/register) and sign up with your
email. New accounts start on the Free plan: 10 documents a month, each up to 10 pages.

## 2. Create an API key

If you plan to call the API (from code, scripts, or an AI agent), you'll need an
API key.

1. Open API Keys — click your name in the header, then choose
   [API Keys](https://makespdf.com/settings/api-keys).
2. Create a key — give the key a name (e.g. "My App") and click Create key. Copy
   it — you won't be able to see it again.
3. Use the key — pass it as a Bearer token in the `Authorization` header:

```http
Authorization: Bearer mpdf_your_api_key_here
```

## 3. Create your first template

Templates are the core concept. A template is a reusable layout with
`{{variable}}` placeholders — build it once, then render the same design with
different data as many times as you want.

**Via the web UI.** Go to [Templates](https://makespdf.com/templates) and click **Modify
Template** on any library template to open it in the editor. Or describe the
document you want in the [embedded AI chat](https://makespdf.com/ai/chat) and it will build
the template for you. Prefer your own assistant? Point it at the skill file and
API — see [AI & Agent Setup](https://makespdf.com/docs/ai-setup).

**Via the API.**

```bash
curl -X POST https://makespdf.com/api/v1/templates \
  -H "Authorization: Bearer mpdf_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Hello world",
    "dsl": "const template = doc({ size: \"A4\" }, page(col(s(\"Hello {{name}}\"))));\nconst sampleData = { name: \"World\" };"
  }'
```

The response includes a `templateId` — save this for rendering.

## 4. Render a PDF

Once you have a template, rendering is fast (about a second) and costs 1 credit
per 10 pages. Pass your template ID and fresh data:

```bash
curl -X POST https://makespdf.com/api/v1/render \
  -H "Authorization: Bearer mpdf_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "your-template-id",
    "data": { "name": "Ada" }
  }' -o hello.pdf
```

The response is the PDF binary. Open it and you'll see your data filled into the
template — the same layout, a different name.

> **Tip:** Every PDF is **PDF/A-2A + PDF/UA-1 dual-compliant** — archival-grade
> with full accessibility (tagged structure, embedded fonts, Unicode text
> extraction). No extra configuration needed.

## 5. Quick alternative: Markdown to PDF

Don't need a reusable template? Send Markdown directly and get a PDF back. No AI
call, no template to save — markdown renders are billed like any other render, at
1 credit per 10 pages.

```bash
curl -X POST https://makespdf.com/api/v1/md \
  -H "Authorization: Bearer mpdf_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"markdown": "# Monthly Report\n\n## Summary\n\nRevenue increased **23%** over last quarter.\n\n| Metric | Value |\n|--------|-------|\n| Revenue | $1.2M |\n| Users | 8,400 |"}' \
  -o report.pdf
```

Supports full GitHub Flavored Markdown — headings, tables, code blocks, task
lists, images, footnotes, and more. See the [API Reference](https://makespdf.com/docs/api)
for all options.

## What's next

- [API Reference](https://makespdf.com/docs/api) — Full endpoint documentation,
  request/response formats, error codes
- [AI & Agent Setup](https://makespdf.com/docs/ai-setup) — Let your AI assistant generate
  PDFs with a single prompt
- [Generate](https://makespdf.com/generate) — Markdown, embedded AI chat, library
  templates, and editor plugins
- [Pricing](https://makespdf.com/pricing) — Plans, credits, and usage
