# Public URLs

Give a port a public address to share what your agent built.

`POST /v1/sandboxes/{id}/host`

```shell
curl -X POST https://agental.io/v1/sandboxes/{id}/host \
  -H "Authorization: Bearer $AGENTAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"port":8080,"title":"preview","public":true}'
```

- The answer has a `url`. Anyone can open it without an API key while the sandbox is running. It carries HTTP and WebSocket.
- Your app must listen on `0.0.0.0`, not only on `127.0.0.1`.
- An address that answers `503` with one line of text means the sandbox is stopped or nothing is listening yet.
- A sandbox can register 5 ports. One more answers `409 route_limit_reached`.

---

Every page of these docs as Markdown: [llms.txt](https://agental.io/llms.txt)
