> ## 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.

# 获取项目使用情况

> 检索项目在当前账单周期内的信用使用、订阅详情和各服务请求计数。

## 概述

返回在当前账单周期内项目信用消耗的完整情况，包括剩余信用、订阅计划详情以及按服务类型（RPC、DAS、gRPC、WebSocket 等）划分的请求细分。

## 请求参数

<ParamField path="id" type="string" required>
  要检索使用情况的项目 ID。必须与用于身份验证的 API 密钥关联的项目匹配。
</ParamField>

## 响应字段

<ParamField body="creditsRemaining" type="number">
  当前账单周期内剩余的信用。计算方式为计划的信用限额减去常规消耗的信用，最低为零。
</ParamField>

<ParamField body="creditsUsed" type="number">
  当前账单周期内消耗的总信用，包括常规和预付信用。
</ParamField>

<ParamField body="prepaidCreditsRemaining" type="number">
  仍可用的预付信用。
</ParamField>

<ParamField body="prepaidCreditsUsed" type="number">
  当前账单周期内消耗的预付信用。
</ParamField>

<ParamField body="subscriptionDetails" type="object">
  订阅计划和账单周期信息。
</ParamField>

<ParamField body="subscriptionDetails.billingCycle.start" type="string">
  账单周期开始日期，格式为 `YYYY-MM-DD`。
</ParamField>

<ParamField body="subscriptionDetails.billingCycle.end" type="string">
  账单周期结束日期，格式为 `YYYY-MM-DD`。
</ParamField>

<ParamField body="subscriptionDetails.creditsLimit" type="number">
  基于您的计划的账单周期内的总信用限额。
</ParamField>

<ParamField body="subscriptionDetails.plan" type="string">
  订阅计划名称（例如，`"business"`，`"professional"`）。
</ParamField>

<ParamField body="usage" type="object">
  按服务类型划分的请求计数。每个字段是当前账单周期内对该服务的请求总数。
</ParamField>

<ParamField body="usage.api" type="number">
  增强的API请求（例如，解析的交易、令牌元数据）。
</ParamField>

<ParamField body="usage.archival" type="number">
  归档RPC请求。
</ParamField>

<ParamField body="usage.das" type="number">
  DAS（数字资产标准）API请求。
</ParamField>

<ParamField body="usage.grpc" type="number">
  gRPC流式请求。
</ParamField>

<ParamField body="usage.grpcGeyser" type="number">
  Geyser gRPC请求。
</ParamField>

<ParamField body="usage.photon" type="number">
  ZK压缩（Photon）请求。
</ParamField>

<ParamField body="usage.rpc" type="number">
  标准Solana RPC请求。
</ParamField>

<ParamField body="usage.stream" type="number">
  LaserStream数据流请求。
</ParamField>

<ParamField body="usage.webhook" type="number">
  Webhook传递事件。
</ParamField>

<ParamField body="usage.websocket" type="number">
  WebSocket订阅请求。
</ParamField>

## 请求参数

<ParamField body="id" type="string" required>
  要检索使用情况的项目ID。必须匹配与API密钥关联的项目。
</ParamField>


## OpenAPI

````yaml zh/openapi/admin-api/getProjectUsage.yaml GET /v0/admin/projects/{id}/usage
openapi: 3.0.3
info:
  title: Helius Admin API
  description: |
    编程访问项目使用和计费数据。

    ## 认证

    所有请求都需要通过以下方式传递的API密钥:
    - Header: `X-Api-Key: YOUR_API_KEY`
    - 查询参数: `?api-key=YOUR_API_KEY`
  version: 1.0.0
  contact:
    name: API支持
    url: https://helius.dev
servers:
  - url: https://admin-api.helius.xyz
    description: 生产服务器
security:
  - ApiKeyQuery: []
  - ApiKeyHeader: []
paths:
  /v0/admin/projects/{id}/usage:
    get:
      tags:
        - Admin
      summary: 获取项目使用情况
      description: |
        检索当前账单周期内项目的信用使用情况、订阅详情和每项服务的请求计数。

        用于身份验证的 API 密钥必须属于路径中指定的项目。API 密钥的项目与 `id` 参数不匹配的请求将返回 `400` 错误。
      operationId: getProjectUsage
      parameters:
        - name: id
          in: path
          required: true
          description: 要检索使用情况的项目 ID。必须与 API 密钥关联的项目匹配。
          schema:
            type: string
            format: uuid
            example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
      responses:
        '200':
          description: 成功检索项目使用情况。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectUsageResponse'
              example:
                creditsRemaining: 487500
                creditsUsed: 12500
                prepaidCreditsRemaining: 50000
                prepaidCreditsUsed: 0
                subscriptionDetails:
                  billingCycle:
                    start: '2026-04-01'
                    end: '2026-05-01'
                  creditsLimit: 500000
                  plan: business
                usage:
                  api: 1200
                  archival: 0
                  das: 5000
                  grpc: 300
                  grpcGeyser: 0
                  photon: 0
                  rpc: 4500
                  stream: 100
                  webhook: 800
                  websocket: 600
        '400':
          description: 错误请求 — 路径中的项目ID与API密钥关联的项目不匹配。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                statusCode: 400
                message: 无效的项目ID
                error: 错误请求
        '401':
          description: 未经授权 — API密钥缺失、格式错误或未找到。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                statusCode: 401
                message: 缺失或无效的API密钥
                error: 未经授权
        '403':
          description: 禁止 — 此项目未启用Admin API。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                statusCode: 403
                message: 此项目未启用Admin API
                error: 禁止
        '429':
          description: 请求过多 — 超过每秒5次请求的速率限制。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                statusCode: 429
                message: 'ThrottlerException: 请求过多'
                error: 请求过多
        '500':
          description: 内部服务器错误 — 发生了服务器端错误（例如，缺失账单数据）。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                statusCode: 500
                message: 内部服务器错误
                error: 内部服务器错误
components:
  schemas:
    ProjectUsageResponse:
      type: object
      properties:
        creditsRemaining:
          type: number
          description: 当前计费周期中剩余的信用额度。计算公式为`creditsLimit - regularCreditsUsed`，最低为0。
          example: 487500
        creditsUsed:
          type: number
          description: 当前计费周期中消耗的总信用额度，包括常规和预付的信用额度。
          example: 12500
        prepaidCreditsRemaining:
          type: number
          description: 剩余的预付信用额度。
          example: 50000
        prepaidCreditsUsed:
          type: number
          description: 当前计费周期中消耗的预付信用额度。
          example: 0
        subscriptionDetails:
          type: object
          description: 关于项目订阅计划和当前计费周期的详细信息。
          properties:
            billingCycle:
              type: object
              description: 当前计费周期的开始和结束日期。
              properties:
                start:
                  type: string
                  description: 计费周期开始日期。
                  example: '2026-04-01'
                end:
                  type: string
                  description: 计费周期结束日期。
                  example: '2026-05-01'
            creditsLimit:
              type: number
              description: 基于计划的当前计费周期的总信用额度。
              example: 500000
            plan:
              type: string
              description: 订阅计划的名称。
              example: business
        usage:
          type: object
          description: 当前计费周期按服务类型分解的请求计数。
          properties:
            api:
              type: number
              description: 增强型API请求的数量（例如，解析交易、令牌元数据）。
              example: 1200
            archival:
              type: number
              description: 存档RPC请求的数量。
              example: 0
            das:
              type: number
              description: DAS（数字资产标准）API请求的数量。
              example: 5000
            grpc:
              type: number
              description: gRPC流请求的数量。
              example: 300
            grpcGeyser:
              type: number
              description: Geyser gRPC请求的数量。
              example: 0
            photon:
              type: number
              description: ZK压缩（Photon）请求的数量。
              example: 0
            rpc:
              type: number
              description: 标准 Solana RPC 请求的数量。
              example: 4500
            stream:
              type: number
              description: LaserStream 数据流请求的数量。
              example: 100
            webhook:
              type: number
              description: Webhook 传递事件的数量。
              example: 800
            websocket:
              type: number
              description: WebSocket 订阅请求的数量。
              example: 600
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP 状态码。
        message:
          type: string
          description: 可读的错误信息。
        error:
          type: string
          description: HTTP 错误名称。
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: 作为查询参数传递的API密钥。
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 作为请求头传递的API密钥。

````