API Reference

Dokumentacija

To je product-facing reference za public API. Isti identity, tenant, style version, avatar family, style options, size in WebP output naj ostanejo stabilni znotraj 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

Operativni Endpointi

GET /healthz je public za load balancers in uptime checks. GET /metrics je loopback-only in vrne 404 za non-local peers.

Namespace Podpora

Uporabite tenant in style_version za ločevanje visual identity spaces med produkti ali 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

Anonimni ID-ji

Namesto raw personal data pošljite internal stable id ali one-way application hash.

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

Rate Limits

Public service uporablja origin-side rate limits, s strožjimi omejitvami za /v1/avatar/link, direct avatar requests s persist=true in /og.png, ker so object storage writes in Open Graph image rendering dražji kot direct rendering.

Timeouts

Avatar generation in storage operations so omejeni s server-side timeouts, da drage zahteve ne morejo neomejeno monopolizirati origin.

Napake

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

OpenAPI

Za generated clients ali tooling uporabite /docs/openapi.json.