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

# Get credit usage

> Returns the workspace's credit balance and what it has spent in the current billing period.

One credit is one US dollar.

Credits are prepaid and denominated in US dollars: 1 credit = \$1.00. Searches draw down the balance as they find results. See [Pricing](https://docs.data.avina.io/concepts/pricing.md).

### Response

**`200`** The workspace's usage.

**object** `string` *required*

Always `usage`.

**period\_start** `string | null` *required*

The start of the current billing period.

**period\_end** `string | null` *required*

The end of the current billing period.

**credits\_used** `number` *required*

Credits spent in the current period. 1 credit = \$1.00.

**credits\_limit** `number | null` *required*

Credits available for the period, including top-ups. `null` when there is no limit.

**credits\_remaining** `number | null` *required*

Your balance. Credits left to spend. `null` when there is no limit.

### Errors

| Status | Code | When |
| - | - | - |
| `401` | `invalid_api_key` | The API key is missing, invalid or revoked. |
| `429` | `rate_limited` | Too many requests. Retry after `Retry-After` seconds. |
| `500` | `internal_error` | Something went wrong on our side. Retry with backoff, and with the same `Idempotency-Key` if you sent one. |

Every error uses the same shape. See [Errors](https://docs.data.avina.io/api-reference/errors.md).

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://api.avina.io/v1/usage \
  -H "Authorization: Bearer $AVINA_API_KEY"
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import os
import requests

response = requests.get(
    "https://api.avina.io/v1/usage",
    headers={"Authorization": f"Bearer {os.environ['AVINA_API_KEY']}"},
)
response.raise_for_status()
print(response.json())
```

```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
const response = await fetch(`https://api.avina.io/v1/usage`, {
  headers: {
    Authorization: `Bearer ${process.env.AVINA_API_KEY}`,
  },
});
const data = await response.json();
console.log(data);
```

```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "object": "usage",
  "period_start": "2026-11-01T00:00:00Z",
  "period_end": "2026-12-01T00:00:00Z",
  "credits_used": 41.87,
  "credits_limit": 200,
  "credits_remaining": 158.13
}
```

```json 401 theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "error": {
    "code": "invalid_api_key",
    "message": "The API key is invalid or revoked.",
    "request_id": "req_8f2a61c09d4e7b3a5f10c2d8"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.