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

# 购买带宽

> 为 TRON 地址购买带宽

## 购买带宽

将带宽委托给指定的 TRON 地址。费用从您的账户余额中扣除。

### 请求体

<ParamField body="target_address" type="string" required>
  目标 TRON 地址（T... 格式，34 个字符）
</ParamField>

<ParamField body="volume" type="number" required>
  要委托的带宽数量（最小 350，最大 100,000）
</ParamField>

<ParamField body="duration" type="string" required>
  租赁时长：`"1h"`（1 小时）或 `"1d"`（24 小时）。请使用 `"1d"`，不要使用 `"24h"` 或数字小时值。
</ParamField>

### 响应

<ResponseField name="id" type="number">
  唯一订单标识符
</ResponseField>

<ResponseField name="status" type="string">
  订单状态：`pending`、`filled`、`failed`
</ResponseField>

<ResponseField name="txid" type="string | null">
  委托广播后的链上交易 ID（`pending` 时为 null）
</ResponseField>

<ResponseField name="price_trx" type="string">
  从余额扣除的总费用（TRX）
</ResponseField>

<ResponseField name="reclaim_at" type="string | null">
  带宽租赁被收回时的 ISO 8601 时间戳
</ResponseField>

### 定价

价格 = `(volume × price_sun) / 1,000,000 + 0.2 TRX` 固定费用。通过 `GET /v1/bandwidth/prices` 获取当前 `price_sun_1h`、`price_sun_1d` 和 `fixed_fee_trx`。

### 示例

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.tronrental.com/v1/bandwidth/buy \
    -H "X-API-Key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "target_address": "TYourRecipientAddress1234567890abc",
      "volume": 16000,
      "duration": "1d"
    }'
  ```

  ```python Python theme={null}
  import requests

  resp = requests.post(
      "https://api.tronrental.com/v1/bandwidth/buy",
      headers={"X-API-Key": "your_api_key"},
      json={
          "target_address": "TYourRecipientAddress1234567890abc",
          "volume": 16000,
          "duration": "1d",
      },
  )
  print(resp.json())
  ```

  ```javascript JavaScript theme={null}
  const resp = await fetch("https://api.tronrental.com/v1/bandwidth/buy", {
    method: "POST",
    headers: {
      "X-API-Key": "your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      target_address: "TYourRecipientAddress1234567890abc",
      volume: 16000,
      duration: "1d",
    }),
  });
  console.log(await resp.json());
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": 5678,
  "price_trx": "10.28",
  "status": "filled",
  "txid": "abc123...",
  "reclaim_at": "2026-06-10T21:00:00+00:00"
}
```

<Tip>
  当免费每日带宽用尽时，**350 带宽**可覆盖一次 USDT TRC-20 转账。
</Tip>
