API reference

दस्तावेज़

यह public API का product-facing reference है। वही identity, tenant, style version, avatar family, style options, size और WebP output major version के अंदर stable रहने के लिए intended हैं।

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 की जगह stable internal 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 rendering direct rendering से महंगे हैं।

Timeouts

Avatar generation और storage operations server-side timeouts से bounded हैं ताकि expensive requests origin को indefinitely monopolize न कर सकें।

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.