Skip to main content
The usage endpoint returns a summary of your API activity for a given time window, including the total number of requests made and the total tokens consumed. You can filter the results by date range or by a specific model to understand exactly how your usage is distributed across the Pinaivu network.

Endpoint

GET https://api.pinaivu.com/v1/usage

Query Parameters

start_date
string
The start of the reporting window in ISO 8601 format (e.g. 2024-04-01). Defaults to 30 days before today.
end_date
string
The end of the reporting window in ISO 8601 format (e.g. 2024-04-30). Defaults to today.
model
string
Filter results to a single model ID (e.g. llama3.2:3b). When omitted, the response includes usage across all models.

Example Request

cURL
curl "https://api.pinaivu.com/v1/usage?start_date=2024-04-01&end_date=2024-04-30" \
  -H "Authorization: Bearer sk-pnv-..."

Response

total_requests
integer
The total number of API calls made during the requested period.
total_tokens
integer
The total number of tokens consumed (prompt plus completion) across all requests in the period.
by_model
array
A per-model breakdown of activity. Each entry in the array corresponds to one model that received at least one request during the period.
Example response
{
  "total_requests": 1842,
  "total_tokens": 2371504,
  "by_model": [
    {
      "model": "llama3.2:3b",
      "requests": 1390,
      "tokens": 1984210
    },
    {
      "model": "llama3.2:1b",
      "requests": 452,
      "tokens": 387294
    }
  ]
}