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
| Field | Type | Description |
|---|---|---|
| requests | number | Total requests (all time). |
| successful_requests | number | Requests that completed successfully. |
| failed_requests | number | Requests that failed or were interrupted. |
| tokens_used | number | Total input + output tokens. |
| estimated_cost | string | Formatted estimated cost, e.g. $0.0042. |
| daily_usage | object | Same fields, scoped to today. |
| monthly_usage | object | Same 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.