Usage

Query credit balance, consumption totals, and per-route usage breakdown.

GET /v1/usage

Authentication: API key required

Returns credit balance, aggregate usage statistics, daily breakdowns, and recent generation requests for the authenticated organization.

Example

curl https://api.pipevideo.co/v1/usage \
  -H "Authorization: Bearer pv_your_api_key"

Response

{
  "credit_balance": 5000,
  "totals": {
    "total_requests": 142,
    "completed_requests": 128,
    "failed_requests": 14,
    "total_cost_cents": 1850
  },
  "daily_usage": [
    {
      "date": "2026-06-08",
      "request_count": 24,
      "completed_count": 22,
      "failed_count": 2,
      "total_cost_cents": 320,
      "total_duration_seconds": 1840
    }
  ],
  "daily_usage_by_route": [
    {
      "date": "2026-06-08",
      "routes": [
        {
          "engine": "hyperframes",
          "model": "moonshotai/kimi-k2.5",
          "provider": "pipevideo",
          "request_count": 24,
          "completed_count": 22,
          "failed_count": 2,
          "total_cost_cents": 320,
          "total_prompt_tokens": 28800,
          "total_completion_tokens": 81600,
          "avg_latency_ms": 52000
        }
      ]
    }
  ],
  "recent_requests": [
    {
      "id": "gen_abc123xyz",
      "status": "completed",
      "model_name": "moonshotai/kimi-k2.5",
      "engine": "hyperframes",
      "cost_cents": 12,
      "latency_ms": 58000,
      "created_at": 1709827200000,
      "completed_at": 1709827260000
    }
  ]
}

Response fields

FieldTypeDescription
credit_balancenumberCurrent balance in cents
totalsobjectAggregate request counts and total cost
daily_usagearrayPer-day request and cost summary
daily_usage_by_routearrayPer-day breakdown by engine, model, and provider
recent_requestsarrayLatest generations with status, cost, and latency

Use cases

  • Display remaining balance in your application's admin panel
  • Build internal cost dashboards from daily_usage_by_route
  • Alert when credit_balance drops below a threshold
  • Audit recent generation activity