API Reference

Документация

Бул public API үчүн product-facing reference. Бирдей identity, tenant, style version, avatar family, style options, size жана WebP output major release ичинде stable бойдон калышы керек.

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

Operational Endpoints

GET /healthz load balancers жана uptime checks үчүн public. GET /metrics loopback-only жана non-local peers үчүн 404 кайтарат.

Namespace Support

Products же rollout phases ортосунда visual identity spaces бөлүү үчүн tenant жана style_version колдон.

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

Anonymous IDs

Raw personal data ордуна internal stable id же one-way application hash жибер.

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

Rate Limits

Public service origin-side rate limits колдонот; /v1/avatar/link, persist=true болгон direct avatar requests жана /og.png үчүн limits катуураак, анткени object storage writes жана Open Graph image rendering direct renderingден кымбатыраак.

Timeouts

Avatar generation жана storage operations server-side timeouts аркылуу bounded, ошондуктан expensive requests originди чексиз кармай албайт.

Errors

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

OpenAPI

Generated clients же tooling үчүн колдон /docs/openapi.json.