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

# 获取免费套餐积分

> 使用 Bright Data 账号管理 API 的 GET /trials/free_tier 获取账户的免费套餐是否已启用，以及包含、已用和剩余的免费套餐积分。此端点不接受任何参数，响应始终包含 4 个字段，速率限制为每个 IP 地址每分钟 600 个请求、每小时 36,000 个请求。

`GET /trials/free_tier` 端点返回您的 Bright Data 账户的免费套餐积分：免费套餐是否已启用，以及包含、已用和剩余的积分数量。返回值与控制面板[账单概览](https://www.bright.cn/cp/billing/overview)页面上的**免费积分**卡片一致。

> [!TIP]
>
> 将您的 API key 粘贴到授权字段中。要获取 API key，请[创建账号](https://www.bright.cn/?hs_signup=1\&utm_source=docs\&utm_campaign=playground)，并查看[如何生成新的 API key？](https://docs.brightdata.com/cn/api-reference/authentication.md#如何生成新的-api-key？)

## 此端点需要哪种 API key 权限？

`GET /trials/free_tier` 需要 `billing.read` 权限。具有**管理员**或**财务**[权限级别](https://docs.brightdata.com/cn/api-reference/authentication.md#api-key-拥有哪些权限级别？)的 API key 拥有该权限。运维、限制或用户权限级别的 API key 无法调用此端点。

## 如何查看我的免费套餐积分？

使用管理员或财务权限的 API key 调用 `GET /trials/free_tier`。此端点不接受任何参数：

```bash theme={null}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.brightdata.com/trials/free_tier"
```

响应是一个包含四个字段的 JSON 对象：

```json theme={null}
{
  "is_enabled": true,
  "included_credits": 5000,
  "used_credits": 3,
  "left_credits": 4997
}
```

如只需输出剩余积分，可使用 [jq](https://jqlang.org/) 过滤响应：

```bash theme={null}
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.brightdata.com/trials/free_tier" \
  | jq '.left_credits'
```

## 响应结构是怎样的？

响应始终包含相同的四个字段，字段类型也始终相同。三个 `*_credits` 字段均为整数，由实际积分用量取整得出：

| 字段 | 类型 | 说明 |
| - | - | - |
| `is_enabled` | boolean | 账户已启用免费套餐时为 `true`，包括所有积分已用完的情况 |
| `included_credits` | integer | 当前周期包含的免费积分 |
| `used_credits` | integer | 当前周期已使用的免费积分 |
| `left_credits` | integer | 当前周期剩余的免费积分 |

当 `is_enabled` 为 `false` 时，`included_credits`、`used_credits` 和 `left_credits` 均为 `0`。

响应不包含续期日期。免费积分始终在每月 1 日续期。

## 如何判断免费套餐积分是否已用完？

同时检查 `is_enabled` 和 `left_credits`。如果响应中 `is_enabled: true` 且 `left_credits: 0`，表示免费套餐仍处于启用状态，但本月积分已用完。免费积分在每月 1 日续期，详见[免费套餐](https://docs.brightdata.com/cn/general/account/billing-and-pricing/free-tier.md)。

如果响应中 `is_enabled: false`，表示您的账户未启用免费套餐，三个 `*_credits` 字段均为 `0`。

## GET /trials/free\_tier 的速率限制是多少？

`GET /trials/free_tier` 允许每个 IP 地址每分钟 600 个请求、每小时 36,000 个请求。超出限制后，Bright Data 不会阻止或拒绝请求。服务器会将每个请求随机延迟 10 到 55 秒，然后正常处理并返回常规响应。

响应中不包含速率限制标头或任何表明请求被延迟的标识。如果响应时间突然增加到 10 秒或更长，请降低请求频率。

## GET /trials/free\_tier 会返回特定错误吗？

不会。`GET /trials/free_tier` 没有针对此端点的错误代码。

## 相关页面

* [免费套餐](https://docs.brightdata.com/cn/general/account/billing-and-pricing/free-tier.md)。每月 5,000 个免费积分适用的产品，以及各产品的积分消耗方式。
* [总余额](https://docs.brightdata.com/cn/api-reference/account-management-api/Get_total_balance_through_API.md)。账户余额、信用额度、预付款和待付用量费用。
* [费用明细导出](https://docs.brightdata.com/cn/api-reference/account-management-api/Export_cost_breakdown.md)。按产品、zone、数据集或爬虫拆分的每日账户费用。


## OpenAPI

````yaml cn-openapi GET /trials/free_tier
openapi: 3.0.1
info:
  title: Bright Data API
  description: 将 Bright Data API 集成到您的流程中，以实现高端的爬取精度
  version: 1.0.0
servers:
  - url: https://api.brightdata.com
security:
  - bearerAuth: []
paths:
  /trials/free_tier:
    get:
      description: >-
        获取账户的免费套餐积分：免费套餐是否已启用，以及包含、已用和剩余的积分。数据与控制面板账单概览页面上的免费积分卡片一致。此端点不接受任何参数。需要
        `billing.read` 权限（管理员或财务权限级别的 API key）。速率限制：每个 IP 地址每分钟 600 个请求、每小时
        36,000 个请求；超出限制的请求会被随机延迟 10 到 55 秒后正常处理，响应中不包含速率限制标头。
      operationId: getFreeTierCredits
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                required:
                  - is_enabled
                  - included_credits
                  - used_credits
                  - left_credits
                properties:
                  is_enabled:
                    type: boolean
                    description: >-
                      账户已启用免费套餐时为 `true`，包括所有积分已用完的情况。为 `false` 时，所有 `*_credits`
                      字段均为 `0`。
                    example: true
                  included_credits:
                    type: integer
                    description: 当前周期包含的免费积分，为整数。
                    example: 5000
                  used_credits:
                    type: integer
                    description: 当前周期已使用的免费积分，取整为整数。
                    example: 3
                  left_credits:
                    type: integer
                    description: 当前周期剩余的免费积分，取整为整数。
                    example: 4997
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        在 Authorization 头中使用您的 Bright Data API Key 作为 Bearer token。


        **认证方法:**

        1. 从 Bright Data 账户设置获取您的 API Key:
        https://brightdata.com/cp/setting/users

        2. 在请求的 Authorization 头中包含 API Key

        3. 格式: `Authorization: Bearer YOUR_API_KEY`


        **示例:**

        ```

        Authorization: Bearer
        b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df

        ```


        了解如何获取 Bright Data API Key:
        https://docs.brightdata.com/cn/api-reference/authentication#如何生成新的-api-key？
      bearerFormat: API Key

````