Sarf va balansni kuzating
Tashkilotingiz sarfi va qolgan balansini oling, shunda ilovangiz soʻrov rad etilishidan oldin chora koʻra oladi. Balans va narxlar kreditda. 1 kredit 1 soʻmga teng.
Qanday ishlaydi
- 01
Qolgan balansni bilish uchun
GET /api/v1/balanceni chaqiring. - 02
Xizmatlar va kalitlar boʻyicha 7, 30 yoki 90 kunlik sarfni olish uchun
GET /api/v1/usage?days=30ni chaqiring. - 03
Soʻrov 402
insufficient_balancejavobini olsa, hisob egasidan balansni toʻldirishni soʻrang.
Autentifikatsiya
Kalitingizni Authorization: Bearer sifatida yuboring. Ikkala endpoint uchun account:read ruxsati kerak va ular hech qachon pullik emas.
Namuna
Sarf soʻrov yuborgan kalit tegishli boʻlgan tashkilot boʻyicha hisoblanadi. Davr butun kunlardan iborat, bugun ham kiradi.
API maʼlumotnomasi
Har bir endpoint uchun soʻrov maydonlari, javoblar, narxlar va kod namunalari hamda haqiqiy soʻrov yuboradigan shakl.
Faqat brauzeringizda saqlanadi.
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.
Parametrlar
| Field | Description |
|---|---|
daysquery integer | How many days to count, today included. |
Javoblar
| Sarlavha | Tavsif |
|---|---|
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. |
| Maydon | Tavsif |
|---|---|
dataMajburiyobject | |
request_idMajburiystring | format: uuid |
X-Request-Id: string| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
X-Request-Id: string| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
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. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
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`. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
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. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
Namunalar
Sinab koʻrish
Kalit bilan soʻrov yuborish uchun API kalitingizni yuqoridagi panelga kiriting.
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`.
Javoblar
| Sarlavha | Tavsif |
|---|---|
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. |
| Maydon | Tavsif |
|---|---|
dataMajburiyobject | |
request_idMajburiystring | format: uuid |
X-Request-Id: string| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
X-Request-Id: string| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
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`. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
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. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
Namunalar
Sinab koʻrish
Kalit bilan soʻrov yuborish uchun API kalitingizni yuqoridagi panelga kiriting.