# Get balance - Platform API

> Get your GetBlock CU balance and prepaid USD credits. Complete guide to GET /balance in the Platform API.

`GET /balance` returns your [compute unit (CU)](/getting-started/plans-and-limits/what-counts-as-a-cu/) balance and your prepaid credits balance.

```
GET https://public-api.getblock.io/api/v1/balance
```

## Parameters

None.

## Request Example

#### cURL

```bash
curl https://public-api.getblock.io/api/v1/balance \
  -H "Authorization: Bearer $GETBLOCK_API_KEY"
```

#### JavaScript

```javascript
const response = await fetch('https://public-api.getblock.io/api/v1/balance', {
  headers: { Authorization: `Bearer ${process.env.GETBLOCK_API_KEY}` }
});
const body = await response.json();

console.log(body.cu.total_balance);
```

#### Python

```python
import os
import requests

body = requests.get(
    "https://public-api.getblock.io/api/v1/balance",
    headers={"Authorization": f"Bearer {os.environ['GETBLOCK_API_KEY']}"},
).json()

print(body["cu"]["total_balance"])
```

## Response Example

```json
{
  "cu": {
    "total_balance": 845000000,
    "main_balance": 745000000,
    "extra_balance": 100000000
  },
  "credits": {
    "balance_cents": 10000
  }
}
```

## Response Parameters

| Field | Type | Description |
| --- | --- | --- |
| `cu.total_balance` | integer | CU available. Equals `main_balance + extra_balance`. |
| `cu.main_balance` | integer | CU from the plan's allowance. |
| `cu.extra_balance` | integer | CU from [top-ups](/getting-started/plans-and-limits/top-up-cus-and-boost-limits/). |
| `credits.balance_cents` | integer | Prepaid USD balance, in cents. `10000` is $100.00. |

## Use Cases

* Alert before the CU balance runs out
* Show remaining CU on an internal dashboard
* Check prepaid credits before a top-up

## Error Handling

| HTTP | Cause |
| --- | --- |
| 401 | Missing or invalid API key. |
| 502 | The balance service did not answer. Retry later. |

Error bodies carry an `error` message and a `request_id`. See [Errors](/platform-api/api-reference/objects-and-conventions/#errors).
