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.