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

# Comprar bandwidth

> Comprar bandwidth para um endereço TRON

## Comprar bandwidth

Delega bandwidth para o endereço TRON especificado. O custo é deduzido do saldo da sua conta.

### Corpo da solicitação

<ParamField body="target_address" type="string" required>
  Endereço TRON de destino (formato T..., 34 caracteres)
</ParamField>

<ParamField body="volume" type="number" required>
  Quantidade de bandwidth a delegar (mín. 350, máx. 100.000)
</ParamField>

<ParamField body="duration" type="string" required>
  Duração do aluguel: `"1h"` (1 hora) ou `"1d"` (24 horas). Use `"1d"`, não `"24h"` ou valores numéricos de horas.
</ParamField>

### Resposta

<ResponseField name="id" type="number">
  Identificador único do pedido
</ResponseField>

<ResponseField name="status" type="string">
  Status do pedido: `pending`, `filled`, `failed`
</ResponseField>

<ResponseField name="txid" type="string | null">
  ID da transação on-chain após o broadcast da delegação (null enquanto `pending`)
</ResponseField>

<ResponseField name="price_trx" type="string">
  Custo total debitado do saldo, em TRX
</ResponseField>

<ResponseField name="reclaim_at" type="string | null">
  Timestamp ISO 8601 quando o bandwidth alugado é recuperado
</ResponseField>

### Preços

Preço = `(volume × price_sun) / 1.000.000 + 0.2 TRX` taxa fixa. Obtenha `price_sun_1h`, `price_sun_1d` e `fixed_fee_trx` atuais em `GET /v1/bandwidth/prices`.

### Exemplo

<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 bandwidth** cobre uma transferência USDT TRC-20 quando a cota diária gratuita acaba.
</Tip>
