Documentation/Usage & Billing

Usage & Billing

Usage & Billing

Track your API usage, manage quotas, and monitor costs in real-time.

GET /api/v1/usage

Get Usage Statistics

Returns current usage statistics for the authenticated user.

GET /api/v1/usage/dashboard

Get Usage Dashboard

Get detailed usage dashboard with charts.

GET /api/v1/quota

Get Quota Info

Get current quota information and limits.

POST /api/v1/usage/estimate

Estimate Cost

Estimate the credit cost of a request before executing it.

GET /api/v1/usage/export

Export Usage Data

Export usage data as CSV or JSON for a specified date range.

GET /api/v1/usage/alerts

List Quota Alerts

List all configured quota alerts for your account.

POST /api/v1/usage/alerts

Create Quota Alert

Create a new quota alert to be notified when usage exceeds a threshold.

Parameters

NameTypeReqDescriptionDefault
thresholdnumberYesCredit threshold to trigger the alert—
emailstringYesEmail address to notify—
DELETE /api/v1/usage/alerts/{id}

Delete Quota Alert

Delete a quota alert by its ID.

Response Examples

Usage Statistics (200)
{
  "current_requests": 0,
  "max_requests": 100,
  "remaining": 100,
  "plan": "creator",
  "quota_reset_at": null,
  "chat_session": {
    "limit": 100,
    "remaining": 100,
    "used": 0,
    "window_hours": 5,
    "reset_at": null,
    "is_limited": true
  }
}

Code Examples

Get Usage Statistics
curl https://api.meedoo.co/api/v1/usage \
  -H "Authorization: Bearer YOUR_API_KEY"
Get Usage Dashboard
curl https://api.meedoo.co/api/v1/usage/dashboard \
  -H "Authorization: Bearer YOUR_API_KEY"
Estimate Cost
curl -X POST https://api.meedoo.co/api/v1/usage/estimate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meedoo:latest",
    "messages": [{"role": "user", "content": "Hello"}],
    "max_tokens": 100
  }'
Export Usage Data
curl "https://api.meedoo.co/api/v1/usage/export?start_date=2025-01-01&end_date=2025-12-31&format=csv" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o usage_export.csv