Usage
Monitor your organization's API usage, AI processing costs, token consumption, and pipeline performance metrics. Usage data is updated in real time as documents are processed. All costs are denominated in USD and reflect Banklyze's AI processing charges inclusive of underlying model costs.
Retrieve a comprehensive usage summary for your organization. The response includes lifetime totals, current-month metrics, token consumption, event counts, pipeline performance percentiles, and a per-day breakdown for recent activity. Use this endpoint to power billing dashboards and usage monitoring alerts.
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| period_start | string | Optional | ISO 8601 timestamp of the start of the billing period (beginning of account history) |
| total_documents | integer | Optional | Total number of documents processed since account creation |
| total_cost_usd | number | Optional | Cumulative processing cost in USD since account creation |
| documents_this_month | integer | Optional | Number of documents processed in the current calendar month |
| cost_this_month | number | Optional | Processing cost in USD for the current calendar month |
| total_input_tokens | integer | Optional | Cumulative LLM input tokens consumed across all documents |
| total_output_tokens | integer | Optional | Cumulative LLM output tokens generated across all documents |
| event_counts | object | Optional | Breakdown of emitted events by type (e.g. document.processing_complete, deal.ready) |
| processing_times | object | Optional | Pipeline latency percentiles: p50_seconds and p95_seconds measured from upload to scoring_complete |
| daily_usage | array | Optional | Per-day breakdown for the trailing 30 days, each entry containing date, documents, cost_usd, input_tokens, and output_tokens |
Example
curl -X GET https://api.banklyze.com/v1/usage/me \
-H "X-API-Key: your_api_key_here"Response
{
"period_start": "2026-01-01T00:00:00Z",
"total_documents": 847,
"total_cost_usd": 423.50,
"documents_this_month": 142,
"cost_this_month": 71.00,
"total_input_tokens": 38150000,
"total_output_tokens": 5234000,
"event_counts": {
"document.processing_complete": 847,
"document.processing_failed": 12,
"deal.ready": 289,
"deal.decision_set": 201
},
"processing_times": {
"p50_seconds": 18.4,
"p95_seconds": 47.2
},
"daily_usage": [
{
"date": "2026-03-01",
"documents": 8,
"cost_usd": 4.00,
"input_tokens": 360000,
"output_tokens": 49400
},
{
"date": "2026-03-02",
"documents": 11,
"cost_usd": 5.50,
"input_tokens": 495000,
"output_tokens": 67900
},
{
"date": "2026-03-03",
"documents": 6,
"cost_usd": 3.00,
"input_tokens": 270000,
"output_tokens": 37100
},
{
"date": "2026-03-04",
"documents": 14,
"cost_usd": 7.00,
"input_tokens": 630000,
"output_tokens": 86500
}
]
}Retrieve detailed processing latency statistics for your organization, optionally filtered to a specific document type and time window. The response includes full percentile distribution, min/max, and a breakdown by document page count to help you set accurate timeout and SLA expectations.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| document_type | string | Optional | Filter statistics to a specific document type: bank_statement, tax_return, or profit_and_loss. When omitted, statistics are computed across all document types. |
| days | integer | Default: 30 | Number of trailing days to include in the sample (1–365) |
Example
curl -X GET "https://api.banklyze.com/v1/usage/me/processing-times?document_type=bank_statement&days=30" \
-H "X-API-Key: your_api_key_here"Response
{
"document_type": "bank_statement",
"days": 30,
"sample_size": 312,
"percentiles": {
"p10_seconds": 9.1,
"p25_seconds": 13.7,
"p50_seconds": 18.4,
"p75_seconds": 28.9,
"p90_seconds": 39.6,
"p95_seconds": 47.2,
"p99_seconds": 68.4
},
"avg_seconds": 20.1,
"min_seconds": 7.2,
"max_seconds": 94.5,
"by_page_count": [
{
"page_range": "1-5",
"sample_size": 78,
"p50_seconds": 11.3,
"p95_seconds": 22.1
},
{
"page_range": "6-15",
"sample_size": 189,
"p50_seconds": 18.4,
"p95_seconds": 47.2
},
{
"page_range": "16+",
"sample_size": 45,
"p50_seconds": 38.7,
"p95_seconds": 68.4
}
]
}