curl --request GET \
--url https://api.inworld.ai/usage/v1/records \
--header 'Authorization: <api-key>'import requests
url = "https://api.inworld.ai/usage/v1/records"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.inworld.ai/usage/v1/records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"usageRecords": [
{
"startTime": "2026-08-21T00:00:00Z",
"endTime": "2026-08-22T00:00:00Z",
"group": {
"model": "inworld-tts-2",
"service": "tts"
},
"metrics": {
"characters": {
"value": "17250",
"unit": "characters"
}
}
},
{
"startTime": "2026-08-21T00:00:00Z",
"endTime": "2026-08-22T00:00:00Z",
"group": {
"model": "gpt-4o-mini",
"service": "llm"
},
"metrics": {
"input_tokens": {
"value": "21930",
"unit": "tokens"
},
"output_tokens": {
"value": "181",
"unit": "tokens"
},
"cached_read_tokens": {
"value": "3168",
"unit": "tokens"
}
}
}
],
"nextPageToken": "",
"readTime": "2026-08-28T17:31:51Z"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Query usage records
Returns metered usage volume (characters, tokens, seconds) for the workspace that owns the API key, aggregated into UTC time buckets. Volume only — not invoiced amounts. Data is complete up to readTime (roughly one hour behind real time); re-fetch recent windows rather than treating them as final. History depth: the last 30 days. int64 values are returned as JSON strings.
curl --request GET \
--url https://api.inworld.ai/usage/v1/records \
--header 'Authorization: <api-key>'import requests
url = "https://api.inworld.ai/usage/v1/records"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.inworld.ai/usage/v1/records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"usageRecords": [
{
"startTime": "2026-08-21T00:00:00Z",
"endTime": "2026-08-22T00:00:00Z",
"group": {
"model": "inworld-tts-2",
"service": "tts"
},
"metrics": {
"characters": {
"value": "17250",
"unit": "characters"
}
}
},
{
"startTime": "2026-08-21T00:00:00Z",
"endTime": "2026-08-22T00:00:00Z",
"group": {
"model": "gpt-4o-mini",
"service": "llm"
},
"metrics": {
"input_tokens": {
"value": "21930",
"unit": "tokens"
},
"output_tokens": {
"value": "181",
"unit": "tokens"
},
"cached_read_tokens": {
"value": "3168",
"unit": "tokens"
}
}
}
],
"nextPageToken": "",
"readTime": "2026-08-28T17:31:51Z"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}readTime,
roughly one hour behind real time: re-fetch recent windows rather than
treating them as final. History is available for the last 30 days.
int64 metric values are returned as JSON strings.Authorizations
Your authentication credentials. For Basic authentication, please populate Basic $INWORLD_API_KEY.
Query Parameters
Range start, inclusive.
Range end, exclusive.
Bucket size; defaults to GRANULARITY_DAY.
GRANULARITY_UNSPECIFIED: Unspecified; treated asGRANULARITY_DAY.GRANULARITY_HOUR: Calendar hour in UTC. Supported for ranges up to 30 days; longer ranges are rejected withINVALID_ARGUMENT.GRANULARITY_DAY: Default. Calendar day in UTC.GRANULARITY_MONTH: Reserved; not offered in v1.
GRANULARITY_UNSPECIFIED, GRANULARITY_HOUR, GRANULARITY_DAY, GRANULARITY_MONTH IANA time zone for bucket boundaries. Not supported in v1 — buckets are
always computed in UTC. Clients must leave this unset; servers reject
non-empty values with INVALID_ARGUMENT.
Dimensions to group by. Omitted: one row per time bucket, all models
summed. USAGE_DIMENSION_API_KEY is filter-only in v1 — servers reject it
here with INVALID_ARGUMENT.
USAGE_DIMENSION_UNSPECIFIED: Unspecified; invalid as agroup_byvalue.USAGE_DIMENSION_SERVICE: tts | llm | stt | ...USAGE_DIMENSION_MODEL: e.g. tts-2.0. The v1 main path.USAGE_DIMENSION_SERVICE_PROVIDER: Upstream inference provider.USAGE_DIMENSION_API_KEY: Filter only in v1;group_bysupport later.
USAGE_DIMENSION_UNSPECIFIED, USAGE_DIMENSION_SERVICE, USAGE_DIMENSION_MODEL, USAGE_DIMENSION_SERVICE_PROVIDER, USAGE_DIMENSION_API_KEY Service filter (e.g. "tts"). Open strings; repeated values mean IN semantics — same for the other dimension filters below.
Model filter (e.g. "tts-2.0").
Service-provider filter.
Same-workspace API-key filter. Rejected when the backing store cannot apply it faithfully (never silently ignored).
Metric selection (e.g. "characters", "input_tokens"). Empty means all
consumption metrics for the requested services; never plan fees.
Maximum records per page; values above the server maximum are coerced.
Opaque cursor from a previous response.
Response
A successful response.
Response for QueryUsageRecords.
Usage rows for the requested range: one per time bucket × dimension group.
Show child attributes
Show child attributes
Empty when there are no further pages.
Omitted by default (expensive to compute per page); explicit presence so clients can tell "absent" from a real 0.
Freshness watermark: the returned data is complete up to this time. Usage is not a live counter; clients should re-fetch recent windows rather than assume immutability.