API referenceObservability

List Usage

GET
/v1/admin/usage

Ledger rows, newest first: a project's, or the caller's own workspace's.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Bearer credential. API keys look like sqk_<geo>_<key_id>_<secret>: treat them as opaque and never put one in a browser. Older keys without the geo part stay valid until rotated. Find a geo's endpoints through GET /.well-known/sparq-discovery before sending a key.

Query Parameters

project_id?|null
credential_id?|null
since?|null
until?|null
cursor?|

From the previous page.

Header Parameters

Sparq-Workspace?string

For a person signed in to a console with several workspaces: the workspace this call is for, one of their memberships (listMyMemberships). Without it such a person gets workspace_required (400); a workspace they are not a member of is forbidden. It never grants anything, and other callers' credentials ignore it.

Formatuuid

Response Body

Successful Response

application/json
  1. response
items*array<>
next_cursor*string|null
Example Request
curl -X GET 'http://dev-sparq.centralindia.cloudapp.azure.com:8000/v1/admin/usage'
Example Response
{  "items": [    {      "usage_id": "fb86d280-0604-4bf0-8407-74c68cfb319d",      "attribution": {        "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",        "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",        "environment": "string",        "release_id": "51d53377-463c-43a4-a864-f9b3ed9178de",        "audience_tenant_id": "0287c3f7-886a-49f4-a73e-03577e798c26",        "user_ref": "string",        "credential_id": "13c40afa-2996-4a0c-b2e9-68fba9462242",        "cost_centre": "string",        "agent": "string",        "agent_version": "1.4.0",        "skills": [          "string"        ],        "workflow": "string",        "run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",        "parent_run_id": "f8faf8c1-9778-49a4-9004-628cdb0047e5",        "session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82",        "environment_id": "40ef0e48-a11f-4963-a229-e396c9f7e7c4"      },      "call": {        "kind": "chat",        "provider": "string",        "deployment": "string",        "model_version": "string",        "tool": "tickets.get"      },      "quantities": {        "input_tokens": 0,        "output_tokens": 0,        "cached_tokens": 0,        "reasoning_tokens": 0,        "requests": 1,        "tool_units": 0      },      "money": {        "price_table_version": "string",        "estimated_cost_usd": "string",        "billed_cost_usd": "string",        "effective_cost_usd": "string"      },      "timing": {        "started_at": "2019-08-24T14:15:22Z",        "latency_ms": 0,        "time_to_first_token_ms": 0,        "status": "ok"      },      "routing": {        "compliance_profile_version": 0,        "rules_applied": [          "string"        ],        "removed": [          {            "deployment": "string",            "reason": "string"          }        ],        "chosen_deployment": "string",        "region": "string",        "fallback_used": true      },      "adjustments": [        {          "kind": "string",          "amount_usd": "string",          "source_ref": "string",          "recorded_at": "2019-08-24T14:15:22Z"        }      ]    }  ],  "next_cursor": "string"}