> For the complete documentation index, see [llms.txt](https://docs.hydromancer.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hydromancer.xyz/readme/rest-api/api-usage/apiusage.md).

# apiUsage

{% hint style="info" %}
This endpoint returns your Hydromancer API usage.
{% endhint %}

## POST Request

<table><thead><tr><th width="161.9998779296875">Field</th><th width="119">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td>string</td><td>Must be <code>"apiUsage"</code></td></tr><tr><td><code>days</code></td><td>integer</td><td>Number of days to look back (optional, default 30)</td></tr></tbody></table>

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST https://api.hydromancer.xyz/info \
  -H "Authorization: Bearer $HYDROMANCER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "apiUsage",
    "days": 7
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

response = requests.post(
    'https://api.hydromancer.xyz/info',
    json={
        'type': 'apiUsage',
        'days': 7
    },
    headers={
        'Authorization': f'Bearer {os.environ.get("HYDROMANCER_API_KEY")}',
        'Content-Type': 'application/json'
    }
)

print(response.json())
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
import axios from 'axios';

try {
    const response = await axios.post('https://api.hydromancer.xyz/info', {
        type: 'apiUsage',
        days: 7
    }, {
        headers: {
            'Authorization': `Bearer ${process.env.HYDROMANCER_API_KEY}`,
            'Content-Type': 'application/json'
        }
    });

    console.log(response.data);
} catch (error) {
    console.error('Error:', error.message);
}
```

{% endtab %}
{% endtabs %}

***

## Response Fields

| Field                    | Type   | Description                             |
| ------------------------ | ------ | --------------------------------------- |
| `day`                    | string | Date in `YYYY-MM-DD` format             |
| `request_type`           | string | Endpoint or request type name           |
| `total_requests`         | int    | Total number of requests                |
| `success_requests`       | int    | Number of successful requests           |
| `failure_requests`       | int    | Number of failed requests               |
| `avg_processing_time_ms` | float  | Average processing time in milliseconds |
| `tokens_consumed`        | int    | Number of rate limit tokens consumed    |

<details>

<summary>Response</summary>

```json
[
    {
        "day": "2026-03-16",
        "request_type": "allMids",
        "total_requests": 1,
        "success_requests": 1,
        "failure_requests": 0,
        "avg_processing_time_ms": 2.0,
        "tokens_consumed": 1
    },
    {
        "day": "2026-03-16",
        "request_type": "delegations",
        "total_requests": 5,
        "success_requests": 5,
        "failure_requests": 0,
        "avg_processing_time_ms": 0.0,
        "tokens_consumed": 5
    }
]
```

</details>
