API Reference

Dokumentácia

Toto je product-facing reference pre public API. Rovnaké identity, tenant, style version, avatar family, style options, size a WebP output majú zostať stabilné v rámci major release.

Core Endpoints

  • GET /v1/avatar: returns an avatar asset directly
  • GET /v1/avatar/link: stores the generated avatar in configured object storage and returns signed-link metadata
  • GET /avatar/<kind>/<identity>/webp: path-style public avatar URL
  • GET /docs/openapi.json: machine-readable API description

Prevádzkové Endpointy

GET /healthz je public pre load balancers a uptime checks. GET /metrics je loopback-only a vracia 404 pre non-local peers.

Namespace Podpora

Použite tenant a style_version na oddelenie visual identity spaces medzi produktmi alebo rollout phases.

GET https://hashavatar.app/v1/[email protected]&tenant=acme&style_version=v2&algorithm=sha512&kind=wizard&background=white&accessory=hat&color=deep-sea-blue&expression=cool&shape=squircle&format=webp&size=256

Anonymné ID

Namiesto raw personal data posielajte internal stable id alebo one-way application hash.

printf '%s' '[email protected]' | sha256sum | cut -d' ' -f1

Rate Limits

Public service používa origin-side rate limits, s prísnejšími limitmi pre /v1/avatar/link, direct avatar requests s persist=true a /og.png, pretože object storage writes a Open Graph image rendering sú drahšie než direct rendering.

Timeouts

Avatar generation a storage operations sú obmedzené server-side timeouts, aby drahé požiadavky nemohli neobmedzene monopolizovať origin.

Chyby

  • 400: neplatný kind, unsupported algorithm alebo format, size alebo missing identity
  • 408: generation alebo storage timeout
  • 429: rate limit exceeded
  • 500: rendering alebo storage failure

OpenAPI

Pre generated clients alebo tooling použite /docs/openapi.json.