- EN
- UA
GET /user/limits
Returns current budget and OCR quota in real time.Base URL:https://app.lapathoniia.topcurl https://app.lapathoniia.top/user/limits \
-H "Authorization: Bearer YOUR_API_KEY"
import httpx
resp = httpx.get(
"https://app.lapathoniia.top/user/limits",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
limits = resp.json()
print(f"Budget: ${limits['budget']['used_usd']:.4f} / ${limits['budget']['max_usd']}")
print(f"OCR: {limits['ocr']['used_this_hour']}/{limits['ocr']['images_per_hour']} images this hour")
print(f"OCR resets in: {limits['ocr']['resets_in_seconds']}s")
Response
{
"has_api_key": true,
"budget": {
"max_usd": 0.5,
"used_usd": 0.013221,
"remaining_usd": 0.486779,
"reset_at": null,
"duration": null
},
"ocr": {
"images_per_hour": 4,
"used_this_hour": 1,
"remaining": 3,
"resets_in_seconds": 2847
}
}
GET /user/stats
Usage statistics for the selected period.# Last 7 days (default)
curl "https://app.lapathoniia.top/user/stats?period=7d" \
-H "Authorization: Bearer YOUR_API_KEY"
# Available periods: 1d | 7d | 30d | all
resp = httpx.get(
"https://app.lapathoniia.top/user/stats",
params={"period": "30d"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
stats = resp.json()
print(f"Requests: {stats['requests']}")
print(f"Tokens: {stats['tokens']['total']:,}")
print(f"Cost: ${stats['estimated_cost_usd']:.4f}")
Response
{
"period": "7d",
"tokens": { "total": 12400, "prompt": 8200, "completion": 4200 },
"requests": 47,
"estimated_cost_usd": 0.0132,
"models": [
{ "name": "MamayLM 27B", "requests": 30, "tokens": 9800 },
{ "name": "Rukopys OCR", "requests": 17, "tokens": 2600 }
]
}
Check Before OCR
def check_ocr_quota(api_key: str) -> bool:
resp = httpx.get(
"https://app.lapathoniia.top/user/limits",
headers={"Authorization": f"Bearer {api_key}"},
timeout=5,
)
ocr = resp.json().get("ocr", {})
remaining = ocr.get("remaining", 0)
if remaining == 0:
print(f"OCR quota exhausted. Resets in {ocr.get('resets_in_seconds', 3600) // 60} min.")
return False
return True
GET /user/limits
Повертає поточний бюджет та OCR квоту в реальному часі.Base URL:https://app.lapathoniia.topcurl https://app.lapathoniia.top/user/limits \
-H "Authorization: Bearer YOUR_API_KEY"
Відповідь
{
"budget": {
"max_usd": 0.5,
"used_usd": 0.013,
"remaining_usd": 0.487,
"reset_at": null
},
"ocr": {
"images_per_hour": 4,
"used_this_hour": 1,
"remaining": 3,
"resets_in_seconds": 2847
}
}
GET /user/stats
Статистика використання за вибраний період (1d | 7d | 30d | all).curl "https://app.lapathoniia.top/user/stats?period=7d" \
-H "Authorization: Bearer YOUR_API_KEY"
Відповідь
{
"period": "7d",
"tokens": { "total": 12400, "prompt": 8200, "completion": 4200 },
"requests": 47,
"estimated_cost_usd": 0.0132,
"models": [
{ "name": "MamayLM 27B", "requests": 30, "tokens": 9800 },
{ "name": "Rukopys OCR", "requests": 17, "tokens": 2600 }
]
}
