Track spend and balance
Read your organization's usage and remaining balance, so your application can react before a request is refused. Balances and prices are in credits. 1 credit is 1 UZS.
How it works
- 01
Call
GET /api/v1/balancefor the remaining balance. - 02
Call
GET /api/v1/usage?days=30for spend by service and by key, over 7, 30 or 90 days. - 03
When a request answers 402
insufficient_balance, ask the account owner to top up.
Authentication
Send your key as Authorization: Bearer. Both endpoints need account:read and are never billed.
Example
Usage covers the organization the calling key belongs to. The window is whole days, today included.
API reference
Request fields, responses, prices and code samples for every endpoint, with a form that sends a real request.
Stored locally in your browser only.
Account
Read your own spend, request counts and remaining balance. Free — these endpoints are never billed.
GET /v1/usage
Get usage
Returns spend and request counts for the calling key's organization over the last `days` window (7, 30 or 90; default 30), grouped by service and by API key. Reading usage is free. `period.start` and `period.end` are the counted window: whole days, today included.
Parameters
| Field | Description |
|---|---|
daysquery integer | How many days to count, today included. |
Responses
| Header | Description |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Field | Description |
|---|---|
dataRequiredobject | |
request_idRequiredstring | format: uuid |
X-Request-Id: string| Field | Description |
|---|---|
errorRequiredobject | |
request_idRequiredstring | The same ID as the `X-Request-Id` header. format: uuid |
X-Request-Id: string| Field | Description |
|---|---|
errorRequiredobject | |
request_idRequiredstring | The same ID as the `X-Request-Id` header. format: uuid |
| Header | Description |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Field | Description |
|---|---|
errorRequiredobject | |
request_idRequiredstring | The same ID as the `X-Request-Id` header. format: uuid |
| Header | Description |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
Retry-Afterinteger | Seconds to wait before retrying. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
X-RateLimit-Resetinteger | When the rate limit lets requests through again, as a Unix time in seconds. Sent with a 429 for `rate_limit_exceeded`. |
| Field | Description |
|---|---|
errorRequiredobject | |
request_idRequiredstring | The same ID as the `X-Request-Id` header. format: uuid |
| Header | Description |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
Retry-Afterinteger | Seconds to wait before retrying. Sent with a 503 during maintenance, when a retry time was set. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Field | Description |
|---|---|
errorRequiredobject | |
request_idRequiredstring | The same ID as the `X-Request-Id` header. format: uuid |
Examples
Try it
Set your API key in the bar above to send authenticated requests.
daysGET /v1/balance
Get balance
Returns the remaining credits for the calling key's organization. Use it to surface a low balance before a request fails with `402`.
Responses
| Header | Description |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Field | Description |
|---|---|
dataRequiredobject | |
request_idRequiredstring | format: uuid |
X-Request-Id: string| Field | Description |
|---|---|
errorRequiredobject | |
request_idRequiredstring | The same ID as the `X-Request-Id` header. format: uuid |
X-Request-Id: string| Field | Description |
|---|---|
errorRequiredobject | |
request_idRequiredstring | The same ID as the `X-Request-Id` header. format: uuid |
| Header | Description |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
Retry-Afterinteger | Seconds to wait before retrying. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
X-RateLimit-Resetinteger | When the rate limit lets requests through again, as a Unix time in seconds. Sent with a 429 for `rate_limit_exceeded`. |
| Field | Description |
|---|---|
errorRequiredobject | |
request_idRequiredstring | The same ID as the `X-Request-Id` header. format: uuid |
| Header | Description |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
Retry-Afterinteger | Seconds to wait before retrying. Sent with a 503 during maintenance, when a retry time was set. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Field | Description |
|---|---|
errorRequiredobject | |
request_idRequiredstring | The same ID as the `X-Request-Id` header. format: uuid |
Examples
Try it
Set your API key in the bar above to send authenticated requests.