GasStation · 開発者向け

GasStation API と自動レンタルTop Up TRON Energy and Bandwidth Programmatically

GasStation では TRON のエネルギーと帯域幅のレンタル API と自動レンタルを利用できます。API 仕様は gasdocs-en.gasstation.ai をご覧ください。取引所、ウォレット、決済プラットフォーム、DApp は価格照会、注文、即時チャージ、コールバック受信をプログラムで行えます。コードを書かずにコンソールで自動レンタルを設定し、エネルギーがしきい値を下回ったときに補充することもできます。

openapi.gasstation.ai
  • 秘密鍵は不要
  • Asynchronous notifications

Ways to rent TRON energy

クイックレンタル(ウェブ)

Occasional transfers or DApp use

Connect a wallet (TronLink or OKX Wallet) or log in with email, then choose the amount, rental period and receiving address; several addresses can be entered at once

Wallet balance or account balance

自動レンタル(コンソール)

Business addresses that need energy all the time, without writing code

Set a threshold, top-up amount and rental period in the console; the system monitors the address and orders when energy runs low. Up to 3 addresses can be monitored at once

Account balance only

API 注文

Exchanges, wallets, payment platforms, DApps and batch tasks whose own systems place orders

Call the endpoints at openapi.gasstation.ai to order, query and receive asynchronous notifications

Account balance

エネルギー・帯域幅の即時チャージ(API)

Activated addresses that meet the Flash Recharge rules, billed on the amount actually used

Order through the Flash Recharge endpoint, one receiving address per order

Account balance: the estimated fee is held when you order and settled on the amount actually billed after the resource is reclaimed

Energy and bandwidth are ordered the same way. Individual users can simply order on the website; there is no need to integrate the API.

Core API endpoints

API では残高や注文価格の照会、必要エネルギーの見積もり、注文、エネルギー・帯域幅の即時チャージ、委任履歴の照会ができ、注文状況は非同期コールバックで受け取れます。API 注文と自動レンタルの料金はアカウント残高から支払います。入金した TRX は GasStation が管理し、レンタル料金に充当します。秘密鍵やシードフレーズは不要です。接続先は openapi.gasstation.ai、仕様は gasdocs-en.gasstation.ai をご覧ください。

Endpoint names match the docs; click a name to open its page.

自動レンタルの設定

自動レンタルはコンソールで設定でき、コードは不要です。

Three steps to set up

  1. ウォレット接続またはメールで GasStation にログインし、自動レンタルのページでルールを追加します。

  2. Enter the receiving address and set three things: the energy level that triggers a top-up (the threshold), how much energy to add each time, and the rental period.

  3. Save and enable the rule. The system starts monitoring the address and creates an order to top up energy when it falls below the threshold.

Good to know

  • Up to 3 addresses can be monitored at once.
  • 自動レンタルはアカウント残高のみで支払います。1 回の補充額を下回ると停止するため、残高を確保してください。
  • You can adjust a rule after saving it, or switch it off.
  • Bandwidth is set up the same way as energy.
  • If your own system should decide when to top up (for example before a withdrawal or a sweep), use the API instead; see “Who it is for and typical uses”.

Who it is for and typical uses

Exchanges and custodians

Large volumes of withdrawals and internal transfers; sweeping funds between hot and cold wallets

Check the address's energy before a withdrawal, order through the API if it is short, and send the withdrawal once the delegation succeeds

Wallets and payment platforms

User top-ups and payments, fund collection and distribution (batch payouts), merchant settlement

API または自動レンタルで出金アドレスのエネルギーを維持し、不足による TRX のバーンを減らします。

DApps and contract platforms

Users run contracts without preparing energy themselves (Gasless)

When the backend detects too little energy, top it up through the API first, then run the transaction

Multi-address management systems

Many business addresses

Create orders and query status in batches to keep each address supplied

Scripts and task systems

Batch airdrops, batch minting, automated settlement

タスク開始前にエネルギーを補充するか、自動レンタルで残量を維持します。

Covering fees for users (Gasless)

The “DApp Gasless mode” in the product docs lets you pay the energy cost on your users' behalf.

  1. A user starts a contract action in your DApp.
  2. Your backend detects that the sending address is short of energy.
  3. It tops up energy for that address through the API and runs the transaction once the delegation arrives.
  4. Users do not need to understand energy, bandwidth or other resources.

If the transaction also needs bandwidth, you can top that up through the API in the same way.

たまの送金でエネルギーが必要ですか?GasStation のサイトから直接レンタルできます。

エネルギーをレンタル

API integration steps

Requests go to openapi.gasstation.ai plus the endpoint path, directly in production; there is no test environment for now. See the Integration Guide and Overview pages in the docs for how request parameters are encrypted and formatted.

Energy reaches the receiving address through TRON's native resource delegation. Under normal conditions it usually arrives within seconds; in rare cases there may be a delay. The order and on-chain status are final.

Example request (cURL) · Get Price
curl -X GET \
  'https://openapi.gasstation.ai/api/tron/gas/order/price?app_id=<YOUR_APP_ID>&data=<AES_ENCRYPTED_JSON>'

Requests go to openapi.gasstation.ai plus the endpoint path. Each request carries two parameters, app_id and data, where data is a JSON string AES-encrypted with your secret. A response code of 0 means success. Request and response formats, parameters and codes are set out in the API docs.

  1. Whitelist your IP and create an API

    Log in to GasStation and set an IP whitelist, then select API Management in the left menu and click Create API. Each user can create up to 3 API keys.

  2. Get your app_id and secret

    Open the API's details page to see its app_id and secret. You verify your identity with a signature before the secret is shown; keep it safe and do not share it.

  3. Set a callback URL

    On the Edit API page, enter the URL that should receive notifications in the Callback URL field (it must start with http:// or https://).

  4. Top up your balance

    Top up your account with TRX. The top-up address accepts TRX only; you can find it on your account page or through the Query Balance endpoint.

  5. Check prices and estimate

    Call Get Price to choose a rental period. To size an order for a specific transaction, call Estimate Order Amount first.

  6. Place the order

    Place the order with Create Order or Energy / Bandwidth Flash Recharge. Each request carries a request_id, which cannot be reused within an account.

  7. Track the order

    Track the order with Order List or Synchronize Proxy Records, or receive the Tron Resource Purchase Asynchronous Notification at your callback URL. If your server returns FAILURE or times out, the system retries, usually up to 5 times.

API billing and payment

Payment
API orders are paid from your GasStation account balance. The balance is TRX you top up in advance to pay rental fees, and it is managed by GasStation. Top-up addresses accept TRX only, and top-ups are free.
料金
Check standard order prices with Get Price, or see live prices on the Pricing page. The amount charged is the payment amount returned by the order endpoint.
Energy / Bandwidth Flash Recharge
When you order, the fee is held based on the estimated delegation plus a safety margin. After the resource is reclaimed, you are charged for the amount actually billed and the rest of the hold returns to your available balance. If the order fails, the full hold is released and nothing is charged.
Standard orders that fail or are only partly delegated
The fee for the unfilled part is refunded to the user address GasStation assigns to you.
Order size
The minimum and maximum order amounts are the values Get Price actually returns.
Withdrawals
You can withdraw your balance at any time to an address you specify, for a fee of 1 TRX per withdrawal.

Security for API integrations

More detail: see “API security” on the Security page (/en/security).

秘密鍵は不要

Using the API does not require your wallet's private key or seed phrase. GasStation does not access or store users' private keys.

Authentication and access control

You must set an IP whitelist before you can create or use an API key, and each user can create up to 3 API keys. The API also applies rate limiting and permission control.

Transport and encryption

Requests travel over HTTPS, and request data is AES-encrypted.

二重注文の防止

Every request carries a request_id that cannot be reused within an account.

Keeping and revoking keys

The secret is shown on the API details page only after signature verification. Keep it safe and do not share it. If it leaks, delete that API key on the platform to disable it and create a new one; deleting an API key asks for a wallet signature.

Funds

API orders are paid from your account balance, which is managed by GasStation. Resources reach the receiving address through TRON's native resource delegation, and every delegation can be looked up on TronScan.

よくある質問

Did not find your answer? Reach us through Telegram support, live chat on the website or service@gasstation.ai.

サポートに連絡

Related links

Need to reduce TRON gas fees? Rent Now.

今すぐレンタル