> **Reading as an AI agent?** This is the Markdown version of https://docs.meshy.ai/api/v2/balance, part of the Meshy API v2 docs.
>
> - v2 docs index: https://docs.meshy.ai/api/v2/llms.txt
> - All v2 pages in one file: https://docs.meshy.ai/api/v2/llms-full.txt
> - OpenAPI spec for v2: https://docs.meshy.ai/api/v2/openapi.yaml

---

# Balance API

Check how many credits you can spend, and how many of them expire at the next monthly refresh.

> **Note:** Moving from v1? Only the path changes. `GET /openapi/v1/balance` becomes `GET /openapi/v2/balance`, and the response stays the same. See [Endpoint paths in the migration reference](/api/migrate-to-v2/reference#endpoints).

---

## GET /openapi/v2/balance -- Get the balance

Returns the credit balance of the account that owns the API key. On a team with a shared credit pool, the values are those of the pool. Calling this endpoint is free.

### Parameters

None.

### Returns

  - `balance` · *integer*

  Number of credits you can spend. It's usually `monthly_credits` plus `permanent_credits`.

  It's lower when a member credit limit or an Enterprise workspace credit limit applies to you. Team owners and admins have no such limit.

  `balance` doesn't take an [API key credit limit](/api/authentication) into account. A request can still return `402` with `API key credit limit reached` while `balance` is above zero.

  - `monthly_credits` · *integer*

  Number of credits from your plan's monthly allowance. Meshy clears unused monthly credits at the next monthly refresh, at `monthly_resets_at`. Some Enterprise plans carry part of them over.

  - `permanent_credits` · *integer*

  Number of credits that don't expire, for example from credit packs you bought and from rewards.

  - `monthly_resets_at` · *integer | null*

  Time of the next monthly refresh, in Unix milliseconds. At that time, your plan's monthly allowance replaces the remaining monthly credits.

  `null` when the account has no refresh date. On an account that doesn't refresh monthly, it can be a time in the past.

### Failure modes

  - `401 - Unauthorized`

  The API key is missing or invalid. Check the `Authorization` header.

  - `429 - Too Many Requests`

  You sent too many requests. Wait the number of seconds in `Retry-After`, then retry.

**cURL**

```bash
# Get your credit balance
curl https://api.meshy.ai/openapi/v2/balance \
  -H "Authorization: Bearer ${MESHY_API_KEY}"
```

```javascript
// Get your credit balance
const response = await fetch("https://api.meshy.ai/openapi/v2/balance", {
  headers: { Authorization: `Bearer ${process.env.MESHY_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const balance = await response.json();
console.log(balance.balance, balance.monthly_resets_at);
```

```python
import os
import requests

# Get your credit balance
response = requests.get(
    "https://api.meshy.ai/openapi/v2/balance",
    headers={"Authorization": f"Bearer {os.environ['MESHY_API_KEY']}"},
)
response.raise_for_status()
balance = response.json()
print(balance["balance"], balance["monthly_resets_at"])
```

**Response**

```json
{
  "balance": 1000,
  "monthly_credits": 600,
  "permanent_credits": 400,
  "monthly_resets_at": 1793491200000
}
```
