Docs menu
API referenceRead usage
Read usage
GET /v1/usage reports the account's month and each key's share of it.
GET/v1/usage
https://api.legivel.com/v1/usage reports how many of the current period's documents the account has used, and how that total splits across its keys. Pass period to read a specific usage period instead.
Request#
There is no body. One optional query parameter and one header:
| Name | Type | Description |
|---|---|---|
period | query · string | A usage period id of this account. Omit it for the period that is open now. A well-formed id that is not this account's answers 404, the same as an unknown one. Matches ^[1-9]\d{0,18}$. |
Authorizationrequired | header | Bearer lgv_your_key_here, an API key from the account page. See Authentication. |
A period that is not one of this account's answers 404 not_found: The usage period asked for does not belong to this account, or the path does not exist.
Response#
200 with Content-Type: application/json and Cache-Control: no-store.
{ "plan": "free",
"period_start": "2026-09-09T00:00:00.000Z", "period_end": "2026-10-09T00:00:00.000Z",
"credits_included": 100, "credits_granted": 0, "credits_used": 3,
"limits": { "markdown_kb": 512, "resources_mb": 1.5, "pages_max": 20,
"timeout_s": 30, "concurrency": 1, "requests_per_min": 5, "previews_per_hour": 120 },
"keys": [ { "id": "<apikey.id>", "name": "CI", "credits": 2 } ] }Sign in and this block shows your own account.
| Name | Type | Description |
|---|---|---|
planrequired | string | The id of the plan the period is counted against. |
period_startrequired | string | When the period opened. Date-time format. |
period_endrequired | string | When the period closes. Date-time format. |
credits_includedrequired | integer | Documents the plan includes in the period. |
credits_grantedrequired | integer | Documents granted on top of the plan's, such as carry-over on an upgrade. |
credits_usedrequired | integer | Documents used in the period, editor downloads included; this is the number a 402 reads. |
limitsrequired | object | The limits in force for the account in this period, from its plan. |
limits.markdown_kbrequired | integer | Largest Markdown document, in kibibytes. |
limits.resources_mbrequired | number | Total resource bytes one render may load, in mebibytes. |
limits.pages_maxrequired | integer | Most pages one rendered document may have. |
limits.timeout_srequired | integer | Longest one render may run, in seconds. |
limits.concurrencyrequired | integer | Renders the account may have in flight at once. |
limits.requests_per_minrequired | integer | Requests a minute before the burst limiter refuses. |
limits.previews_per_hourrequired | integer | Editor previews an hour; the API never spends these. |
keysrequired | object[] | The period's spending split by API key. The editor's share is credits_used less the sum of these, so the two need not add up. |
keys[].idrequired | string | The API key's id. |
keys[].namerequired | string | null | The key's current name; null once the key is gone. |
keys[].creditsrequired | integer | Documents charged through this key, returned documents excluded. At least 0. |
Example#
Fetch the current period's usage and print it.
curl https://api.legivel.com/v1/usage \
-H "Authorization: Bearer $LEGIVEL_API_KEY"Notes#
- Scheduled periods follow the account's anchor day at 00:00 UTC, using the last day of shorter months without moving the anchor. The account page selects actual periods, including separate periods that start within the same calendar month.
- Reading usage does not open a period. Before the first render in a new period, usage is zero,
keysis empty and the boundaries are those the period will have. - Grants add documents to the period without changing
credits_included; they are reported separately ascredits_granted. An earlier period keeps the documents it included and its grants;limitsreflects that plan's current values. - A malformed
periodanswers 400invalid_request; an unknown ID or another account's period answers 404not_found. - The MCP
get_usagetool returns this same object and takes the same optionalperiod. See MCP server. - The account page's chart, history and CSV show accepted render attempts, with editor downloads as their own line in the breakdown. Returned documents remain visible in history but do not count toward usage. Requests rejected before a render was accepted do not appear there.