API Reference

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

Ово је product-facing reference за public API. Исти identity, tenant, style version, avatar family, style options, size и WebP output намењени су стабилности у оквиру 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

Оперативни Endpoint-и

GET /healthz је public за load balancers и uptime checks. GET /metrics је loopback-only и враћа 404 за non-local peers.

Namespace Подршка

Користите tenant и style_version да одвојите visual identity spaces између производа или 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

Анонимни ID-јеви

Пошаљите internal stable id или one-way application hash уместо raw personal data.

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

Rate Limits

Public service примењује origin-side rate limits, са строжим лимитима за /v1/avatar/link, direct avatar requests са persist=true и /og.png, јер су object storage writes и Open Graph image rendering скупљи од direct rendering.

Timeouts

Avatar generation и storage operations ограничени су server-side timeouts како скупи захтеви не би могли бесконачно да монополизују origin.

Грешке

  • 400: неважећи 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.