WaterMeter AI

ရေမီတာ OCR API

ရေမီတာ OCR API. ဤစာမျက်နှာသည် ဝက်ဘ်ဆိုက် backend မှ တတိယပါတီ ပေါင်းစည်းမှုများအတွက် HTTP API အများပြည်သူအတွက် ဖော်ပြချက်များကို မှတ်တမ်းတင်ထားသည်။

အမှန်တကယ် တင်သွင်းခြင်းဖြင့် စတင်ပါ

ပထမဦးဆုံး မှတ်ပုံတင်ပြီး၊ သင့်ရဲ့ ရေမီတာဓာတ်ပုံကို အလုပ်လုပ်ရာနေရာမှာ တင်ပါ၊ ပြီးတော့ ပေါင်းစည်းဖို့ ပြင်ဆင်တဲ့အခါ API key တစ်ခု ဖန်တီးပါ။

အနှစ်ချုပ်

  • ပြင်ပ ပေါင်းစည်းမှုများအတွက် ဝက်ဘ်ဆိုက် backend ကို အသုံးပြုပါ။
  • တတိယပါတီ waterMeterAi ပရိုဂရမ်များမှ တိုက်ရိုက် မခေါ်ပါနှင့်။
  • ဖွင့်ထားသော API သည် ဝက်ဘ်ပေါ်တယ်နှင့် တူညီသော အသုံးပြုသူများ၊ အရေအတွက်၊ ကက်ရှ်၊ တာဝန်များနှင့် စစ်ဆေးမှု စည်းမျဉ်းများကို မျှဝေသည်။
  • Backend သည် deployment config ဖြင့် မတူညီသော အောက်ဆင့် AI ဝန်ဆောင်မှုများကို ရွေးချယ်နိုင်သည်။
  • တာဝန်တုံ့ပြန်မှုများတွင် ယခုအခါ အထွေထွေ result_summary object ပါဝင်သဖြင့် မတူညီသော ဝန်ဆောင်မှုများသည် ရလဒ်အမျိုးအစားအမျိုးမျိုးကို ပြသနိုင်သည်။

အတည်ပြုခြင်း

  • ဝက်ဘ်ဆိုက်တွင် ဝင်ရောက်ပြီး API Keys စာမျက်နှာတွင် API key တစ်ခု ဖန်တီးပါ။
  • API key ကို ဖန်တီးသောအခါ တစ်ကြိမ်သာ ပြသသည်။
  • တောင်းဆိုမှုတိုင်းတွင် ခွင့်ပြုချက်ခေါင်းစဉ်ရှိ key ကို ပို့ပါ။
Authorization: Bearer wm_xxxxxxxxxxxxxxxxx

API Key Permissions and Limits

  • Each API key can have independent scopes, an IPv4/IPv6/CIDR allowlist, a total requests-per-minute limit, and a task submissions-per-minute limit.
  • A valid key without the required scope or outside its source IP allowlist returns 403.
  • Every valid-key request consumes the total request limit, including requests rejected by scope, IP, or submission policy.
  • Batch requests consume one total request unit and one submission unit per uploaded file.
  • Rate-limited responses return 429 with Retry-After and both X-RateLimit-* and X-SubmissionLimit-* headers.
  • Task creation also has a per-key concurrency limit and returns X-ConcurrencyLimit-* headers; a concurrency rejection uses 429.
  • For batch concurrency, only files that pass image validation reserve slots, and success headers report the actual active slots after task binding.
Retry-After: 30
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1785902400
X-SubmissionLimit-Limit: 10
X-SubmissionLimit-Remaining: 9
X-ConcurrencyLimit-Limit: 3
X-ConcurrencyLimit-Active: 1
X-ConcurrencyLimit-Remaining: 2

တင်သွင်းခြင်း စည်းကမ်းများ

  • အများဆုံးဖိုင်အရွယ်အစား: ပုံတစ်ပုံလျှင် 20MB။
  • ပံ့ပိုးထားသော ဖော်မတ်များ- JPEG၊ PNG၊ WEBP။
  • Backend က ဖိုင်အကြောင်းအရာကို စစ်ဆေးပေးတယ်၊ ဖိုင်နံပါတ်ကိုသာ မစစ်ဆေးဘူး။

အပ်လုဒ် အရွယ်အစား အကောင်အထည်ဖော်မှု

  • အစုလိုက်တင်ခြင်းသည် ပုံမှန်အားဖြင့် ပုံရိပ် ၈ ပုံအထိ လက်ခံနိုင်ပြီး၊ ပုံတစ်ပုံလျှင် ၂၀MB ကန့်သတ်ချက်နှင့် စုစုပေါင်း ဖိုင်အကြောင်းအရာ ၂၀MB ကန့်သတ်ချက်ရှိသည်။
  • ကန့်သတ်ချက်ကျော်လွန်သော ဖိုင် သို့မဟုတ် အုပ်စုသည် ပုံအတည်ပြုခြင်း သို့မဟုတ် တာဝန်ဖန်တီးခြင်းမပြုမီ 413 ပြန်လည်ပေးပို့သည်။ အပိုင်းပိုင်း batch မဖန်တီးပါ။
  • Backend သည် Content-Length မရှိသော်လည်း သို့မဟုတ် အပိုင်းပိုင်းလွှဲပြောင်းမှုကို အသုံးပြုသော်လည်း လက်ခံရရှိသော byte အရေအတွက်ကို အကောင်အထည်ဖော်သည်။

တာဝန်အခြေအနေများ

  • စောင့်ဆိုင်းပြီး: လက်ခံပြီး AI စောင့်ဆိုင်းနေသည်။
  • လည်ပတ်နေသည် - လက်ရှိ ဆောင်ရွက်နေဆဲဖြစ်သည်၊ သို့မဟုတ် ပို့ဆောင်သူထံ ပေးပို့ပြီးဖြစ်ပြီး နောက်ဆုံးရလဒ်အတွက် အခြေအနေကို အချိန်မှန် စစ်ဆေးနေဆဲဖြစ်သည်။
  • batch_waiting_ai: အစုလိုက်အပြုံလိုက် ပစ္စည်းတိုင်းသည် AI ဝန်ဆောင်မှု ပြန်လည်ဖွင့်လှစ်ရန် စောင့်ဆိုင်းနေသည်။
  • batch_running: အစုအဝေးကို ပို့ဆောင်သူထံ ပေးပို့ပြီး ဆက်လက်လုပ်ဆောင်နေဆဲဖြစ်သည်။
  • ပြီးစီးပြီး: အောင်မြင်စွာ ပြီးစီးခဲ့သည်။
  • မအောင်မြင်ပါ: လုပ်ငန်းစဉ် မအောင်မြင်ပါ။
  • waiting_ai: AI ဝန်ဆောင်မှု ပြန်လည်ဖွင့်လှစ်သည်အထိ စောင့်ဆိုင်းထားပြီး၊ ထို့နောက် အလိုအလျောက် ပြန်လည်စတင်သည်။

ရလဒ်ရင်းမြစ်များ

  • အသစ် - အသစ်သော AI run ဖြင့် ဖန်တီးသည်။
  • cached_exact: လက်ရှိ AI cache နှင့် ကိုက်ညီသည်။
  • cached_stale: AI အော့ဖ်လိုင်းတွင် နောက်ဆုံးသိမ်းဆည်းထားသော ရလဒ်များ ပြန်လည်ရရှိခဲ့သည်။
  • စောင့်ဆိုင်းနေဆဲ - နောက်ဆုံးရလဒ် မရှိသေးပါ။
  • မအောင်မြင်ပါ: အလုပ်တာဝန် မအောင်မြင်ပါ။
  • အလုပ်တစ်ခု မပြီးသေးပါက error_message ပြန်လည်ကြိုးစားခြင်း သို့မဟုတ် စောင့်ဆိုင်းရခြင်းအကြောင်းပြချက်ကို စစ်ဆေးပါ။

အရေအတွက်နှင့် ငွေတောင်းခံခြင်း

  • Quota မအောင်မြင်မှုကို ရှောင်ရှားရန် `GET /api/open/quota` အကြီးစား workload များ တင်သွင်းရန် မတိုင်မီ အသုံးပြုပါ။
  • `fresh` AI run တွေမှာပဲ quota သုံးတယ်။
  • `cached_exact`၊ `cached_stale`၊ `pending`နှင့် `failed` ရလဒ်များသည် အရေအတွက်ကို မစားသုံးပါ။
  • အခမဲ့အကောင့်တွေက နေ့စဉ် quota ကို ဦးစွာသုံးပါတယ်။ ပေးချေထားသော အကောင့်များသည် လှုပ်ရှားနေသော ကာလအလိုက် အရေအတွက် ပက်ကေ့ချ်များကို အသုံးပြုပြီး၊ နောက်တစ်ဆင့်တွင် နောက်ခံမူဝါဒအရ ယာယီ သို့မဟုတ် သတ်မှတ်ထားသော အရေအတွက်ကို အသုံးပြုသည်။
  • Quota ပြည့်စုံသွားသောအခါ task တင်သွင်းမှုသည် `429` ပြန်လည်ထုတ်ပေးပြီး task အသစ်ဖန်တီးခြင်းအစား error message တစ်ခု ထည့်သွင်းပေးသည်။

Cache နှင့် ရလဒ်အသစ်

  • Backend သည် အောင်မြင်သောရလဒ်များကို ပုံရိပ် hash နှင့် AI ဗားရှင်းအလိုက် သိမ်းဆည်းပြီး အောက်ဆင့်ဝန်ဆောင်မှု namespace လည်း ပါဝင်သည်။
  • `cached_exact` အဆိုပါပုံသည် လက်ရှိ AI ဗားရှင်းအတွက် အောင်မြင်မှုရရှိပြီးသားဖြစ်သောကြောင့် AI run အသစ် မလိုအပ်တော့ပါ။
  • `cached_stale` သည် AI ဝန်ဆောင်မှုသည် အော့ဖ်လိုင်းဖြစ်နေပြီး နောက်ခံသည် နောက်ဆုံးရရှိနိုင်သော သမိုင်းဝင်ရလဒ်ကို ပြန်လည်ပေးပို့သည်။
  • `is_latest_ai_version` မှားနေပါက ရလဒ်ကို အသုံးပြုနိုင်သော်လည်း ပြန်လည်သုံးသပ်နိုင်သော အတိတ်ဒေတာအဖြစ် သိမ်းဆည်းပါ။
  • အလုပ်တစ်ခုချင်းစီကို `done` quota ကို မယူသင့်ပါ။ စစ်ဆေးပြီး `result_source`။

Task completion webhooks

  • Send signed task completion events to your HTTPS endpoint with automatic retries.
  • This API key is inactive. Existing records remain available, but new, enabled, test, and secret-rotation operations are blocked.
X-WaterMeter-Webhook-Id: whev_new_event
X-WaterMeter-Webhook-Replay-Of: whev_original_event
replay_of_event_id: whev_original_event
blocked endpoint management: HTTP 409
canceled delivery status: canceled

GET/api/open/quota

လက်ရှိ အရေအတွက်နှင့် ကျန်ရှိသော အသုံးပြုမှုကို ဖတ်ရှုပါ။

တောင်းဆိုမှု ဥပမာ
curl -X GET "https://watermeterai.com/api/open/quota" \
  -H "Authorization: Bearer wm_xxxxxxxxxxxxxxxxx"
တုံ့ပြန်မှု ဥပမာ
{
  "ok": true,
  "email": "[email protected]",
  "quota": {
    "account_type": "free",
    "daily_limit": 20,
    "used": 3,
    "remaining": 17,
    "day_tag": "2026-06-01",
    "is_unlimited": false,
    "monthly_remaining": 0,
    "monthly_bonus_remaining": 0,
    "fixed_remaining": 0,
    "nearest_expire_at": null,
    "quota_summary_text": "Free daily quota: 3/20 used today. Remaining: 17."
  }
}

GET/api/open/ai-status

တာဝန်တင်သွင်းမှုနှင့် cached result fallback အတွက် public service status ကို ဖတ်ပါ။

တောင်းဆိုမှု ဥပမာ
curl -X GET "https://watermeterai.com/api/open/ai-status" \
  -H "Authorization: Bearer wm_xxxxxxxxxxxxxxxxx"
တုံ့ပြန်မှု ဥပမာ
{
  "ok": true,
  "is_online": true,
  "busy": false,
  "active_jobs": 0,
  "public_status": "online",
  "public_status_label": "online",
  "public_status_reason": "ready",
  "accepts_new_tasks": true,
  "can_return_cached_result": true,
  "queue_state": "idle",
  "queue_count": 0,
  "current_ai_version": "water_v2:wm-ai-v2-2026-06-01",
  "last_checked_at": "2026-06-01T06:15:30Z"
}

POST/api/open/tasks

ပုံတစ်ပုံတင်ပြီး တစ်ခုတည်းသော task တစ်ခု ဖန်တီးပါ။

တောင်းဆိုမှု ဥပမာ
curl -X POST "https://watermeterai.com/api/open/tasks" \
  -H "Authorization: Bearer wm_xxxxxxxxxxxxxxxxx" \
  -F "file=@D:\data\meter_001.jpg"
တုံ့ပြန်မှု ဥပမာ
{
  "ok": true,
  "task_id": "8e6c4d1f8f8348c0bc53e2e39d2dc111",
  "status": "queued",
  "result_source": "pending",
  "visibility": "private",
  "ai_online": true,
  "is_latest_ai_version": false,
  "final_reading": "-",
  "result_summary": {
    "resultKind": "unknown",
    "primaryLabel": "Result",
    "primaryValue": "-",
    "secondaryLabel": "Detail",
    "secondaryValue": "-",
    "summaryText": "No result is available yet."
  },
  "error_message": "",
  "created_at": "2026-06-01T06:16:10Z"
}

GET/api/open/tasks/{task_id}

တစ်ခုသော task status နဲ့ နောက်ဆုံးဖတ်ချက်ကို ဖတ်ပါ။

တောင်းဆိုမှု ဥပမာ
curl -X GET "https://watermeterai.com/api/open/tasks/task_a" \
  -H "Authorization: Bearer wm_xxxxxxxxxxxxxxxxx"
တုံ့ပြန်မှု ဥပမာ
{
  "ok": true,
  "task_id": "8e6c4d1f8f8348c0bc53e2e39d2dc111",
  "status": "done",
  "result_source": "fresh",
  "ai_online": true,
  "is_latest_ai_version": true,
  "final_reading": "123.45",
  "meter_type": "pointer",
  "success": "yes",
  "result_summary": {
    "resultKind": "water_meter",
    "primaryLabel": "Final Reading",
    "primaryValue": "123.45",
    "secondaryLabel": "Meter Type",
    "secondaryValue": "pointer",
    "summaryText": "Water meter recognition finished."
  },
  "error_message": "",
  "created_at": "2026-06-01T06:16:10Z"
}

GET/api/open/tasks

လက်ရှိ key user ၏ API task များကို ဖတ်ပါ။

တောင်းဆိုမှု ဥပမာ
curl -X GET "https://watermeterai.com/api/open/tasks?limit=20" \
  -H "Authorization: Bearer wm_xxxxxxxxxxxxxxxxx"
တုံ့ပြန်မှု ဥပမာ
{
  "ok": true,
  "items": [
    {
      "task_id": "8e6c4d1f8f8348c0bc53e2e39d2dc111",
      "status": "done",
      "result_source": "cached_exact",
      "final_reading": "123.45",
      "meter_type": "pointer",
      "success": "yes",
      "result_summary": {},
      "ai_online": true,
      "is_latest_ai_version": true,
      "created_at": "2026-06-01T06:16:10Z",
      "error_message": ""
    }
  ]
}

POST/api/open/batches

တစ်ခုတည်းသော တောင်းဆိုမှုတွင် ပုံများစွာ တင်ပါ။

တောင်းဆိုမှု ဥပမာ
curl -X POST "https://watermeterai.com/api/open/batches" \
  -H "Authorization: Bearer wm_xxxxxxxxxxxxxxxxx" \
  -F "files=@D:\data\meter_001.jpg" \
  -F "files=@D:\data\meter_002.jpg"
တုံ့ပြန်မှု ဥပမာ
{
  "ok": true,
  "batch_id": "5a14f4e5f6d34fdabce00e62c0dd0001",
  "status": "batch_running",
  "total_count": 2,
  "done_count": 0,
  "failed_count": 0,
  "pending_count": 2,
  "items": [
    {
      "index": 0,
      "file_name": "meter_001.jpg",
      "task_id": "task_a",
      "status": "queued",
      "result_source": "pending",
      "final_reading": "-",
      "failure_kind": "",
      "error_message": ""
    },
    {
      "index": 1,
      "file_name": "meter_002.jpg",
      "task_id": "task_b",
      "status": "queued",
      "result_source": "pending",
      "final_reading": "-",
      "failure_kind": "",
      "error_message": ""
    }
  ]
}

GET/api/open/batches/{batch_id}

အစုလိုက်လုပ်ဆောင်မှု တိုးတက်မှုနှင့် ဖိုင်တစ်ခုချင်းစီ၏ task အခြေအနေများကို ဖတ်ရှုပါ။

တောင်းဆိုမှု ဥပမာ
curl -X GET "https://watermeterai.com/api/open/batches/5a14f4e5f6d34fdabce00e62c0dd0001" \
  -H "Authorization: Bearer wm_xxxxxxxxxxxxxxxxx"
တုံ့ပြန်မှု ဥပမာ
{
  "ok": true,
  "batch_id": "5a14f4e5f6d34fdabce00e62c0dd0001",
  "status": "batch_done",
  "total_count": 2,
  "done_count": 2,
  "failed_count": 0,
  "pending_count": 0,
  "items": [
    {
      "index": 0,
      "file_name": "meter_001.jpg",
      "task_id": "task_a",
      "status": "done",
      "result_source": "fresh",
      "final_reading": "123.45",
      "failure_kind": "",
      "error_message": ""
    },
    {
      "index": 1,
      "file_name": "meter_002.jpg",
      "task_id": "task_b",
      "status": "done",
      "result_source": "cached_exact",
      "final_reading": "456.78",
      "failure_kind": "",
      "error_message": ""
    }
  ]
}

အကြံပြုထားသော စီးဆင်းမှု

  • ကြီးမားသော `GET /api/open/ai-status` ပို့ရန်မတိုင်မီ စစ်ဆေးပါ။
  • တင်သွင်းပြီးနောက် `task_id` `batch_id` သို့မဟုတ် ကို သင့်ကိုယ်ပိုင်စနစ်တွင် ချက်ချင်းသိမ်းဆည်းပါ။
  • `queued`, `running`, `waiting_ai`, `batch_waiting_ai`နှင့် `batch_running` ကို နောက်ဆုံးမဟုတ်သော အခြေအနေများအဖြစ် သတ်မှတ်ပြီး အခြေအနေကို အချိန်မှန် ဆက်လက်စစ်ဆေးပါ။
  • Backend သို့ ကွန်ရက်လမ်းကြောင်း latency မြင့်ပြီး တပ်ဆင်ထားသော ဝန်ဆောင်မှုက batch mode ကို ထောက်ပံ့သည့်အခါ batch တောင်းဆိုမှုများကို အသုံးပြုပါ။
  • လက်ရှိတွင် အစုလိုက်တောင်းဆိုမှုများသည် `webBackend -> dispatchCenter -> waterMeterAi`
  • `batch_waiting_ai` အရာအားလုံးသည် AI ဝန်ဆောင်မှုကို မလုပ်ဆောင်သေးဘဲ စောင့်ဆိုင်းနေဆဲဖြစ်သည်။
  • တပ်ဆင်ထားသော ဝန်ဆောင်မှုသည် `CAD` ဖြစ်ပါက လောလောဆယ် `POST /api/open/tasks` ကို အသုံးပြုပြီး batch upload ကို မရရှိနိုင်ဟု သတ်မှတ်ပါ။

အမှားမှတ်စုများ

  • 400: တောင်းဆိုမှု မမှန်ကန်ပါ၊ သို့မဟုတ် တပ်ဆင်ထားသော ဝန်ဆောင်မှုသည် batch upload ကို မထောက်ပံ့ပါ။
  • 401: API သော့ မရှိခြင်း၊ မမှန်ကန်ခြင်း၊ သက်တမ်းကုန်ဆုံးခြင်း သို့မဟုတ် ပိတ်ထားခြင်း။
  • 403: the user account is not active, the key lacks the required scope, or the source IP is outside the key allowlist.
  • 404: အလုပ် သို့မဟုတ် အုပ်စု မတွေ့ရှိရ၊ သို့မဟုတ် လက်ရှိအသုံးပြုသူမှ မပိုင်ဆိုင်ပါ။
  • 413: ဖိုင်အရွယ်အစားကြီးလွန်းသည်။
  • 415: မထောက်ပံ့သော ပုံအမျိုးအစား သို့မဟုတ် မမှန်ကန်သော ပုံအကြောင်းအရာ။
  • 429: quota exhausted or the API key request, submission, or concurrency limit was exceeded.
400 အစုလိုက်တင်သွင်းမှု မရရှိနိုင်ပါ
{
  "detail": "batch upload is not supported for business: cax"
}
401 API သော့ မရှိခြင်း သို့မဟုတ် မမှန်ကန်ခြင်း
{
  "ok": false,
  "error": "unauthorized",
  "message": "Missing or invalid API key."
}
413 ဖိုင်ကြီးလွန်းသည်
{
  "ok": false,
  "error": "file_too_large",
  "message": "Maximum file size is 20MB."
}
429 ကိုတာပြီးဆုံးသွားပြီ
{
  "ok": false,
  "error": "quota_exhausted",
  "message": "Quota exhausted.",
  "quota": {
    "remaining": 0,
    "quota_summary_text": "Free daily quota: 20/20 used today. Remaining: 0."
  }
}

လုပ်ငန်းစဉ်ကို စမ်းသပ်ဖို့ ပြင်ဆင်ပြီးပြီလား?

ပထမဆုံးဓာတ်ပုံအတွက် ဝက်ဘ်အလုပ်ခန်းကို အသုံးပြုပြီး၊ ရလဒ်ဖော်မတ်သည် သင့်စနစ်နှင့် ကိုက်ညီသည့်အခါ API သော့များသို့ ရွှေ့ပါ။