Sharing & Embeds
Sharing is off by default. Turning it on mints a random share id — an unguessable UUID that acts as the public, read-only key to that bot’s numbers. Everything on this page is addressed by that id, so nothing is exposed until you opt in.
Enable it from the bot’s Settings → Sharing page, or via the API:
curl -X POST -H "Content-Type: application/json" \
-d '{"enabled": true}' \
--cookie "$SESSION" \
https://mochi.example.com/api/bots/$BOT_ID/share{ "shareId": "0f9c4c2e-6a1b-4a0e-9f4b-2d8c1e7a55b1" }Disabling sets shareId to null.
Disabling and re-enabling issues a fresh id. That revokes every old link, badge, and embed — which is exactly how you rotate a share id that leaked.
Public dashboard
https://mochi.example.com/share/{shareId}A read-only version of the bot’s overview: server count, command volume, unique users, error rate, and the growth charts. No account needed, nothing editable, no raw user ids (Mochi never stores them).
Badges
GET /api/badge/{shareId}An SVG stat badge for a README or website. Responses are cached for 5 minutes.
| Parameter | Values | Default |
|---|---|---|
metric | servers, commands, users, uptime | servers |
range | 24h, 7d, 30d, 90d | 30d |
format | svg, shields | svg |
servers is the current count and ignores range; the rest are range
aggregates and say so in the label (commands (7d)). uptime renders n/a
when there are no health snapshots in the range. An unrecognized metric falls
back to servers.

shields.io
?format=shields returns a shields.io endpoint badge JSON payload
instead of SVG, so you can restyle it with shields’ own flags:
Remember to URL-encode the query string of the inner URL (? → %3F,
& → %26).
Embeddable widget
https://mochi.example.com/share/{shareId}/widgetA compact stat card (~640×130) showing servers, commands, unique users, and error rate — designed to be dropped into an iframe on a bot-list page.
| Parameter | Values | Default |
|---|---|---|
range | 24h, 7d, 30d, 90d | 30d |
theme | light, dark | light |
<iframe
src="https://mochi.example.com/share/0f9c4c2e-…/widget?range=7d&theme=dark"
width="640" height="130" frameborder="0" loading="lazy"
></iframe>The card links back to the full public dashboard.
Need the numbers as data rather than pixels? The Stats API returns JSON — but it authenticates with your API key, so keep it server-side.