# 계정 관리

## 쿼리 잔액

> **GET** `/v3/account/balance`

당좌계정의 신용잔액을 조회합니다.

### 요청 매개변수

#### 요청 헤더

| 매개변수 | 유형 | 필수 | 기본값 | 설명 |
| :-: | :-: | :-: | :-: | :-: |
| Authorization | 문자열 | 예 | — | `Bearer {api_key}` |

#### 요청 예시

##### curl

```bash
curl -X GET https://openapi.tripo3d.ai/v3/account/balance \
  -H "Authorization: Bearer {api_key}"
```

##### Python

```python
import requests

url = "https://openapi.tripo3d.ai/v3/account/balance"
headers = {
    "Authorization": "Bearer {api_key}"
}

response = requests.get(url, headers=headers)
print(response.json())
```

##### JavaScript

```javascript
const url = "https://openapi.tripo3d.ai/v3/account/balance";

const response = await fetch(url, {
  headers: {
    "Authorization": "Bearer {api_key}"
  }
});

const data = await response.json();
console.log(data);
```

### 응답

#### 성공적인 대응

```json
{
  "code": 0,
  "data": {
    "balance": 10000.00,
    "frozen": 200.00
  }
}
```

#### 응답 필드

| 매개변수 | 유형 | 설명 |
| :-: | :-: | :-: |
| code | 정수 | 상태 코드. `0`는 성공을 나타냅니다. |
| data.balance | number | 사용 가능한 크레딧 잔액 |
| data.frozen | number | 진행 중인 작업을 위해 예약된 동결 크레딧 |

---

## 쿼리 사용량 세부정보

> **GET** `/v3/account/usage`

계정의 크레딧 사용 내역을 쿼리합니다.

### 요청 매개변수

#### 요청 헤더

| 매개변수 | 유형 | 필수 | 기본값 | 설명 |
| :-: | :-: | :-: | :-: | :-: |
| Authorization | 문자열 | 예 | — | `Bearer {api_key}` |

#### 요청 예시

##### curl

```bash
curl -X GET https://openapi.tripo3d.ai/v3/account/usage \
  -H "Authorization: Bearer {api_key}"
```

##### Python

```python
import requests

url = "https://openapi.tripo3d.ai/v3/account/usage"
headers = {
    "Authorization": "Bearer {api_key}"
}

response = requests.get(url, headers=headers)
print(response.json())
```

##### JavaScript

```javascript
const url = "https://openapi.tripo3d.ai/v3/account/usage";

const response = await fetch(url, {
  headers: {
    "Authorization": "Bearer {api_key}"
  }
});

const data = await response.json();
console.log(data);
```

### 응답

#### 성공적인 대응

```json
{
  "code": 0,
  "data": [
    {
      "task_id": "task_abc123",
      "type": "text_to_model",
      "credits_consumed": 100.00,
      "created_at": "2025-01-01T00:00:00Z"
    }
  ]
}
```

#### 응답 필드

| 매개변수 | 유형 | 설명 |
| :-: | :-: | :-: |
| code | 정수 | 상태 코드. `0`는 성공을 나타냅니다. |
| data | 배열 | 이용내역 목록 |
| 데이터[].task_id | 문자열 | 고유한 작업 식별자 |
| 데이터[].유형 | 문자열 | 작업 유형 |
| 데이터[].credits_consumed | number | 소비된 크레딧 |
| 데이터[].created_at | 문자열 | 생성 시간(ISO 8601) |
