Skip to content

ประวัติการใช้งาน — แพลตฟอร์ม Gommo (preview) ​

Coming to Gommo platform

ฟีเจอร์นี้ ยังไม่อยู่บน Gommo public API เอกสารและ portal บนไซต์นี้เป็น preview ผ่าน dev proxy เมื่อ Gommo ship อย่างเป็นทางการ endpoint และ SDK จะอยู่บน Gommo — ไม่ใช่ dependency self-host

→ Roadmap แพลตฟอร์ม Gommo

Activity hub ใน docs portal (และตัวอย่าง usage ใน Profile) อ่าน Gommo POST /api/v2/usage-history ผ่าน gateway wrappers ข้อมูลเดียวกับ usage history ของ Gommo upstream

Endpoints ​

MethodPathAuth
POST/gateway/usage/statsAuthorization: Bearer
GET/gateway/usage/statsBearer (query params)
POST/gateway/usage/logsBearer
GET/gateway/usage/logsBearer (query params)
POST/gateway/usage/aggregateBearer
GET/gateway/usage/aggregateBearer (query params)

Upstream: action=stats หรือ action=logs บน https://api.gommo.net/api/v2/usage-history

POST stats (แนะนำ) ​

ส่ง ฟิลด์ device ใน form body (แอป browser) docs site ส่งต่อ device_id, device_name, device_info อัตโนมัติ

bash
curl.exe -X POST "http://localhost:3001/gateway/usage/stats" ^
  -H "Authorization: Bearer USER_TOKEN" ^
  -H "Content-Type: application/x-www-form-urlencoded" ^
  -d "domain=%REGISTRATION_DOMAIN%&period=30d&type=all&language=vi&device_id=UUID&device_name=Chrome%%201&device_info={...}"
Fieldค่า
period7d, 30d, 90d
typeall, image, video, audio, music
languagevi (stats)

Response data.summary: total, success, error, credit, refund, credit_net, by_type

POST logs ​

bash
curl.exe -X POST "http://localhost:3001/gateway/usage/logs" ^
  -H "Authorization: Bearer USER_TOKEN" ^
  -H "Content-Type: application/x-www-form-urlencoded" ^
  -d "domain=%REGISTRATION_DOMAIN%&period=30d&type=all&language=VI&page=1&limit=30&device_id=..."
Fieldหมายเหตุ
languageVI สำหรับ logs (ตัวพิมพ์ใหญ่)
page / limitPagination; has_more ใน response

POST aggregate (โมเดลยอดนิยม) ​

Server paginate action=logs และจัดกลุ่มตาม model (สูงสุด 50 หน้า × 100 แถว)

bash
curl.exe -X POST "http://localhost:3001/gateway/usage/aggregate" ^
  -H "Authorization: Bearer USER_TOKEN" ^
  -H "Content-Type: application/x-www-form-urlencoded" ^
  -d "domain=%REGISTRATION_DOMAIN%&period=30d&type=all&groupBy=model&top=5&device_id=..."
Fieldหมายเหตุ
groupBymodel (จำเป็น)
top1–20, default 5
maxPages1–100, default 50 (ขีด scan)
refresh1 / true — ข้าม in-memory cache และ scan logs ใหม่

Response data: scanned_jobs, pages_scanned, truncated, items[] (model, count, credit, percent), optional from_cache เมื่อจาก gateway memory cache (TTL เริ่มต้น 10 นาที, USAGE_AGGREGATE_CACHE_TTL_MS)

แมปกับ dashboard ​

UIแหล่งข้อมูล
Activity Overview KPIsaction=stats → summary
Top models (Overview)POST /gateway/usage/aggregate
Trends charts / daily tableaction=stats → chart, table[]
Explore job listรายการ action=logs
Net creditssummary.credit_net
Available creditsPOST /ai/me → balancesInfo.credits_ai

ดู Activity hub, OpenAPI และ Authentication