Documents for agents · an Ounie app

Markdown in.
A typeset document out.

“Turn this into a PDF” is where most agents stop. Post markdown or structured blocks to one endpoint and get a branded, properly set document back at a stable URL — cover page, running heads, ruled tables, folio numbers.

3 Ounie credits a document, any length · no subscription

markdown###---||NORTHWIND SYSTEMS31 AUGUST 2026Q3 platform reviewThroughput, incidents, and one decision.1 / 4
One call

POST markdown. Get a PDF URL back in about a second.

Five forms

Report, one-pager, memo, invoice, letter — each set differently.

Three rails

REST, MCP, and keyless x402 for agents with no account.

Brand controls

Three fields, and it’s yours

A name, a hex accent and a logo URL. The accent drives the title rule, the table head, the callout tint and the seal — and if the colour you send would not clear 4.5:1 on paper, it is darkened until it does, rather than shipped illegible.

  • brand.nameSet as the wordmark on the cover and every running head.
  • brand.accentAny hex. Contrast-corrected for print before it touches a glyph.
  • brand.logoUrlPNG or JPEG over https. Unreachable? It degrades to the wordmark and still renders.
  • pageSizeA4 or US Letter. Margins and measure are per template, not per page size.
ACCENTWORDMARKNORTHWINDPAGEA4LETTERNORTHWINDQ3 review

For developers & AI agents

A document endpoint your agent can actually call

One shape of request on every rail. Credits refuse before they overdraw, so an agent can loop safely; a render that produces no pages is refunded, not billed.

REST

POST /api/documents

Session cookie, an Authorization: Bearer ppw_live_… key, or ?api_key= where headers can't be set. Returns a signed 24-hour PDF link.

POST /api/documents
Authorization: Bearer ppw_live_…

{
  "markdown": "# Q3 review\n\nUp 18%.",
  "template": "report",
  "brand": { "name": "Northwind" }
}

→ { "document": { "pdf_url": … } }
MCP

render_document

Nine tools over Streamable HTTP. Works in Claude, Cursor, the AI SDK and the Ounie AI Team — that last one can't set headers, so the key rides the URL.

.../api/mcp?api_key=ppw_live_…

render_document    get_document
list_documents     share_document
delete_document    list_templates
get_credit_balance get_pricing
whoami
x402

Pay per call, no account

USDC on Base at $0.036 a document. A bad request is refused free, before any price is quoted; payment only settles once the PDF exists.

POST /api/x402/render

→ 402 { accepts: [{
    scheme:  "exact",
    network: "base",
    asset:   "USDC" }] }

→ retry with X-Payment
→ 200 { document: { pdf_url } }
1 page · memo3 credits3¢40 pages · report3 credits3¢FREE, ALWAYSRead it againRe-download itShare pageTemplate samplesBalance checksA render with no pagesrefunds, never settles

What it costs

3 credits. Any length.

A credit is one cent, drawn from the same Ounie wallet every Ounie app uses. Length does not change the price — per-page billing would make the cost unpredictable for exactly the caller least able to predict its own output.

3
credits per document
= 3¢ · about 33 documents per dollar
How credits work

Questions

The things people ask first

Does it need a browser or headless Chrome?

No. Pages are laid out directly with a typesetting engine, so a render takes about a second and the output is real text — selectable, searchable and copy-pasteable, not a screenshot of a web page.

What happens to HTML in my markdown?

It is dropped, and the response tells you how many tags went. There is no HTML anywhere in the pipeline: your content becomes a typed block tree and then glyphs, so a tag has nothing to escape into. If dropping the HTML leaves nothing to typeset, you get a 422 and no charge.

Can I get a web page as well as a PDF?

Yes — set share:true and the document is also published at a stable /d/<id> URL that opens instantly on a phone. It is free, opt-in per document, and revocable: unpublishing kills any link already handed out.

How long do the PDF links last?

A download link is signed for 24 hours, and reading a document mints a fresh one at no cost. The file itself is stored privately and indefinitely for account holders; x402 renders, which belong to nobody, are kept for 30 days.

Do longer documents cost more?

No. Every document is 3 credits whether it is one page or forty. Reads, re-downloads, share pages, template samples and balance checks cost nothing.

What if the render fails?

You are not charged. Credits are reserved before the work and restored to the exact pools they came from on any failure. On the x402 rail the payment is only verified before the render and settled after it, so a failed render never moves money on chain.

Stop hand-rolling HTML to PDF

One endpoint, five forms, 3 credits a document. Your first one takes about a second.

Start with your Ounie account

No subscription — pay in Ounie credits