hashavatar.app is the public HTTP service and demo website built on top of the hashavatar crate.
It exposes deterministic avatar generation through stable URLs so the service can sit behind Cloudflare and serve cached results at the edge.
- serves a landing page at
/ - exposes a health endpoint at
/healthz - exposes a query-based avatar API at
/v1/avatar - exposes a signed object-storage link endpoint at
/v1/avatar/link - exposes a path-based avatar API at
/avatar/{kind}/{identity}/{format} - exposes OpenAPI metadata at
/docs/openapi.json
Supported formats:
webppngjpggifsvg
Supported backgrounds:
themedwhiteblackdarklighttransparent
Supported avatar families are provided by hashavatar 0.5.0, including cat, dog, robot, fox, alien, monster, ghost, slime, bird, wizard, skull, paws, planet, rocket, mushroom, cactus, frog, panda, cupcake, pizza, icecream, octopus, and knight.
Query API:
/v1/avatar?id=cat@hashavatar.app&kind=cat&background=themed&format=webp&size=256
Path API:
/avatar/cat/cat@hashavatar.app/svg
/avatar/fox/fox@hashavatar.app/png
Avatar responses are deterministic for the full request tuple:
- identity
- tenant
- style version
- avatar kind
- background mode
- output format
- size
That makes aggressive edge caching appropriate.
The service emits:
Cache-Control: public, max-age=86400, s-maxage=31536000, immutableCDN-Cache-Control: public, max-age=31536000, immutableCloudflare-CDN-Cache-Control: public, max-age=31536000, immutableETag
Requires Rust 1.95 or newer.
cargo runDefault bind:
0.0.0.0:8080
Environment variables:
PORTPUBLIC_WEBSITE_HOSTHASHAVATAR_S3_BUCKETHASHAVATAR_S3_REGIONHASHAVATAR_S3_ENDPOINTHASHAVATAR_S3_PATH_STYLEHASHAVATAR_S3_PREFIXHASHAVATAR_S3_PRESIGN_TTL_SECONDSHASHAVATAR_TRUSTED_PROXIES
HASHAVATAR_TRUSTED_PROXIES accepts a comma or whitespace separated list of IP
addresses and CIDR ranges. Forwarded client IP headers are ignored unless the
direct peer address matches this allowlist.
Recommended local checks:
cargo fmt --check
cargo check
cargo clippy --all-targets -- -D warnings
cargo audit
cargo deny checkFor self-hosting on Hetzner with Podman, see:
This service is powered by: