# How to publish the HTML your agent generates (Claude Code, Cursor, Codex)

> Have Claude Code, Cursor, Codex or any agent publish HTML pages to their own URL, private by default and versioned, with the Outbox API.

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

## 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

- [Outbox vs Stacktree](https://out-box.dev/en/guides/vs/stacktree)
- [Outbox vs Claude Artifacts](https://out-box.dev/en/guides/vs/claude-artifacts)
- [Outbox vs Derive](https://out-box.dev/en/guides/vs/derive)

---

Updated 2026-10-11. HTML version: https://out-box.dev/en/guides/publish-html-from-claude-code-cursor-codex
