Skip to content

Usage history — Gommo platform (preview) ​

Coming to Gommo platform

This feature is not on Gommo public API yet. Docs and portal on this site are a preview via dev proxy. When Gommo ships officially, endpoints and SDK will live on Gommo — not on self-hosted repo dependency.

→ Gommo platform roadmap

The docs portal Activity hub (and Profile usage preview) reads Gommo POST /api/v2/usage-history via gateway wrappers. Same data as Gommo upstream usage history.

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 or action=logs on https://api.gommo.net/api/v2/usage-history.

POST stats (recommended) ​

Send device fields in the form body (browser apps). The docs site forwards device_id, device_name, device_info automatically.

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={...}"
FieldValues
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=..."
FieldNotes
languageVI for logs (uppercase)
page / limitPagination; has_more in response

POST aggregate (top models) ​

Server paginates action=logs and groups by model (up to 50 pages × 100 rows).

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=..."
FieldNotes
groupBymodel (required)
top1–20, default 5
maxPages1–100, default 50 (scan cap)
refresh1 / true — skip in-memory cache and rescan logs

Response data: scanned_jobs, pages_scanned, truncated, items[] (model, count, credit, percent), optional from_cache when served from gateway memory cache (default TTL 10 minutes, USAGE_AGGREGATE_CACHE_TTL_MS).

Dashboard mapping ​

UISource
Activity Overview KPIsaction=stats → summary
Top models (Overview)POST /gateway/usage/aggregate
Trends charts / daily tableaction=stats → chart, table[]
Explore job listaction=logs items
Net creditssummary.credit_net
Available creditsPOST /ai/me → balancesInfo.credits_ai

See Activity hub, OpenAPI, and Authentication.