Serving and embeds
How uploaded files are served (GET /:ID), custom domains and *.hep.gg hosts, social-media OpenGraph embeds, and the oEmbed companion document.
Serving and embeds
Once a file or shortlink is stored, it is served back from your account's host with no authentication. This page covers the public serve route, where it can be hosted, and how social platforms render rich embeds.
Serve a file or shortlink
https://i.hep.gg/:IDPublicFully public, no token required. The :ID slug is matched (with or without a file extension) against your stored uploads.
- File rows stream the stored object with its content type.
- Shortlink rows issue a
302redirect to the target URL. - Social crawlers may receive an HTML embed page instead of raw bytes (see Social embeds).
IDabc123 and abc123.png resolve to the same upload.embed?embed=raw forces the raw bytes and bypasses the social-embed HTML path. Crawlers fetch this variant to get the actual media for a preview.# Stream the file
curl -L https://i.hep.gg/abc123.png --output out.png
# Force raw bytes (skip any embed HTML)
curl -L "https://i.hep.gg/abc123.png?embed=raw" --output out.pngEach successful serve records a best-effort analytics view (IP, referrer, accept-language, user-agent) and increments the upload's view count. If the slug does not resolve, or the request host is not authorized for the owner, the request falls through to the catch-all rather than returning a JSON 404: on hep.gg it renders the standard 404 page, and on custom domains it redirects to the home page.
Hosts and custom domains
A file is served only on hosts that are authorized for its owner. The candidate hosts are:
i.hep.gg- the default serve host for every account.- Your
*.hep.ggsubdomain slot - always allowed for your own uploads. - Registered custom CDN domains - a domain is allowed if it is public, or premium-and-the-owner-is-premium, or owned by the uploader.
Add and verify custom domains from the uploader Domains subpage in the dashboard. Custom domains exist only to serve GET /:ID: a request to a custom domain's root path is redirected to https://hep.gg/.
Social embeds
When a known social or messaging crawler requests a file, and the owner has the embed proxy enabled, and the file is an image or video, the serve route returns an HTML page with OpenGraph and Twitter meta tags instead of the raw bytes. This is what produces rich link previews in chat apps. Regular browsers (and crawlers when the embed proxy is off) always get the file itself.
The embed proxy is opt-in and configured from the dashboard. When it is on:
- The response is
text/htmlwithCache-Control: private, no-store. og:imagepoints back at the same URL with?embed=rawso the crawler fetches the real media.- Video files additionally get
og:videoand a Twitter player card; images getsummary_large_image. - Title, description, and theme color come from your embed settings.
Crawlers detected for this path include Discord, Twitter/X, Slack, Telegram, Facebook, LinkedIn, Skype, WhatsApp, Google, Bing, Yandex, and Pinterest.
oEmbed companion
https://i.hep.gg/:ID/oembed.jsonPublicThe embed HTML links to an oEmbed document at /:ID/oembed.json. Discord and other oembed-aware crawlers fetch it to populate the author line and provider footer of a rich embed. It only returns data when the upload is a file, the owner has the embed proxy enabled, the request host is authorized for that owner, and the file is an image or video. Otherwise the request passes through with no JSON.
curl https://i.hep.gg/abc123/oembed.json{
"version": "1.0",
"type": "photo",
"author_name": "@username",
"author_url": "https://i.hep.gg",
"provider_name": "Powered by Hep.gg",
"provider_url": "https://hep.gg"
}version"1.0".type"photo" for images, "video" for video files.author_name@<username> of the uploader, or anonymous if the account has no username.author_urlhttps://<request-host>, the host the embed was served from.provider_name"Powered by Hep.gg".provider_url"https://hep.gg".Lifetime upload counter
https://hep.gg/uploadCounterPublicA legacy, unauthenticated endpoint that returns the lifetime number of uploads across Hep.gg (current uploads plus lifetime hard-deletes). It is kept for older integrations and intentionally returns a raw shape outside the standard envelope.
curl https://hep.gg/uploadCounter{
"count": 1048576
}On failure it returns 500 with { "error": "<message>" }.