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

# Get Balance

> Check your current credit balance

# Get Balance

Retrieve your current credit balance, including available credits and credits frozen by in-progress tasks.

## Request

```
GET /api/v1/account/balance
```

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key.
</ParamField>

## Response

<ResponseField name="code" type="number">
  HTTP status code (`200` on success).
</ResponseField>

<ResponseField name="data" type="object">
  <ResponseField name="available" type="number">
    Credits available to spend on new tasks.
  </ResponseField>

  <ResponseField name="frozen" type="number">
    Credits reserved by tasks that are currently in progress.
  </ResponseField>

  <ResponseField name="total" type="number">
    Total credits (`available` + `frozen`).
  </ResponseField>
</ResponseField>

## Example response

```json 200 theme={null}
{
  "code": 200,
  "data": {
    "available": 950,
    "frozen": 10,
    "total": 960
  }
}
```

## Code examples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://sunor.cc/api/v1/account/balance \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://sunor.cc/api/v1/account/balance",
      headers={"x-api-key": "YOUR_API_KEY"},
  )
  balance = response.json()["data"]
  print(f"Available: {balance['available']} credits")
  print(f"Frozen: {balance['frozen']} credits")
  print(f"Total: {balance['total']} credits")
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://sunor.cc/api/v1/account/balance", {
    headers: { "x-api-key": "YOUR_API_KEY" },
  });
  const { data } = await response.json();
  console.log(`Available: ${data.available} credits`);
  console.log(`Frozen: ${data.frozen} credits`);
  console.log(`Total: ${data.total} credits`);
  ```
</CodeGroup>

## Errors

| Status | Description                |
| ------ | -------------------------- |
| `401`  | Missing or invalid API key |
| `500`  | Internal server error      |
