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

# システム API：アカウント、残高、サービス状態の確認

> アカウントとシステムの API を使い、残高や使用量の確認、APIXO のサービス状態の監視をプログラムから行えます。

アカウント管理とシステム情報のエンドポイント

## 現在の残高

使用中の API キーに対応するアカウントの残高を確認します。

### エンドポイント

```
GET https://api.apixo.ai/api/v1/apikeys/current-balance
```

### ヘッダー

**Authorization** `string` *required*

API 認証に使用する Bearer トークンです。`Bearer YOUR_API_KEY` の形式で指定します。

### 応答

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": 74.8700
}
```

**code** `integer`

HTTP ステータスコードです。

**message** `string`

状態を説明するメッセージです。

**data** `number`

現在の API キーに対応するアカウントの残高（米ドル）です。

> [!TIP]
>
> タスクを一括送信する前にプログラムから残高を確認し、残高不足で処理が途中で止まるのを防ぎます。

### 例

> [tab] cURL
>
> ```bash theme={null}
> curl -X GET https://api.apixo.ai/api/v1/apikeys/current-balance \
>   -H "Authorization: Bearer YOUR_API_KEY"
> ```

> [tab] JavaScript
>
> ```javascript theme={null}
> const response = await fetch('https://api.apixo.ai/api/v1/apikeys/current-balance', {
>   method: 'GET',
>   headers: {
>     'Authorization': 'Bearer YOUR_API_KEY',
>   },
> });
>
> const data = await response.json();
> console.log('Balance:', data.data);
> ```

> [tab] Python
>
> ```python theme={null}
> import requests
>
> response = requests.get(
>     'https://api.apixo.ai/api/v1/apikeys/current-balance',
>     headers={'Authorization': 'Bearer YOUR_API_KEY'},
> )
>
> data = response.json()
> print(f"Balance: {data['data']}")
> ```

## エラー応答

[エラー](https://apixo.ai/docs/ja/api-reference/errors.md) を参照してください。`401`、`403`、または`429`の応答が発生する可能性があります。

## 統合のベストプラクティス

* **実行前の残高確認**：システムの初期化時や生成タスクの一括送信前に `/apikeys/current-balance` を呼び出し、残高不足で処理が途中で止まるのを防ぎます。
* **残高の自動監視**：バックエンドで残高を定期的に確認します。運用上のしきい値を下回ったら、社内への通知や自動チャージを実行します。
* **残高のキャッシュ**：残高の照会結果はその時点の値です。複数の生成ワーカーで残高のキャッシュを使い回すことは避けてください。

## 関連リンク

* [API リファレンスの概要](https://apixo.ai/docs/ja/api-reference.md)
* [バッチタスク生成](https://apixo.ai/docs/ja/api-reference/batch-generate.md)
* [エラー コードとトラブルシューティング](https://apixo.ai/docs/ja/api-reference/errors.md)
* [請求 Dashboard](https://apixo.ai/dashboard/billing)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.