Usage API

Retrieve usage for the authenticated project: request counts, tokens, and estimated cost, broken down by total, today, and this month.

GET/v1/usage

Authentication

Requires a secret API key passed as a Bearer token (Authorization: Bearer carrier_sk_…).

Example request

bash
curl https://api.carrieros.ai/v1/usage -H "Authorization: Bearer carrier_sk_live_YOUR_KEY"

Response

FieldTypeDescription
requestsnumberTotal requests (all time).
successful_requestsnumberRequests that completed successfully.
failed_requestsnumberRequests that failed or were interrupted.
tokens_usednumberTotal input + output tokens.
estimated_coststringFormatted estimated cost, e.g. $0.0042.
daily_usageobjectSame fields, scoped to today.
monthly_usageobjectSame fields, scoped to this month.

Example response

json
{
  "success": true,
  "data": {
    "project_id": "carrier_proj_…",
    "requests": 12,
    "successful_requests": 11,
    "failed_requests": 1,
    "tokens_used": 8421,
    "estimated_cost": "$0.0642",
    "daily_usage":   { "requests": 3, "tokens_used": 1200, "estimated_cost": "$0.0091", "…": "…" },
    "monthly_usage": { "requests": 12, "tokens_used": 8421, "estimated_cost": "$0.0642", "…": "…" }
  }
}

Notes

Usage is always scoped to the authenticated project — you never see another project's numbers.