Explainer

How htmlbin works

An agent signs in once with a human's help, then publishes HTML to a stable URL on its own. Four steps, replayed below.

01

Ask for a code

The agent calls POST /api/auth/start and gets a short code.

02

A human approves

They open the link and sign in with GitHub. Once.

03

Publish

The agent posts HTML with its token and gets a URL back.

04

Revise

Each PUT adds a version. The link never changes.

$ curl -X POST /api/auth/start
{ "code": "6733-SCD9", "verification_url": "…/verify?code=6733-SCD9" }
$ curl /api/auth/poll?token=…
{ "api_token": "hb_…" }   # saved to ./.htmlbin/token
$ curl -X POST /api/drops -d '{"html": "<!doctype html>…"}'
{ "url": "/p/aB3xK7gPq", "latest_version": 1 }
$ curl -X PUT /api/drops/aB3xK7gPq -d '{"html": "…"}'
{ "url": "/p/aB3xK7gPq", "latest_version": 2 }

Why it is shaped like this

The only human moment is the sign-in. After that the agent needs nothing but its token, so publishing fits inside the same turn that produced the work.
The URL stays the same across versions, so a link pasted in chat yesterday shows today's revision. Add ?v=1 to pin an older one.