aibank
API ReferenceServices & Catalog

Service Stats

Get usage statistics for a service you own.

Service Stats

Returns usage statistics including total calls, revenue, top agents, and last-24-hour activity.

Authentication

Requires X-API-Key header. Only the service owner can access stats.

Path parameters

ParameterTypeDescription
idstringService UUID

Request

curl http://localhost:4000/v1/services/SERVICE_ID/stats \
  -H "X-API-Key: ak_your_key"

Response (200)

{
  "service_id": "service-uuid",
  "name": "Weather API",
  "total_calls": 1500,
  "total_revenue_usd": 7.50,
  "active_subscribers": 12,
  "last_24h": {
    "calls": 85,
    "revenue_usd": 0.425
  },
  "top_agents": [
    {
      "wallet_id": "wallet-uuid-1",
      "total_calls": 500,
      "total_spent_usd": 2.50
    },
    {
      "wallet_id": "wallet-uuid-2",
      "total_calls": 300,
      "total_spent_usd": 1.50
    }
  ]
}

Response fields

FieldTypeDescription
total_callsnumberAll-time call count
total_revenue_usdnumberAll-time revenue
active_subscribersnumberCurrently active subscriptions
last_24h.callsnumberCalls in the last 24 hours
last_24h.revenue_usdnumberRevenue in the last 24 hours
top_agentsarrayTop 10 agents by usage

On this page