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

# 계정 잔액 조회

> Management API Key에 연결된 계정의 총 잔액, 구독 잔액, 충전 잔액을 조회합니다.

Management API Key에 연결된 계정의 잔액을 조회합니다. 총 잔액, 사용 가능한 구독 잔액, 충전 잔액을 구분할 수 있습니다.

<Note>
  Model API Key 대신 [Management API Key](/ko/management-api-keys)로 인증하세요. Auto Deposit과 충전 잔액 알림은 구독 잔액을 제외한 `rechargeBalance`를 사용합니다.
</Note>

## 엔드포인트

```http theme={null}
GET https://api.dgrid.ai/v1/management/balance
```

| 항목 | 값 |
| - | - |
| 인증 | `Authorization: Bearer <DGRID_MANAGEMENT_KEY>` |
| 쿼리 매개변수 | 없음 |
| 응답 형식 | `application/json` |

## 요청 예시

`DGRID_MANAGEMENT_KEY`에 Management API Key를 설정하세요.

<RequestExample>
  ```bash cURL theme={null}
  curl -sS -i "https://api.dgrid.ai/v1/management/balance" \
    -H "Authorization: Bearer $DGRID_MANAGEMENT_KEY"
  ```
</RequestExample>

## 응답

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "message": "ok",
    "data": {
      "userId": "11111111-1111-1111-1111-111111111111",
      "balance": "123.45678912",
      "subscriptionBalance": "100.00000000",
      "rechargeBalance": "23.45678912",
      "currency": "USD",
      "planName": "Pro"
    }
  }
  ```
</ResponseExample>

## 응답 필드

| 필드 | 유형 | 설명 |
| - | - | - |
| `userId` | string | Management API Key에 연결된 계정 ID입니다. |
| `balance` | string | 총 잔액으로, `subscriptionBalance + rechargeBalance`와 같습니다. |
| `subscriptionBalance` | string | 현재 사용 가능한 구독 잔액입니다. 없으면 0입니다. |
| `rechargeBalance` | string | 충전 잔액으로, 정확히 `balance - subscriptionBalance`와 같습니다. |
| `currency` | string | 금액의 통화입니다. 현재는 `USD`입니다. |
| `planName` | string | 구독 요금제 이름입니다. 이름이 없으면 빈 문자열입니다. |

## 금액 정밀도

정밀도를 유지하기 위해 모든 금액은 십진수 문자열로 반환됩니다. 소수 자릿수가 고정되어 있다고 가정하지 마세요. 계산에는 십진수 자료형을 사용하세요. 총 잔액과 충전 잔액은 음수일 수 있으므로 반환된 값을 그대로 표시하고 0으로 보정하지 마세요.

자동 충전은 [자동 충전](/ko/ai-gateway/auto-deposit)을, 잔액 알림은 [알림 설정](/ko/ai-gateway/notifications)을 참고하세요.


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