Skip to content

Баланс Пользователя

GET /balance

Текущий баланс пользователя в рублях.

Базовый URL: https://api.aihere.ru/api/v1
Авторизация: Authorization: Bearer <API-ключ>
Rate-limit: 30 запросов/мин

Примеры

cURL

bash
curl "https://api.aihere.ru/api/v1/balance" \
  -H "Authorization: Bearer $AIHERE_API_KEY"

Python

python
import requests

resp = requests.get(
    "https://api.aihere.ru/api/v1/balance",
    headers={"Authorization": f"Bearer {API_KEY}"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())

JavaScript

javascript
const resp = await fetch("https://api.aihere.ru/api/v1/balance", {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
console.log(await resp.json());

PHP

php
$ch = curl_init('https://api.aihere.ru/api/v1/balance');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"],
]);
$resp = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($resp);

Ответ 200

Successful Response

json
{
  "balance": 0.5
}