Usage API

Monitor your API consumption, document processing counts, storage usage, and processing performance. Use these endpoints to build internal dashboards or proactively manage quota.

Usage Summary

Returns a comprehensive summary of your organization's API usage for the current billing period, including API call counts, documents processed by type, storage consumption, and quota limits.

NameTypeRequiredDescription
periodstringDefault: current monthBilling period in YYYY-MM format. Defaults to current month.
Request
curl https://api.banklyze.com/v1/usage/summary \
  -H "Authorization: Bearer sk_live_abc123"
200 OK
{
  "data": {
    "period": "2026-03",
    "api_calls": {
      "total": 12450,
      "limit": 50000,
      "remaining": 37550
    },
    "documents_processed": {
      "total": 342,
      "limit": 1000,
      "remaining": 658,
      "by_type": {
        "bank_statement": 215,
        "tax_return": 87,
        "profit_and_loss": 40
      }
    },
    "storage": {
      "used_bytes": 1073741824,
      "used_human": "1.0 GB",
      "limit_bytes": 10737418240,
      "limit_human": "10.0 GB"
    },
    "deals": {
      "active": 48,
      "total": 156
    }
  }
}

Usage counters reset at midnight UTC on the first day of each billing period. The remaining fields show how much quota you have left before rate limiting kicks in.

Processing Times

Returns average and p95 processing times broken down by document type and pipeline stage. Use this to monitor performance trends and set expectations for your users.

NameTypeRequiredDescription
periodstringDefault: current monthBilling period in YYYY-MM format. Defaults to current month.
Request
curl https://api.banklyze.com/v1/usage/processing-times \
  -H "Authorization: Bearer sk_live_abc123"
200 OK
{
  "data": {
    "period": "2026-03",
    "average_times": {
      "bank_statement": {
        "text_extraction_ms": 2340,
        "llm_parsing_ms": 4120,
        "screening_ms": 890,
        "scoring_ms": 150,
        "total_ms": 7500,
        "total_human": "7.5s"
      },
      "tax_return": {
        "text_extraction_ms": 3100,
        "llm_parsing_ms": 5600,
        "screening_ms": 420,
        "scoring_ms": 120,
        "total_ms": 9240,
        "total_human": "9.2s"
      },
      "profit_and_loss": {
        "text_extraction_ms": 1800,
        "llm_parsing_ms": 3400,
        "screening_ms": 310,
        "scoring_ms": 110,
        "total_ms": 5620,
        "total_human": "5.6s"
      }
    },
    "p95_times": {
      "bank_statement_ms": 12400,
      "tax_return_ms": 15200,
      "profit_and_loss_ms": 9800
    }
  }
}

Processing times vary based on document size and complexity. Bank statements with many transactions take longer during the LLM parsing stage. The p95 values represent worst-case scenarios you should plan for in your UI.