# API Units

> Read the remaining API Units for the current API key. This call does not deduct a balance.

## API Units

Read the remaining API Units for the workspace of the current API key. This request is read-only and does not deduct API Units.

`balance` is the remaining **API Units** for the workspace (see [Billing](https://wayin.ai/api-docs/pricing/)). It uses the same unit as `cost_usage` on a task result. It is not the website Credits balance. Website Credits cannot be used for API calls.

## Get the balance

```http
GET https://wayinvideo-api.wayin.ai/api/v2/units
```

This endpoint has no request body.

### Response

```json
{
  "data": {
    "balance": 150.5
  }
}
```

| Field     | Type   | Description                                                                              |
| --------- | ------ | ---------------------------------------------------------------------------------------- |
| `balance` | number | Remaining API Units. Same unit as `cost_usage`. `0` when the workspace has no API Units. |

### Example Request

```bash
curl -X GET 'https://wayinvideo-api.wayin.ai/api/v2/units' \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2"
```
