How to publish the HTML your agent generates (Claude Code, Cursor, Codex)
Agents generate reports, demos and dashboards in HTML all the time, and most of them end up lost in a local folder or a chat. With Outbox each one gets its own URL, private by default and versioned, organized in your library. You can publish through the API, the MCP server, the CLI or the skill; the result is the same.
Pick how your agent publishes
| Channel | How it connects | Best for |
|---|---|---|
| MCP server | Remote connector (OAuth) or npx @out-box/mcp with a key | Claude, Cursor and any MCP client |
| Skill | npx skills add jonathanleiva15/out-box-skills | Coding agents with skills |
| CLI | npm install -g @out-box/cli, then outbox setup | Terminal, scripts and CI |
| HTTP API | POST /publish with an API key | n8n, Zapier, backends and any language |
1. Create an API key for the agent
In Outbox, under Settings → Keys, create a key for the agent. You can scope it to a folder so that agent can only publish there, and pick a publish-only preset if it doesn't need to read or share. With the remote connector or the skill there's no key to copy: you sign in through the browser.
2. Publish
A single POST with the HTML (or markdown) is enough. The slug sets the URL and the folder; if you leave it out, Outbox generates one. The model field, naming the model that generated the content, is required. It works the same from Claude Code, Cursor, Codex, a script or n8n.
curl -X POST https://api.out-box.dev/publish \
-H "Authorization: Bearer $OUTBOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"slug":"reports/sales-week-40","title":"Sales · week 40","markdown":"# Sales\n...","model":"claude"}'The same from the CLI
The CLI signs you in through the browser with outbox setup and publishes a file in one command.
npm install -g @out-box/cli outbox setup outbox publish report.html --slug reports/sales-week-40 --model claude
3. Publish to the same slug to update
When the agent publishes again to the same slug, the URL doesn't change and a new version is saved. Outbox keeps the last 15 versions: you can diff them and roll back. Republishing keeps the title, tags and visibility unless you send them again.
4. Decide who can see it
Every page starts private. You can make it unlisted (link only), public (it shows on your profile), or share it with one link per person, with a passphrase and an expiration date. When you share with a named recipient, you get an email when they open it.
Worth knowing before you automate
HTML or Markdown: HTML is served as is, isolated; Markdown is rendered server-side with your template. Size: up to 10 MB per page on Free and 25 MB on paid plans. Volume: Free allows 10 publishes a day, Pro 100 and Pro+ 500.
Secrets: if the content looks like it contains credentials, the response includes a warning; with rejectOnSecrets: true the publish is rejected before anything is written. For recurring reports, a daily document keeps one fixed URL that the agent rewrites every day.
Comparisons
Frequently asked questions
Does Outbox run the JavaScript in my page?
Yes, the HTML is served as is, in an isolated environment. Outbox has no backend for your page: it's for static pages, not apps with a database.
Can I publish from a CI job?
Yes, with the CLI or the API and a key scoped to one folder.
What if two agents publish to the same slug at once?
Each publish becomes a version. To avoid overwriting changes, send expectedVersion and Outbox rejects the publish if someone got there first.
Related guides
Updated 2026-10-11.