NgamiaNgamiaDocs

Core product

Activity & analytics

Query gateway usage history and period summaries for the authenticated account.

Activity endpoints require a JWT. They show requests made with the account’s API keys; they do not expose activity belonging to another account.

Choose the view

Use caseEndpointWhat it returns
Show a request history tableGET /v1/activityOne row per completed, failed, or cancelled chat, embedding, transcription, speech, or combined voice stage, newest first
Build a period dashboardGET /v1/activity/summaryTotals for requests, tokens, credits, and model usage

Query the usage log

GET/v1/activityJWT

All query parameters are optional:

/v1/activity?limit=50&offset=0&workspace_id=...&model=openai/gpt-4o&status=completed
ParameterMeaning
limitMaximum number of rows to return.
offsetNumber of rows to skip when paging through older records.
workspace_idRestrict results to one workspace.
modelRestrict results to one model id, such as openai/gpt-4o.
statusFilter by completed, failed, or cancelled.

The response is a 200 array ordered newest first:

[
  {
    "id": "...",
    "workspace_id": "910e5104-f604-47d4-b194-3db2fbd83f76",
    "model": "openai/gpt-4o",
    "prompt_tokens": 12,
    "completion_tokens": 3,
    "total_tokens": 15,
    "cost_credits": 0.0247,
    "latency_ms": 842,
    "status": "completed",
    "error_code": null,
    "created_at": "2026-07-14T13:00:00Z"
  }
]

Activity fields

FieldMeaning
workspace_idWorkspace associated with the API key used for the request. Omitted when unavailable.
modelModel id selected for the gateway call.
prompt_tokens / completion_tokens / total_tokensToken counts recorded when the service reports them.
cost_creditsNgamia credits charged for a completed request or stage.
latency_msRequest latency in milliseconds.
statuscompleted, failed, or cancelled.
error_codeError code for a failed request; omitted when there is no error.
created_atTime the activity record was created, in ISO 8601 format.

Failed and cancelled requests are recorded for troubleshooting. A voice reservation is released when a stage fails or is interrupted; completed stages are recorded with their settled cost. Use error_code with the Errors page when building a support or retry view.

Build a period summary

GET/v1/activity/summaryJWT

Pass period as today, week, month, or year. The default is month:

/v1/activity/summary?period=month
{
  "total_requests": 142,
  "total_tokens": 58230,
  "total_cost_credits": 118.44,
  "period_start": "2026-07-01T00:00:00Z",
  "period_end": "2026-07-14T23:59:59Z",
  "by_model": [
    {
      "model": "openai/gpt-4o",
      "request_count": 90,
      "total_tokens": 40000,
      "total_cost_credits": 90.2
    }
  ]
}

Use the top-level totals for a “this period” card and by_model for a per-model breakdown. For an audit table, combine the summary with filtered rows from GET /v1/activity rather than trying to reconstruct individual calls from the aggregate response.

For workspace-scoped views, first obtain the workspace id from Profile & workspaces. For credit balance and ledger details, see Billing & credits.