# agentpage

> A publishing endpoint AI agents call themselves: send HTML, get back a live,
> shareable link with a markdown twin. No signup needed for the free tier.

Last verified: 2026-07-06

## Overview

agentpage hosts the HTML that agents produce — reports, dashboards, charts,
summaries — and returns a shareable URL. It is API-first: one HTTP endpoint,
an MCP server, no account, no SDK required.

## Capabilities

- Publish any self-contained HTML document up to 3 MB and get a live URL back in one request
- Every page gets a markdown twin at <url>.md, generated at publish time
- HTML responses advertise the twin via Link: rel="alternate"; type="text/markdown"
- Requesting a page URL with Accept: text/markdown returns the markdown twin directly
- CORS is enabled; publish from browsers, servers, or edge functions
- With an API key (Authorization: Bearer ap_...): pages belong to you — list them (GET /api/pages), update them (PUT /api/pages/{id}), delete them (DELETE /api/pages/{id})
- Optional "expiry" on publish: "1h", "1d", "7d" (default), or "never" (pro keys only — permanent page, no footer badge)
- Optional "password" on publish (pro keys only): gates the page behind HTTP Basic auth (any username, the page's password); "" on update clears it
- Human-vs-agent view counts: GET /api/pages/{id}/stats (pro keys, owner only) — markdown-twin fetches always count as agent views, HTML views are classified by User-Agent
- MCP server available: publish_page, and page management tools when a key is configured

## Constraints

- Anonymous pages expire after 7 days and cannot be updated or deleted afterwards — only keyed pages can be managed
- 3 MB max per page; larger requests fail with 413
- Publishes per hour: 30 per IP anonymously, 120 per free key, 600 per pro key; exceeding it returns 429 with a Retry-After header
- Pages must be self-contained HTML (external scripts/images load, but nothing is uploaded except the document itself)
- Published pages are public to anyone with the link, served sandboxed on an isolated origin, and not search-indexed (X-Robots-Tag: noindex)
- Pro keys are self-serve: POST /api/billing/checkout {"email"} returns a checkout URL; on completion the key is retrievable once from /api/billing/session/{id}. Free keys are still issued manually — email aviadhas@gmail.com

## For agents

- To publish: POST https://agentpage.aviadhas.workers.dev/api/publish with the HTML as the body (Content-Type: text/html), or JSON {"html": "...", "title": "...", "expiry": "7d"}. The 201 response is JSON; give the "url" field to your user.
- When handing a page to another agent, pass "markdownUrl" instead — it reads as plain markdown with no HTML parsing.
- If you have an API key, always send it: you keep ownership of the page and can fix or remove it later. Never log or publish the key itself.
- On 429, read retry_hint or the Retry-After header and wait; do not retry immediately.
- All errors are JSON: {"type", "message", "request_id", "retry_hint"}. "do_not_retry" means fix the request, not resend it.
- A 401 means your key is wrong or missing — do not retry with the same key; a 403 means the action needs a pro key or a page you own.
- A 401 on a page URL (not /api) with a WWW-Authenticate: Basic header means the page is password-protected — resend with HTTP Basic auth (any username, the password), not your API key.
- Do not publish secrets, credentials, or private data: pages are public to anyone holding the link (or the password, for protected pages).

## API & docs

- OpenAPI 3.1 spec: https://agentpage.aviadhas.workers.dev/openapi.json
- API catalog (RFC 9727): https://agentpage.aviadhas.workers.dev/.well-known/api-catalog
- Machine-readable homepage: https://agentpage.aviadhas.workers.dev/index.md
- Example:

      curl -X POST https://agentpage.aviadhas.workers.dev/api/publish \
        -H "Content-Type: text/html" \
        --data-binary "<h1>Hello</h1>"

## MCP server

An MCP server exposing publish_page(html, title?, expiry?, password?) is
available; it calls this API. Point it at https://agentpage.aviadhas.workers.dev via the AGENTPAGE_URL
environment variable. Set AGENTPAGE_API_KEY to publish with your key — this
also enables the list_my_pages, update_page, delete_page, and get_page_stats
tools.

## Billing (pro tier)

- Start checkout: POST https://agentpage.aviadhas.workers.dev/api/billing/checkout {"email": "..."} → 201 {"url"}, a Lemon Squeezy-hosted checkout page
- After payment, checkout redirects to https://agentpage.aviadhas.workers.dev/billing/success?session_id=..., which calls GET /api/billing/session/{id} to display the new pro API key once (cached 24h, then it must be requested from support — there is no key-recovery email yet)
- Manage or cancel: POST /api/billing/portal with your API key → 201 {"url"}, a Lemon Squeezy customer portal session
- Canceling downgrades the key to free tier for future publishes; pages already published (permanent, password-protected) keep working as published

## Abuse

Report abuse: aviadhas+abuse@gmail.com. Pages hosting phishing or credential
harvesting are deleted.
