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 အတွက် object storage writes နှင့် Open Graph image rendering သည် direct rendering ထက် costly ဖြစ်သောကြောင့်ပိုတင်းကျပ်သော limits ရှိသည်။

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.