cURL quickstart
1. Try it without signing up
Section titled “1. Try it without signing up”The public demo key works immediately (rate-limited: 3 req/min, 50 renders/month, shared by everyone):
curl -X POST https://api.docjet.dev/v1/render \ -H "Authorization: Bearer binfra_9afb57dbb6478c441ad101129fca65847f5745403f9d718b3de6d934c9b63f88" \ -H "Content-Type: application/json" \ -d '{"html":"<h1>Hello from DocJet</h1><p>My first branded PDF.</p>"}' \ --output hello.pdfOpen hello.pdf — that’s a Chromium-rendered PDF from your HTML.
2. Get your own free API key
Section titled “2. Get your own free API key”100 renders/month, no card required:
curl -X POST https://api.docjet.dev/v1/signup \ -H "Content-Type: application/json" \ -d '{"email":"you@example.com"}'Response:
{ "apiKey": "binfra_...", "tier": "free", "message": "Save this key — it is shown only once"}The key is shown once. Store it (e.g. export DOCJET_API_KEY=binfra_...) and send it as a Bearer token on every request:
-H "Authorization: Bearer $DOCJET_API_KEY"3. Render from a stored template
Section titled “3. Render from a stored template”List the public template catalog (no auth needed):
curl https://api.docjet.dev/v1/templatesReturns [{ "id": "invoice-ro", "name": "Invoice (România)", "description": "...", "outputType": "pdf" }, ...] — 15 templates: invoices (EN/RO), proforma, quote, receipt, certificate, gift certificate, packing slip, shipping label, monthly/analytics reports, OG and social images.
Render one — data holds the template’s Handlebars variables:
curl -X POST "https://api.docjet.dev/v1/render?response=url" \ -H "Authorization: Bearer binfra_9afb57dbb6478c441ad101129fca65847f5745403f9d718b3de6d934c9b63f88" \ -H "Content-Type: application/json" \ -d '{"template_id":"invoice-ro","data":{"supplier":{"name":"DocJet Demo SRL","cui":"RO12345678","regCom":"J40/1234/2026","address":"Str. Exemplu 1, Bucuresti"},"client":{"name":"Acme SRL","cui":"RO87654321","address":"Str. Test 2, Cluj-Napoca"},"series":"DJ","invoiceNo":"001","issueDate":"12.06.2026","items":[{"name":"Consulting","qty":1,"unitPrice":1000,"value":1000}]}}'4. Choose your response format
Section titled “4. Choose your response format”POST /v1/render (and /v1/image) support three response modes via the response query parameter:
| Query | Response |
|---|---|
| (omitted) | Raw binary (PDF or PNG) — pipe to a file with --output |
?response=url | JSON {"url": "..."} — a signed, expiring download URL |
?response=json | JSON with the document as base64 |
Signed URLs are the best fit for agents and workflows: pass the URL onward instead of moving binary blobs between steps.
5. Render a PNG image
Section titled “5. Render a PNG image”POST /v1/image takes the same body as /v1/render. Image dimensions come from the template (e.g. og-blog is 1200x630, social-square is 1080x1080):
curl -X POST "https://api.docjet.dev/v1/image?response=url" \ -H "Authorization: Bearer $DOCJET_API_KEY" \ -H "Content-Type: application/json" \ -d '{"template_id":"og-blog","data":{"title":"My Post","author":"Me"}}'6. Check your usage and quota
Section titled “6. Check your usage and quota”curl https://api.docjet.dev/v1/keys/usage \ -H "Authorization: Bearer $DOCJET_API_KEY"Returns your tier, monthly quota, used and remaining renders for the current period. When you hit the quota, the API returns 429 QUOTA_EXCEEDED with an upgrade hint — see Pricing.