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

# requestAirdrop

> 请求向一个公钥发放 lamports 空投。

## 请求参数

<ParamField body="address" type="string" required>
  Solana 钱包地址（公钥），用于接收测试 SOL 代币的空投。
</ParamField>

<ParamField body="value" type="number" required>
  空投的 SOL 数量，以 lamports 计算（1 SOL = 1,000,000,000 lamports），用于测试。
</ParamField>

<ParamField body="commitment" type="string">
  请求的承诺级别。

  * `confirmed`
  * `finalized`
  * `processed`
</ParamField>


## OpenAPI

````yaml zh/openapi/rpc-http/requestAirdrop.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: 面向开发的 Solana API，用于在测试网络上请求 SOL 代币空投，以资助账户进行应用程序开发、测试和实验。
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://devnet.helius-rpc.com
    description: Devnet RPC 端点
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: requestAirdrop
      description: >-
        在 Solana 测试网络上请求免费 SOL 代币用于开发和测试目的。此仅限开发的 API 允许开发人员在 devnet 和 testnet
        环境中为钱包提供 SOL，以便在不使用真实资金的情况下构建和测试 Solana 应用程序。对于本地开发、CI/CD 管道、自动化测试以及试验新的
        Solana 功能至关重要。空投的 SOL 可用于支付交易费用、创建账户以及在非生产环境中测试财务逻辑。
      operationId: requestAirdrop
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: JSON-RPC 协议版本。
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: 请求的唯一标识符。
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - requestAirdrop
                  description: 要调用的 RPC 方法名称。
                  example: requestAirdrop
                  default: requestAirdrop
                params:
                  type: array
                  description: 空投请求的参数。
                  default:
                    - 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri
                    - 1000000000
                  items:
                    oneOf:
                      - type: string
                        description: 接收测试 SOL 代币空投的 Solana 钱包地址（公钥）。
                        example: 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri
                      - type: integer
                        description: >-
                          用于测试的 SOL 空投数量，以 lamports 为单位（1 SOL = 1,000,000,000
                          lamports）。
                        example: 1000000000
                      - type: object
                        description: 空投的配置对象。
                        properties:
                          commitment:
                            type: string
                            description: 请求的承诺级别。
                            enum:
                              - confirmed
                              - finalized
                              - processed
                            example: finalized
            examples:
              requestAirdrop:
                value:
                  jsonrpc: '2.0'
                  id: '1'
                  method: requestAirdrop
                  params:
                    - 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri
                    - 1000000000
      responses:
        '200':
          description: 成功请求空投。
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC 协议版本。
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: 与请求匹配的标识符。
                    example: '1'
                  result:
                    type: string
                    description: 已完成空投的 Solana 交易签名，可用于验证 SOL 是否已接收。
                    example: >-
                      5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW
              examples:
                responseExample:
                  value:
                    jsonrpc: '2.0'
                    id: '1'
                    result: >-
                      5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW
        '400':
          description: 错误请求 - 请求参数无效或请求格式错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: 参数无效
                id: '1'
        '401':
          description: 未授权 - API 密钥无效或缺失。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: 未授权
                id: '1'
        '429':
          description: 请求过多 - 超出速率限制。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: 请求过多
                id: '1'
        '500':
          description: 内部服务器错误 - 服务器发生错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: 内部错误
                id: '1'
        '503':
          description: 服务不可用 - 服务暂时不可用。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: 服务不可用
                id: '1'
        '504':
          description: 网关超时 - 请求超时。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: 网关超时
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: JSON-RPC 协议版本。
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: 错误代码。
              example: -32602
            message:
              type: string
              description: 错误信息。
            data:
              type: object
              description: 关于错误的附加数据。
        id:
          type: string
          description: 与请求匹配的标识符。
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        您的 Helius API
        密钥。您可以在[仪表板](https://dashboard.helius.dev/api-keys)中免费获取一个。

````