Skip to main content
cURL
Cost: Free.
Needs the usage:read scope. Days are UTC calendar days, from and to both included. to defaults to today and from to 29 days before to. Days older than the last 90 are left out, and the answer’s from says where it starts. A from after to answers 400. data has one row per day and operation with any calls or credits, oldest first. A day without either has no row. calls, errors (answers with a status of 400 or more) and avg_latency_ms are null when the request log has no record of that day’s charged calls. For each single charge, use List usage events.

Authorizations

Authorization
string
header
required

An API key: Authorization: Bearer alura_sk_....

Query Parameters

from
string<date>

First UTC day, YYYY-MM-DD; default 29 days before to. Days before the last 90 are left out.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
to
string<date>

Last UTC day, YYYY-MM-DD, inclusive; default today.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
fields
string

Comma-separated dotted paths to return; id, object and as_of always come back.

Response

OK

object
string
required
Allowed value: "usage_by_day"
from
string
required

The first UTC day served, YYYY-MM-DD: from, or the oldest of the last 90 days when from is older.

to
string
required

The last UTC day of the range, YYYY-MM-DD, inclusive.

data
object[]
required

One row per UTC day and operation with any calls or API credits, oldest first. Days without either are left out.