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

# 快速开始

> 5 分钟内购买 TRON 能量

## 1. 获取 API 密钥

注册并在 [tronrental.com/dashboard/api](https://tronrental.com/dashboard/api) 创建 API 密钥。

## 2. 查看价格

```bash theme={null}
curl https://api.tronrental.com/v1/prices
```

```json theme={null}
{
  "energy_trx": { "1h": "1.79" },
  "energy_sun": { "1h": "27.54" },
  "energy_volume": 65000,
  "energy_fixed_fee_trx": "0.2",
  "bandwidth_trx": { "1h": "0.34", "1d": "0.42" },
  "bandwidth_sun": { "1h": "400", "1d": "630" },
  "bandwidth_volume": 350,
  "trx_usd_rate": "0.234",
  "burn_cost_trx": "6.5",
  "savings_percent": "72.5"
}
```

能量租赁**仅 1 小时**（`"1h"`）。带宽支持 `"1h"` 或 `"1d"`。`energy_trx` 仅为租赁价，结算时需加上 `energy_fixed_fee_trx`（0.2 TRX）。

## 3. 充值 TRX

获取您的充值地址：

```bash theme={null}
curl https://api.tronrental.com/v1/account/deposit \
  -H "X-API-Key: your_api_key"
```

向返回的 `deposit_address` 发送 TRX 或 USDT，充值将自动到账。

## 4. 购买能量

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

```json theme={null}
{
  "id": 12345,
  "price_trx": "2.75",
  "status": "pending",
  "txid": null,
  "reclaim_at": null,
  "activation_cost_trx": "0"
}
```

能量将在数秒内委托到目标地址。

## 5. 验证

查看订单状态：

```bash theme={null}
curl https://api.tronrental.com/v1/orders \
  -H "X-API-Key: your_api_key"
```

```json theme={null}
{
  "orders": [
    {
      "id": 12345,
      "type": "energy",
      "target_address": "TYourRecipientAddress1234567890abc",
      "volume": 65000,
      "duration": "1h",
      "price_trx": "2.75",
      "status": "filled",
      "delegate_txid": "abc123...",
      "reclaim_at": null,
      "source": "api",
      "created_at": "2026-06-09T12:00:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "page_size": 50
}
```

<Tip>
  **65,000 能量**足够向已持有 USDT 的地址发起一次 USDT 转账。
  首次接收 USDT 请使用 **131,000 能量**。
</Tip>

## 代码示例

<CodeGroup>
  ```python Python theme={null}
  import requests

  API_KEY = "your_api_key"
  BASE = "https://api.tronrental.com/v1"
  headers = {"X-API-Key": API_KEY}

  resp = requests.post(
      f"{BASE}/energy/buy",
      headers=headers,
      json={
          "target_address": "TYourRecipientAddress1234567890abc",
          "volume": 65000,
          "duration": "1h",
      },
  )
  print(resp.json())
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = "your_api_key";
  const BASE = "https://api.tronrental.com/v1";

  const res = await fetch(`${BASE}/energy/buy`, {
    method: "POST",
    headers: {
      "X-API-Key": API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      target_address: "TYourRecipientAddress1234567890abc",
      volume: 65000,
      duration: "1h",
    }),
  });
  console.log(await res.json());
  ```
</CodeGroup>
