Overview
When using API key authentication with theX-Tenant-ID header, Papermap automatically tracks:
- Credits consumed per tenant per billing period
- Request count per tenant per billing period
- Monthly aggregation with automatic period bucketing
How It Works
Billing Period
Usage is automatically bucketed by calendar month:- Period Start: First day of month (e.g., 2025-01-01 00:00:00)
- Period End: Last day of month (e.g., 2025-01-31 23:59:59)
API Endpoints
The base URL for the Papermap API is
https://prod.dataapi.papermap.ai/.Get Workspace Tenant Usage
Retrieve usage data for all tenants in a workspace. Request:
Example Request:
Get Tenant Usage History
Retrieve usage history for a specific tenant. Request:
Example Request:
Authentication
These endpoints use the same HMAC signature authentication as other external API endpoints. See the Authentication Guide for details. Required headers:X-API-Key-ID: Your API key identifierX-Workspace-ID: Your workspace IDX-Valid-Until: Unix timestamp for request expirationX-Signature: HMAC-SHA256 signature
Implementation Examples
The
_get_auth_headers function is a helper function that generates the HMAC signature for the API request found
in the HMAC Authentication guide.Use Cases
Billing & Invoicing
Generate per-tenant invoices based on actual usage
- Query usage for billing period
- Calculate costs based on credits consumed
- Automate invoice generation
Usage Analytics
Monitor tenant consumption patterns
- Identify high-usage tenants
- Track usage trends over time
- Plan capacity accordingly
Quota Management
Implement tenant-level quotas
- Compare usage against limits
- Send usage warnings
- Enforce rate limits per tenant
Cost Allocation
Attribute costs to business units
- Track departmental usage
- Chargeback reporting
- Budget planning
Response Fields
Error Responses
Example Error Response:
Next Steps
Authentication
Learn how to authenticate API requests
API Endpoints
Explore other available API endpoints

