Get Usage
import requests
url = "https://api.parallel.ai/account/service/v1/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.parallel.ai/account/service/v1/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.parallel.ai/account/service/v1/usage \
--header 'Authorization: Bearer <token>'{
"usage": [
{
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"line_items": [
{
"product": "<string>",
"quantity": 123,
"total_cost_cents": 123,
"currency": "<string>",
"api_key_id": "<string>",
"api_key_name": "<string>",
"app_name": "<string>",
"processor": "<string>"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Usage
Get Usage
Get the authenticated organization’s billed usage as daily, weekly, or monthly spans of line items, broken out by product, processor, app, and API key.
GET
/
service
/
v1
/
usage
Get Usage
import requests
url = "https://api.parallel.ai/account/service/v1/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.parallel.ai/account/service/v1/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.parallel.ai/account/service/v1/usage \
--header 'Authorization: Bearer <token>'{
"usage": [
{
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"line_items": [
{
"product": "<string>",
"quantity": 123,
"total_cost_cents": 123,
"currency": "<string>",
"api_key_id": "<string>",
"api_key_name": "<string>",
"app_name": "<string>",
"processor": "<string>"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Send Authorization: Bearer <access_token>. This must be an account API access token minted via a supported Parallel OAuth grant, not a standard API key. See the account API docs.
Query Parameters
Span granularity. 'daily' returns one span per UTC day; 'weekly' one span per UTC week starting Monday; 'monthly' one span per UTC calendar month. Weekly and monthly spans are clamped to the requested window, with their line items summed.
Available options:
daily, weekly, monthly