Review History

View usage history and metrics for your API account

by Arkangel AI Team•1 min read

Monitor your API usage and access detailed metrics for your account.

Usage History

Endpoint

GET https://api.arkangelai.com/v1/usage

Example

curl https://api.arkangelai.com/v1/usage \
  -H "Authorization: Bearer your_api_key"

Parameters

Parameter Type Description
start_date string Start date (YYYY-MM-DD)
end_date string End date (YYYY-MM-DD)
granularity string day, week, or month

Response

{
  "usage": {
    "period": {
      "start": "2026-01-01",
      "end": "2026-01-19"
    },
    "total_requests": 1250,
    "total_tokens": 45000,
    "successful_requests": 1240,
    "failed_requests": 10
  },
  "daily_breakdown": [
    {
      "date": "2026-01-19",
      "requests": 85,
      "tokens": 3200
    }
  ]
}

Metrics by Endpoint

curl "https://api.arkangelai.com/v1/usage/endpoints?start_date=2026-01-01" \
  -H "Authorization: Bearer your_api_key"

Response

{
  "endpoints": [
    {
      "endpoint": "/v1/chat",
      "requests": 800,
      "avg_latency_ms": 450,
      "error_rate": 0.5
    },
    {
      "endpoint": "/v1/files",
      "requests": 150,
      "avg_latency_ms": 200,
      "error_rate": 0.2
    }
  ]
}

Limits and Quotas

Check Current Limits

curl https://api.arkangelai.com/v1/usage/limits \
  -H "Authorization: Bearer your_api_key"

Response

{
  "plan": "professional",
  "limits": {
    "requests_per_day": 10000,
    "requests_used_today": 85,
    "tokens_per_month": 1000000,
    "tokens_used_this_month": 45000,
    "file_storage_mb": 500,
    "file_storage_used_mb": 125
  },
  "reset_times": {
    "daily": "2026-01-20T00:00:00Z",
    "monthly": "2026-02-01T00:00:00Z"
  }
}

Error History

curl "https://api.arkangelai.com/v1/usage/errors?limit=20" \
  -H "Authorization: Bearer your_api_key"

Response

{
  "errors": [
    {
      "timestamp": "2026-01-19T10:30:00Z",
      "endpoint": "/v1/chat",
      "status_code": 429,
      "error_type": "rate_limit_exceeded",
      "request_id": "req_xyz789"
    }
  ],
  "total": 10
}

Export Usage Data

Export your usage history for analysis:

curl "https://api.arkangelai.com/v1/usage/export?format=csv&start_date=2026-01-01" \
  -H "Authorization: Bearer your_api_key" \
  -o api_usage.csv

Available Formats

Format Description
csv Comma-separated values
json Structured JSON data

Usage Alerts

Configure alerts when you reach certain thresholds:

curl -X POST https://api.arkangelai.com/v1/usage/alerts \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "usage_threshold",
    "threshold_percent": 80,
    "notify_email": "your@email.com"
  }'

Complete Example

async function getUsageReport() {
  const today = new Date().toISOString().split('T')[0];
  const monthStart = today.substring(0, 8) + '01';

  // Get monthly usage
  const usageResponse = await fetch(
    `https://api.arkangelai.com/v1/usage?start_date=${monthStart}&end_date=${today}`,
    {
      headers: {
        'Authorization': 'Bearer your_api_key'
      }
    }
  );

  const usage = await usageResponse.json();

  // Get limits
  const limitsResponse = await fetch(
    'https://api.arkangelai.com/v1/usage/limits',
    {
      headers: {
        'Authorization': 'Bearer your_api_key'
      }
    }
  );

  const limits = await limitsResponse.json();

  return {
    usage: usage.usage,
    limits: limits.limits,
    percentUsed: (usage.usage.total_tokens / limits.limits.tokens_per_month) * 100
  };
}

Next Steps