> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openp.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get usage

> GET /v1/dashboard/billing/usage — spend over a time range

Query the cumulative spend over a specified time range (in USD).

## Request

```bash theme={null}
curl "https://openp.ai/v1/dashboard/billing/usage?start_date=2026-05-01&end_date=2026-05-15" \
  -H "Authorization: Bearer $OPENPAI_API_KEY"
```

### Query parameters

| Parameter    | Type   | Required | Description                         |
| ------------ | ------ | :------: | ----------------------------------- |
| `start_date` | string |     ✅    | `YYYY-MM-DD`, inclusive of this day |
| `end_date`   | string |     ✅    | `YYYY-MM-DD`, exclusive of this day |

Maximum span 100 days.

## Response

```json theme={null}
{
  "object": "list",
  "total_usage": 12.43,
  "daily_costs": [
    {
      "timestamp": 1714521600,
      "line_items": [
        {"name": "gpt-5.5", "cost": 1.20},
        {"name": "gpt-5.5", "cost": 0.15}
      ]
    }
  ]
}
```

`total_usage` is in **USD ×100** (i.e. 12.43 = \$0.1243), consistent with OpenAI's convention.
However, the OpenPAI console / logs display in RMB; refer to the console for the exact conversion.

## Finer granularity

For per-request logs, use Console → **Logs**, or the dedicated API:

```bash theme={null}
curl "https://openp.ai/api/log/self?page=1&page_size=50" \
  -H "Authorization: Bearer $OPENPAI_USER_TOKEN"
```

It returns, for each call: model, tokens, latency, charge, Request ID, IP and more.

## Client compatibility

NextChat / ChatBox / LobeChat and others call this endpoint to display spend trends in their UI;
OpenPAI fully supports it so the client "Account info" panel works.
