# Hep.gg Snippets / Paste Create and share code/text pastes. Pastes are read at https://paste.hep.gg/. There is a programmatic create endpoint for CLI / ShareX use, plus a public raw reader. Base URL: https://paste.hep.gg Auth (create): Authorization: Bearer hepgg_pst_<...> The bearer is a Snippets API key, minted in the dashboard under the Snippets app -> API Keys (free: 1 key, Hep.gg Prime: 5). Anonymous create is also allowed but requires a captcha token instead of a key. ## Endpoints ### POST /api/paste Create a paste. Body (JSON): content string required. The paste body. title string optional. language string optional. Syntax-highlight language; auto-detected if omitted. visibility string optional. "public" | "unlisted" | "private". Default on this host is "public". isPermanent boolean optional. Keep the paste from expiring. Free accounts have a permanent-paste cap; over it returns an error. turnstileToken string required ONLY for anonymous (no bearer key) creates. Auth: send a Bearer snippet key for CLI / ShareX (attributes the paste to you and bumps the key's usage counters). Without a key, an anonymous paste is created after a captcha check. Response 200: { "ok": true, "data": { "id": "", "url": "https://paste.hep.gg/", "expiresAt": "", "anonymous": false } } Errors: 400 captcha failed; 401 invalid / disabled key; 403 account not approved for paste creation; plus paste-specific errors (size, permanent cap) as { "ok": false, "error": "...", "code": "..." }. ### GET /:id/raw Fetch a paste's raw content as text/plain. Public; respects the paste's visibility. The human-readable page is GET /:id (HTML). Note: the canonical API path https://paste.hep.gg/api/v1/* also works for clients that prefer it. ## Hep.gg dashboard (cookie auth - manage your pastes + keys) GET /api/v1/snippets (list your pastes) POST /api/v1/snippets { content, title?, language?, visibility?, isPermanent? } GET /api/v1/snippets/:id PATCH /api/v1/snippets/:id DELETE /api/v1/snippets/:id GET /api/v1/snippets/stats GET /api/v1/snippets/keys POST /api/v1/snippets/keys { label? } -> returns the new hepgg_pst_ key once PATCH /api/v1/snippets/keys/:id { label?, disabled? } POST /api/v1/snippets/keys/:id/rotate DELETE /api/v1/snippets/keys/:id