ජල මීටර OCR API
ජල මීටර OCR API. මෙම පිටුව තෙවන පාර්ශවීය ඒකාබද්ධ කිරීම් සඳහා වෙබ් අඩවියේ පසුපස අන්තය විසින් නිරාවරණය කරන ලද මහජන HTTP API ලේඛනගත කරයි.
සැබෑ උඩුගත කිරීමකින් ආරම්භ කරන්න
පළමුව ලියාපදිංචි වන්න, වැඩබිමේ ඔබේම ජල මීටර ඡායාරූපයක් උඩුගත කරන්න, ඉන්පසු ඔබ ඒකාබද්ධ කිරීමට සූදානම් වූ විට API යතුරක් සාදන්න.
දළ විශ්ලේෂණය
- සියලුම බාහිර සංකලනයන් සඳහා වෙබ් අඩවිය පසුබිම භාවිතා කරන්න.
- තෙවන පාර්ශවීය වැඩසටහන් වලින් කෙලින්ම waterMeterAi අමතන්න එපා.
- විවෘත API වෙබ් ද්වාරය ලෙස එකම පරිශීලකයින්, කෝටා, හැඹිලි, කාර්යයන් සහ විගණන නීති බෙදා ගනී.
- යෙදවුම් වින්යාසය අනුව පසුබිමට විවිධ පහළ AI සේවා තෝරාගත හැකිය.
- කාර්ය ප්රතිචාරවල දැන් සාමාන්ය result_summary වස්තුවක් ඇතුළත් වන අතර එමඟින් විවිධ සේවාවලට විවිධ ප්රතිඵල වර්ග පෙන්විය හැකිය.
සත් යාපනය
- වෙබ් අඩවියට පුරනය වී API යතුරු පිටුවේ API යතුරක් සාදන්න.
- සම්පූර්ණ API යතුර එය නිර්මාණය කරන විට පෙන්වනු ලබන්නේ එක් වරක් පමණි.
- සෑම ඉල්ලීමකදීම යතුර Authorization ශීර්ෂයේ යවන්න.
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.
- පසුපෙළ ගොනු දිගුව පමණක් නොව සැබෑ ගොනු අන්තර්ගතය වලංගු කරයි.
උඩුගත කිරීමේ ප්රමාණය බලාත්මක කිරීම
- කණ්ඩායම උඩුගත කිරීම් පෙරනිමියෙන් රූප 8 ක් දක්වා පිළිගනී, එක් රූපයකට 20MB සීමාව සහ 20MB මුළු ගොනු අන්තර්ගත සීමාවක් සමඟ.
- එහි සීමාව ඉක්මවා යන ගොනුවක් හෝ කණ්ඩායමක් රූප වලංගු කිරීම හෝ කාර්යය නිර්මාණය කිරීමට පෙර 413 ආපසු පැමිණේ; අර්ධ කණ්ඩායමක් නිර්මාණය කර නැත.
- Content-Length නොමැති විට හෝ කොටස් හුවමාරුව භාවිත කළ විට පවා පසුබිම සැබවින්ම ලැබුණු බයිට් ගණනේ සීමාව ක්රියාත්මක කරයි.
කාර්ය රාජ්යයන්
- queued: පිළිගෙන ඇති අතර AI සැකසීම සඳහා රැඳී සිටී.
- running: දැනට සැකසෙමින් පවතී, නැතහොත් යොමුකරුට භාර දුන් පසු අවසාන ප්රතිඵලයේ තත්ත්වය නිතර පරීක්ෂා කෙරේ.
- batch_waiting_ai: කණ්ඩායමේ සෑම අයිතමයක්ම AI සේවාව නැවත මාර්ගගතව පැමිණෙන තෙක් බලා සිටී.
- batch_running: කණ්ඩායම දැනටමත් පිටත් කරන්නාට භාර දී ඇති අතර තවමත් සැකසෙමින් පවතී.
- done: සාර්ථකව සම්පූර්ණයි.
- failed: සැකසීම අසාර්ථක විය.
- waiting_ai: AI සේවාව නැවත සබැඳි වන තෙක් පෝලිමේ රැඳෙන අතර, පසුව ස්වයංක්රීයව දිගටම ක්රියාත්මක වේ.
ප්රතිඵල මූලාශ්ර
- fresh: නව AI ධාවනයකින් ජනනය විය.
- cached_exact: වත්මන් AI අනුවාදය හැඹිලි ගැලපේ.
- cached_stale: නොබැඳි AI , නවතම හැඹිලි ප්රතිඵලය ආපසු.
- pending: අවසාන ප්රතිඵලයක් තවම නැත.
- failed: කාර්යය අසාර්ථක විය.
- කාර්යය තවම අවසන් වී නොමැති නම්, නවතම නැවත උත්සාහ කිරීමේ හෝ රැඳී සිටීමේ හේතුව සඳහා error_message පරීක්ෂා කරන්න.
කෝටා සහ බිල්පත්
- ඔබේ ඒකාබද්ධ කිරීමේදී කෝටා අසාර්ථක වීම් වළක්වාගත යුතු නම්, විශාල වැඩ ප්රමාණයක් ඉදිරිපත් කිරීමට පෙර `GET /api/open/quota` භාවිත කරන්න.
- කෝටාව පරිභෝජනය කරන්නේ ලකුණු `fresh` AI ක් පමණි.
- `cached_exact`, `cached_stale`, `pending`සහ `failed` ප්රතිඵල කෝටා පරිභෝජනය නොකරයි.
- නොමිලේ ගිණුම් පළමුව දෛනික කෝටාව භාවිත කරයි. ගෙවන ගිණුම් පළමුව සක්රීය ආවර්තිතා කෝටා පැකේජද, පසුව පසුබිම් සේවා ප්රතිපත්තිය අනුව තාවකාලික හෝ ස්ථාවර කෝටාවද භාවිත කරයි.
- කෝටාව අවසන් වූ විට, කාර්යය ඉදිරිපත් කිරීම `429` නැවත පැමිණෙන අතර නව කාර්යයක් නිර්මාණය කිරීම වෙනුවට දෝෂ පණිවිඩයක් ඇතුළත් වේ.
හැඹිලි සහ ප්රතිඵල නැවුම් බව
- පසුබිම රූප හැෂ් සහ AI අනුවාදය අනුව සාර්ථක ප්රතිඵල හැඹිලිගත කරයි; එයට පහළ සේවාවේ namespace ද ඇතුළත් වේ.
- `cached_exact` යනු වත්මන් AI අනුවාදය සඳහා එම රූපයට දැනටමත් සාර්ථක ප්රතිඵලයක් ඇති බැවින් නව AI ධාවනයක් අවශ්ය නොවූ බවයි.
- `cached_stale` යනු AI සේවාව නොබැඳි බැවින් පසුබිම් සේවාව පවතින නවතම ඓතිහාසික ප්රතිඵලය ලබාදුන් බවයි.
- `is_latest_ai_version` අගය false නම්, ප්රතිඵලය භාවිත කළ හැකි නමුත් සමාලෝචනය කළ යුතු ඓතිහාසික දත්ත ලෙස ගබඩා කරන්න.
- සෑම `done` කාර්යයක්ම කෝටාව භාවිත කළ බව උපකල්පනය නොකරන්න; `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
/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
/api/open/ai-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
/api/open/tasksඑක් රූපයක් උඩුගත කර තනි කාර්යයක් සාදන්න.
ඉල්ලීම් උදාහරණය
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}
/api/open/tasks/{task_id}එක් කාර්යයක් තත්වය සහ අවසාන කියවීම කියවන්න.
ඉල්ලීම් උදාහරණය
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
/api/open/tasksවත්මන් API ප්රධාන පරිශීලකයා සතු මෑත කාර්යයන් කියවන්න.
ඉල්ලීම් උදාහරණය
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
/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}
/api/open/batches/{batch_id}කණ්ඩායමේ ප්රගතිය සහ එක් එක් ගොනුවේ කාර්ය තත්ත්ව කියවන්න.
ඉල්ලීම් උදාහරණය
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` අවසන් නොවන තත්ත්ව ලෙස සලකා තත්ත්වය පරීක්ෂා කරගෙන යන්න.
- පසුබිමට ඇති ජාල මාර්ගයේ වැඩි ප්රමාදයක් තිබේ නම් සහ යෙදවූ සේවාව කණ්ඩායම් මාදිලියට සහාය දක්වන්නේ නම් කණ්ඩායම් ඉල්ලීම් භාවිත කරන්න.
- කණ්ඩායමේ ඉල්ලීම් දැනට `webBackend -> dispatchCenter -> waterMeterAi`හරහා ගලා යයි.
- `batch_waiting_ai` යනු සෑම අයිතමයක්ම තවම AI සේවාව සඳහා බලා සිටින අතර ධාවනය තවම ආරම්භ වී නැති බවයි.
- යෙදවූ සේවාව `CAD` වන විට, දැනට `POST /api/open/tasks` භාවිත කර කණ්ඩායම් උඩුගත කිරීම නොලැබෙන බව සලකන්න.
දෝෂ සටහන්
- 400: වලංගු නොවන ඉල්ලීමක්, හෝ යෙදවූ සේවාව කණ්ඩායම් උඩුගත කිරීමට සහාය නොදක්වයි.
- 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 යතුරු වෙත යන්න.