Tariff
Current prices. The time-of-day schedule is for reference; the commitment is the price of an order (see "Order price" above).
GET /tariff
Current tariff
Authentication: Optional — an API key in Authorization: Bearer … (authentication); the endpoint answers without one too.
The current price of every lease on sale. Public endpoint, no authorization required; rate limited by IP, since a public request carries no key.
A key is optional. Send Authorization: Bearer … and the answer
is about your account: if prices were agreed for it, they are the
ones in this response, and custom says so — at the top level for
the five-minute product, and on each entry of products for that
lease. Without agreed prices a keyed answer is the
public tariff with custom: false. A keyed request is rate limited by
the key rather than the IP, and its answer is never cacheable:
Cache-Control: private, no-store with Vary: Authorization. An
invalid key is 401 — never a silent fall-back to the public tariff,
so a broken key is visible as one.
One price per product. The current price is recomputed against
the market at a fixed interval of a few minutes; there is no schedule
of future prices. Our only commitment to you is the price of a specific
order: set when it is created, and raised at fulfillment only by the
rule in "Order price" above. How the price has moved is
GET /tariff/history.
The public response is cacheable for what is left of the window in
which our servers hold the current price (Cache-Control: public, max-age=N). The time of day plays no part in N.
The top-level fields are the five-minute product, and they stay
that way: current_price_sun, custom and
typical_price_trx describe the 300-second lease exactly as they did
before longer ones went on sale. Everything we sell is in products,
one entry per lease on sale, ascending by duration_s — including
the five-minute one, so the array reads on its own. A client that
offers a choice of lease reads products; a client that only ever
buys five minutes can keep reading the top level and change nothing.
products is the list POST /orders and POST /estimate accept as
duration_s. It is data rather than schema: a product goes on or off
sale without a release, so the array is the answer to "what can I
buy right now", and an enumeration copied into your code is the same
question answered on the day you copied it.
Responses
200
OK
Content type application/json.
| Field | Type | Required | Description |
|---|---|---|---|
current_price_sun | integer | required | Price per unit of energy, in sun, for the five-minute
lease. The same number as the 300-second entry of
Example: |
custom | boolean | required |
Example: |
typical_price_trx | object | required | Approximate price of a single transfer at the current price |
typical_price_trx.single | TRX | required | |
typical_price_trx.double | TRX | required | |
maintenance_price_trx | object | required | The two rates of a single top-up under an energy
maintenance rule ( It is not the price of a lease: a top-up is a different product than an order and has a price of its own. The price is dynamic — we keep it below retail prices for comparable products — so read it here rather than memorizing it. You are charged the price in effect at the moment the top-up is recognized. |
maintenance_price_trx.single | TRX | required | |
maintenance_price_trx.double | TRX | required | |
trx_usd | USD or null | optional | Market price of one TRX in USD — reference only. Nothing in this response, and nothing we charge, is derived from it: every amount here is in TRX and every charge is made in TRX.
Example: |
products | array of ProductTariff | required | The leases on sale right now, ascending by
A duration missing from this array is a duration
|
429
Rate limit exceeded (rate_limited), or too many failed
authorizations from this credential (too_many_auth_failures). Both
are 429 and both carry Retry-After; they differ in what you
should do about it, which is why they differ in code and not only
in message. rate_limited also carries the RateLimit-* state of
the bucket it came from; too_many_auth_failures does not, because
the counter behind it is not a bucket. See "Rate limits" and
"Repeated authorization failures" above.
On POST /orders a rate_limited may also carry
details.reason = bulk_volume_cap: not requests per minute but
energy per window — a mode c order whose volumes would take
your account past the bulk allowance. details carries cap_units
(the allowance), spent_units (your volume already inside the
window), requested_units (what this order asked for) and
window_s (the width of the window, 3600). Retry-After is the
first instant at which this body can be accepted: enough of your
counted volume has to leave the window to make room for
requested_units, which is not in general the moment the oldest
position leaves — one departure frees only that position's units.
An order whose own volume is larger than the whole allowance is not
answered here at all: no waiting would help it, and it is
400 invalid_request with
details.reason = bulk_order_over_cap. It is a pace limit like the
others, so it is the same code: the order is not wrong, and the same
body sent later is accepted. It carries no RateLimit-* headers:
those describe a bucket of requests per minute, and this allowance
is energy per hour — details above is its whole state.
Content type application/json.
Schema: Error.
| Header | Type | Description |
|---|---|---|
Retry-After | integer | Seconds to wait before retrying. |
RateLimit-Limit | integer | Requests per minute in this bucket — per UTC day on
|
RateLimit-Remaining | integer | Requests left in this bucket right now. |
RateLimit-Reset | integer | Seconds until the bucket is full again. |
GET /tariff/history
Tariff history
Authentication: Optional — an API key in Authorization: Bearer … (authentication); the endpoint answers without one too.
Hourly history of the selling tariff — for charts. Public endpoint,
no authorization required; the public response is cacheable
(Cache-Control: public, max-age=300).
A key is optional, as on GET /tariff. With one, the history is
your account's: an hour sold to you at prices agreed for your account
carries those prices and custom: true; every other hour — before
the agreement, after it ended, while autopricing was off — carries
the public price and custom: false, which is what you were charged
then. A keyed request is rate limited by the key, its answer is
Cache-Control: private, no-store with Vary: Authorization, and an
invalid key is 401.
The history is for reference: our only commitment to you is the price of a specific order (see "Order price" above). There is no forecast here — only what the service actually sold at; hours older than the recorded history show the earliest recorded price.
The response is not paginated, and its size is fixed by range
alone. You get exactly one point per hour of the range and never a
partial answer: 24 points for 24h, 168 for 7d, 720 for 30d.
That is the whole of it — there is no cursor, no limit, and no
continuation to follow. The count does not depend on how much history
we have recorded and does not grow over time: a young database fills
the hours it has no record for from the earliest recorded price
rather than dropping them, and an old one still answers with 720 for
30d. Size your buffers for 720 points and you are sized for good;
range is a closed enum, so a fourth depth could only arrive as a
change to this contract.
One product per request — duration_s, the five-minute lease by
default. Each product has its own price series, and mixing two of
them into one chart would draw a step at every switch that no price
ever made. Unlike /estimate and /orders, this accepts any of the
three durations whether or not it is on sale: a product taken off
sale still has a past, and a chart that goes blank the moment it
does would hide exactly the period worth looking at.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
range | query | optional | string | History depth, and the only thing that decides the size of the
answer: One of: |
duration_s | query | optional | integer | Which product's history to chart, in seconds. One of Written as a plain integer rather than an enum for one reason
only: it is the same field as on Default: |
Responses
200
OK
Content type application/json.
| Field | Type | Required | Description |
|---|---|---|---|
range | string | required | Example: |
duration_s | integer | required | The product these points belong to — the Example: |
points | array of object | required | Hourly points, UTC, ascending by time; the last one is
the start of the current hour. Values are as of |
points[].t | string (date-time) | required | |
points[].price_sun | integer | required | Price per unit of energy during that hour, in
sun, on the product named by Example: |
points[].maintenance_price_trx | object | required | Energy-maintenance top-up rates in effect during
that hour (see the field of the same name in
|
points[].maintenance_price_trx.single | TRX | required | |
points[].maintenance_price_trx.double | TRX | required | |
points[].custom | boolean | required |
Example: |
429
Rate limit exceeded (rate_limited), or too many failed
authorizations from this credential (too_many_auth_failures). Both
are 429 and both carry Retry-After; they differ in what you
should do about it, which is why they differ in code and not only
in message. rate_limited also carries the RateLimit-* state of
the bucket it came from; too_many_auth_failures does not, because
the counter behind it is not a bucket. See "Rate limits" and
"Repeated authorization failures" above.
On POST /orders a rate_limited may also carry
details.reason = bulk_volume_cap: not requests per minute but
energy per window — a mode c order whose volumes would take
your account past the bulk allowance. details carries cap_units
(the allowance), spent_units (your volume already inside the
window), requested_units (what this order asked for) and
window_s (the width of the window, 3600). Retry-After is the
first instant at which this body can be accepted: enough of your
counted volume has to leave the window to make room for
requested_units, which is not in general the moment the oldest
position leaves — one departure frees only that position's units.
An order whose own volume is larger than the whole allowance is not
answered here at all: no waiting would help it, and it is
400 invalid_request with
details.reason = bulk_order_over_cap. It is a pace limit like the
others, so it is the same code: the order is not wrong, and the same
body sent later is accepted. It carries no RateLimit-* headers:
those describe a bucket of requests per minute, and this allowance
is energy per hour — details above is its whole state.
Content type application/json.
Schema: Error.
| Header | Type | Description |
|---|---|---|
Retry-After | integer | Seconds to wait before retrying. |
RateLimit-Limit | integer | Requests per minute in this bucket — per UTC day on
|
RateLimit-Remaining | integer | Requests left in this bucket right now. |
RateLimit-Reset | integer | Seconds until the bucket is full again. |