Snippets
Hep.gg's paste service on paste.hep.gg. Create code, log, and text pastes from the CLI, ShareX, or a script with a bearer key.
Snippets is the Hep.gg paste service, live at paste.hep.gg. Post code, logs, prose, anything text, with syntax highlighting and a shareable link. Pastes can be public, unlisted, or private. You can create them three ways: in the dashboard, in the web editor at paste.hep.gg, or programmatically over HTTP with a bearer API key (the path this reference covers).
Authentication
The create endpoint accepts a bearer API key. Keys are minted in the dashboard
at dashboard/snippets/keys, never via
a public endpoint. A key looks like hepgg_pst_ followed by 32 characters, and
you send it as an Authorization: Bearer hepgg_pst_... header.
- Free accounts can have 1 active key.
- Prime accounts can have 5 active keys.
Read endpoints (GET /<id> and GET /<id>/raw) need no authentication for
public and unlisted pastes. Private pastes are readable only by their owner.
Quickstart
Create a paste with a single call. The response is a JSON envelope; the link to
share is in data.url.
curl https://paste.hep.gg/api/paste \
-H "Authorization: Bearer hepgg_pst_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"content":"hello world","language":"plaintext"}'const res = await fetch("https://paste.hep.gg/api/paste", {
method: "POST",
headers: {
Authorization: "Bearer hepgg_pst_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({ content: "hello world", language: "plaintext" }),
});
const { ok, data } = await res.json();
if (ok) console.log(data.url); // https://paste.hep.gg/<id>A successful call returns:
{
"ok": true,
"data": {
"id": "aB3dE6kp",
"url": "https://paste.hep.gg/aB3dE6kp",
"expiresAt": "2026-08-27T00:00:00.000Z",
"anonymous": false
}
}Limits by plan
Size caps and expiry depend on how the paste was created.
AnonymousFreePrimeIf Prime lapses, your pastes get a 30-day grace window to pick what stays before the 365-day free expiry applies.