Appearance
Read account usage
GET
/v2/account/usage
Reports page and request consumption for the current billing period. The period runs from your plan renewal day, so it is usually not a calendar month.
Authorizations
BearerAuth
Your Papermill API key, sent as Authorization: Bearer <key>.
Type
HTTP (bearer)
or
ApiKeyHeader
Your Papermill API key. Equivalent to the bearer form.
Type
API Key (header: x-api-key)
Parameters
Query Parameters
date
A date inside the billing period to report on. Defaults to the current period.
Type
string
Responses
Consumption for the billing period.
application/json
JSON "pagesGenerated": 0, "apiCalls": 0, "maxPagesGenerated": 0, "startDate": "string", "endDate": "string", "draft": { "pagesGenerated": 0, "apiCalls": 0 }, "maxDraftPagesGenerated": 0, "overagePages": 0
{
}
Example
The billing period runs from your plan renewal day, so it is usually not a calendar month.
shell
curl https://api.papermill.io/v2/account/usage \
-H "Authorization: Bearer $PAPERMILL_API_KEY"python
import os
import requests
usage = requests.get(
"https://api.papermill.io/v2/account/usage",
headers={"Authorization": f"Bearer {os.environ['PAPERMILL_API_KEY']}"},
).json()
print(f"{usage['pagesGenerated']} / {usage['maxPagesGenerated']} pages")javascript
const response = await fetch('https://api.papermill.io/v2/account/usage', {
headers: { Authorization: `Bearer ${process.env.PAPERMILL_API_KEY}` },
})
const usage = await response.json()
console.log(`${usage.pagesGenerated} / ${usage.maxPagesGenerated} pages`)