---
name: tinyhost
description: >
  tinyhost.win lets Agents publish static files to a live URL with no
  accounts. Publish a folder and get a Site at {slug}.tinyhost.win. Use
  when asked to "publish this", "host this", "deploy this folder", "put
  this online", "share this site", or "get a URL for this".
---

# tinyhost.win

tinyhost.win is identity-less static hosting for coding Agents. You **Publish** a document or a folder; it becomes a **Site** at `https://{slug}.tinyhost.win/`. There are no accounts and no API keys.

- The host assigns the **Slug**; an Agent does not choose it.
- A Site **expires seven days after create**. The Expiry is fixed — later Publishes do not extend it, and there is no way to renew a Site.
- The **Site secret** is the only credential. It is returned once at create, and it authorizes replace and delete. If it is lost, the Site can never be modified again.

## Get the CLI

For a folder of files, the CLI is the supported Publish client. Fetch it once per working directory. For a single Markdown or HTML document, use the one-call path below instead.

```bash
curl -fsSL https://tinyhost.win/publish.sh -o publish.sh && chmod +x publish.sh
```

Requires `curl` and `jq`.

## One-call Publish (no CLI)

When the content is a single document — a report, a note, a landing page — skip
the folder loop. One HTTP call creates a live Site:

```bash
curl -X POST https://api.tinyhost.win/v1/drop \
  -H "Content-Type: application/json" \
  -d '{"kind":"markdown","title":"Hello","content":"# Hi from my agent"}'
```

- `kind` is `"markdown"` or `"html"`. Markdown is rendered to HTML server-side
  (raw HTML in the source is escaped, never injected). `html` is served verbatim.
- `content` is the document body, at most 1 MB. `title` is optional (Markdown only).
- The response is `{ slug, siteUrl, siteSecret, expiresAt }`. Share `siteUrl`;
  save `siteSecret` — it authorizes replace and delete, and is shown only once.

Replace the document later (keeps the Slug, the secret, and the Expiry):

```bash
curl -X PUT https://api.tinyhost.win/v1/drop/{slug} \
  -H "Content-Type: application/json" \
  -H "X-Tinyhost-Site-Secret: {siteSecret}" \
  -d '{"kind":"markdown","content":"# Updated"}'
```

Use the folder CLI below when you have multiple files. Both paths produce the
same kind of Site and the same secret model.

## Publish a folder

```bash
./publish.sh ./my-site
```

- Prints the live `siteUrl` on stdout. Share that URL.
- Place `index.html` at the root of the folder; it is served at `/`. Every other file is served at its relative path. Missing paths are 404 — there is no directory listing.
- The Site secret is written to `.tinyhost/state.json` in the working directory. Never commit that file, never publish the folder that contains it, and never print the secret.
- Progress and `publish_result.*` details (slug, action, version, expires_at) are printed on stderr.

A single file works too: `./publish.sh ./report.pdf` serves it at `/{filename}`.

## Replace a Site

```bash
./publish.sh ./my-site --slug {slug}
```

A replace is a full-tree swap: files omitted from the new tree disappear after finalize. The Site secret is loaded from `.tinyhost/state.json`; the Expiry is unchanged.

## Delete a Site

```bash
./publish.sh --delete {slug}
```

Deleting frees the IP's live-Site slot immediately.

## What to tell the user

- Share the `siteUrl` from the current run.
- The Site expires at `publish_result.expires_at` (seven days after create) and cannot be extended.
- The Site secret lives only in `.tinyhost/state.json`; without it the Site cannot be replaced or deleted. Do not present that file path as a URL.

## Limits

10 MB per file · 50 MB and 500 files per Site · 20 live Sites per IP · 10 creates per hour · 60 replaces per hour.

Over-limit requests fail with JSON `{ "code", "message" }` and an HTTP status: `too_large` (413), `rate_limited` (429), `unauthorized` (401), `not_found` (404), `gone` (410 after Expiry), `invalid` (400).

## Reference

- HTTP API contract (the CLI implements it; call it directly only if you must): `https://tinyhost.win/openapi.yaml` — base `https://api.tinyhost.win`
- Product overview: `https://tinyhost.win/llms.txt`
