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

# Balance

> Check your credit balance

Returns the current credit balance for the authenticated API key.

## Authentication

Requires a valid API key via `Authorization: Bearer YOUR_API_KEY`.

* **User API keys** return the user's credit balance.
* **Organization API keys** return the organization's provider balance (revenue).

## Response

```json theme={null}
{
  "balance": "$5.00"
}
```

### Response Fields

| Field     | Type     | Description              |
| --------- | -------- | ------------------------ |
| `balance` | `string` | Formatted dollar balance |

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl 'https://api.orthogonal.com/v1/credits/balance' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```bash CLI theme={null}
  orth balance
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.orthogonal.com/v1/credits/balance', {
    headers: {
      'Authorization': `Bearer ${process.env.ORTHOGONAL_API_KEY}`
    }
  });

  const { balance } = await response.json();
  console.log(`Balance: ${balance}`);
  ```

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

  response = requests.get(
      'https://api.orthogonal.com/v1/credits/balance',
      headers={'Authorization': f'Bearer {os.environ["ORTHOGONAL_API_KEY"]}'}
  )

  balance = response.json()
  print(f"Balance: {balance['balance']}")
  ```
</CodeGroup>

## Check Sufficiency

Use `POST /v1/credits/check` to verify you have enough balance before making an API call:

```bash theme={null}
curl -X POST 'https://api.orthogonal.com/v1/credits/check' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"amountCents": 100}'
```

```json theme={null}
{
  "sufficient": true,
  "balanceCents": 500000,
  "requiredCents": 100,
  "shortfallCents": 0
}
```
