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

# API quản trị

> Truy cập dữ liệu về mức sử dụng và thanh toán của dự án theo phương thức lập trình thông qua xác thực bằng khóa API.

Admin API cung cấp quyền truy cập theo phương thức lập trình vào mức sử dụng credit, thông tin gói đăng ký và số lượng yêu cầu theo từng dịch vụ của dự án. Sử dụng API này để xây dựng bảng điều khiển nội bộ, tự động hóa cảnh báo sử dụng hoặc chuyển dữ liệu thanh toán của Helius vào hệ thống riêng. Tất cả đều được xác thực bằng khóa API Helius tiêu chuẩn của bạn.

**URL cơ sở**: `https://admin-api.helius.xyz`

## Ví dụ nhanh

Truy xuất mức sử dụng trong chu kỳ credit hiện tại của một dự án:

<CodeGroup>
  ```bash cURL theme={"system"}
  curl "https://admin-api.helius.xyz/v0/admin/projects/YOUR_PROJECT_ID/usage" \
    -H "X-Api-Key: YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={"system"}
  const response = await fetch(
    `https://admin-api.helius.xyz/v0/admin/projects/${PROJECT_ID}/usage`,
    { headers: { "X-Api-Key": API_KEY } }
  );
  const usage = await response.json();
  ```

  ```python Python theme={"system"}
  import requests

  response = requests.get(
      f"https://admin-api.helius.xyz/v0/admin/projects/{PROJECT_ID}/usage",
      headers={"X-Api-Key": API_KEY},
  )
  usage = response.json()
  ```
</CodeGroup>

### Phản hồi mẫu

```json theme={"system"}
{
  "creditsRemaining": 486100,
  "creditsUsed": 13900,
  "prepaidCreditsRemaining": 50000,
  "prepaidCreditsUsed": 0,
  "creditCycle": {
    "start": "2026-04-01",
    "end": "2026-05-01"
  },
  "subscriptionDetails": {
    "billingCycle": {
      "start": "2026-04-01",
      "end": "2026-05-01"
    },
    "creditsLimit": 500000,
    "plan": "business"
  },
  "credits": {
    "rpc": 4500,
    "enhancedApi": 1200,
    "walletApi": 0,
    "das": 5000,
    "webhooks": 800,
    "laserstreamGrpc": 1500,
    "laserstreamWebsocket": 800,
    "preConfirmations": 100,
    "archival": 0,
    "photon": 0,
    "other": 0
  },
  "requests": {
    "rpc": 4500,
    "enhancedApi": 1200,
    "walletApi": 0,
    "das": 5000,
    "webhooks": 800,
    "preConfirmations": 50,
    "archival": 0,
    "photon": 0,
    "other": 0
  },
  "dataTransfer": {
    "laserstreamGrpc": 15000000,
    "laserstreamWebsocket": 8000000
  }
}
```

## Xác thực

Truyền khóa API Helius dưới dạng header (khuyến nghị) hoặc tham số truy vấn:

* **Header**: `X-Api-Key: YOUR_API_KEY`
* **Tham số truy vấn**: `?api-key=YOUR_API_KEY`

<Note>
  Khóa API phải thuộc về dự án mà bạn đang truy vấn. Các yêu cầu có dự án của khóa API không khớp với ID dự án trong đường dẫn sẽ trả về lỗi `400`.
</Note>

## Giới hạn tốc độ

Admin API giới hạn tốc độ ở mức **5 yêu cầu mỗi giây** cho mỗi dự án.

## Endpoint

<CardGroup cols={2}>
  <Card title="Get Project Usage" href="/docs/vi/api-reference/admin/get-project-usage">
    Truy xuất mức sử dụng credit, thông tin gói đăng ký và số lượng yêu cầu theo từng dịch vụ trong chu kỳ credit hiện tại.
  </Card>
</CardGroup>
