# Usage

The usage resource returns API consumption statistics for the authenticated API key.

```
GET  /v1/usage

Get API usage for current billing period

Required plan: Free
```

Returns usage statistics including total requests, quota utilization, and per-endpoint breakdown for the current calendar month.

### Authentication

Required — pass API key in the X-API-Key header.

#### Response Codes

| **Code** | **Meaning**                           |
| -------- | ------------------------------------- |
| 200      | Success. SingleResponse\<UsageReport> |
| 401      | Unauthorized                          |

#### Example Request

```typescript
const res = await fetch("https://api.diapleo.xyz/v1/usage", {
  headers: { "X-API-Key": process.env.DIAPLEO_API_KEY! },
});
const { data } = await res.json();
```

#### Example Response

```json
{
  "success": true,
  "data": {
    "key_id": "key_abc123",
    "plan": "pro",
    "period_start": "2025-10-01T00:00:00.000Z",
    "period_end": "2025-10-31T00:00:00.000Z",
    "total_requests": 1842,
    "quota": 310000,
    "quota_utilization_pct": 0.6,
    "breakdown": {
      "protocols": 1200,
      "wallet": 342,
      "screener": 250,
      "other": 50
    }
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.diapleo.com/api-reference/endpoints/endpoints-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
