Endpoint

GET /uses

Retrieve your API usage statistics. View token consumption, request counts, and billing information for your account.

GET /uses

Retrieve usage statistics with optional filtering and pagination.

Active

Query Parameters

{
  "start_date": "string (optional, ISO 8601)",
  "end_date": "string (optional, ISO 8601)",
  "model": "string (optional, filter by model)",
  "limit": "number (optional, default: 100)",
  "offset": "number (optional, default: 0)"
}

start_date: Filter usage from this date (ISO 8601 format)

end_date: Filter usage until this date (ISO 8601 format)

model: Filter by specific model identifier

limit: Maximum number of results to return (default: 100)

offset: Number of results to skip for pagination (default: 0)

Example Request

curl -X GET https://api.nextcraftai.com/v1/uses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response Format

{
  "data": [
    {
      "id": "usage_123",
      "date": "2024-01-15",
      "model": "gemini-2.0-flash-exp",
      "tokens": 15000,
      "requests": 45,
      "cost": 0.15
    }
  ],
  "total": {
    "tokens": 15000,
    "requests": 45,
    "cost": 0.15
  },
  "pagination": {
    "limit": 100,
    "offset": 0,
    "total": 1
  }
}

data: Array of usage entries with id, date, model, tokens, requests, and cost

total: Aggregated totals across all matching entries

pagination: Pagination metadata including limit, offset, and total count