API overview
The TronGasAi API is a versioned REST API. Authenticate with an API key and drive the same actions available in the dashboard: pricing, balance, orders, automations and webhooks.
Base URL
Section titled “Base URL”https://trongas.ai/api/v1Conventions
Section titled “Conventions”- Auth — send your key as the
X-Api-Keyheader. See Authentication. - Money — amounts are strings in TRX (e.g.
"5.502"), never floats. - Errors — RFC 7807
application/problem+jsonwith a machine-readablecode. See Errors. - Idempotency — money-moving requests (creating an order) take an
Idempotency-Keyheader; retrying with the same key returns the original result instead of charging twice.
Endpoints
Section titled “Endpoints”Every endpoint is documented under Endpoints in the sidebar, grouped by area:
- Pricing and Rate — public, no key required.
- Wallet — balance, deposit address, ledger history.
- Orders — preview and buy energy or bandwidth.
- Automations — auto-refill, auto-renewal and smart rules.
- Webhooks — register endpoints and inspect deliveries.
- Notifications — in-app events for your account.
Those pages are generated from our OpenAPI description, which is produced by the API’s own build — so they describe the API that is actually deployed, not a copy of it that someone remembered to update. The description itself is available if you want to generate a client:
https://docs.trongas.ai/openapi/trongas.jsonGetting a key
Section titled “Getting a key”Issue a key in the dashboard under Settings → API keys. Pick the narrowest scope that does the job and set a daily spend limit — especially if an AI agent will hold the key. See Authentication.