Health
Ping endpoint + rate limit status. ใช้ verify ว่า key ยัง active + service ยังทำงาน
GET /v1/health
Example
curl "https://api.smongrot.com/v1/health" \
-H "Authorization: Bearer sk_live_..."
{
"data": {
"status": "ok",
"version": "v1",
"key_id": "7f8cae4c-ca58-4dc1-8393-32593d1a3ece",
"rate_limit_per_day": 1000
}
}
Response fields
| Field | Type | หมายถึง |
|---|---|---|
status | "ok" | Service healthy |
version | string | API version (currently "v1") |
key_id | uuid | ID ของ key ที่ใช้ยิง — verify ว่าใช้ key ที่ถูก |
rate_limit_per_day | int | โควตาต่อวันของ key นี้ |
Use cases
- CI check — ยิงก่อน deploy เพื่อ verify key ถูก config
- Debug — ถ้า endpoint อื่น 401 → ยิง
/healthก่อน เพื่อแยกว่า auth ผิดหรือ endpoint bug - Monitor — cron ทุก 5 นาที เพื่อ alert ถ้า down
Rate limit consumed
Health request ก็หัก 1 จากโควตา — อย่า poll ถี่เกินไป (max 1 req/นาที)