import requests
url = "https://platform.ankra.app/org/billing/usage"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://platform.ankra.app/org/billing/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/billing/usage \
--cookie ankra_session={
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"granularity": "month",
"group_by": "meter",
"lines": [
{
"meter": "worker_vcpu_hours",
"unit": "vcpu_hours",
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_name": "<string>",
"is_shared": true,
"quantity": 123,
"coverage": "complete",
"price_state": "included",
"price_basis": "pilot",
"amount_minor": 123,
"currency": "EUR"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get organisation usage (browser session)
Everything the organisation used of Ankra over a window, per meter and period: worker vCPU-hours, ordered playground time, managed service instance time and storage, hosted logs and metrics, and AI requests and tokens. Each line carries its unit, quantity, coverage and price state; usage nobody measured reads unknown with no quantity, never zero, and only a line with a published rate carries an amount, in euro cents. Requires billing.read.
import requests
url = "https://platform.ankra.app/org/billing/usage"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://platform.ankra.app/org/billing/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/billing/usage \
--cookie ankra_session={
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"granularity": "month",
"group_by": "meter",
"lines": [
{
"meter": "worker_vcpu_hours",
"unit": "vcpu_hours",
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_name": "<string>",
"is_shared": true,
"quantity": 123,
"coverage": "complete",
"price_state": "included",
"price_basis": "pilot",
"amount_minor": 123,
"currency": "EUR"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Browser session. Mutations also require X-Ankra-CSRF.
Query Parameters
First UTC day to read, YYYY-MM-DD. Defaults to the first day of the current month. Not after today, and not more than 400 days back (how long usage is kept).
The day after the last UTC day to read, YYYY-MM-DD. Defaults to tomorrow. At most 93 days after from; a longer stretch is read in parts.
Period length of each line.
month, day Split the lines by meter only, or also by cluster, by the application a managed service serves, or by managed service instance. Meters not attributed to the grouping keep one organisation line.
meter, cluster, application, instance Read another organisation you are an active member of; defaults to the session's.
Response
The usage report.
What the organisation used of Ankra over a window, one line per meter, period and group. Usage nobody measured is never shown as zero: a line whose every hour was unmeasured is unknown and has no quantity, and one measured in part is partial and its quantity a lower bound. Only a line Ankra has a published rate for carries an amount; during the managed services pilot nothing else is billed (Terms clause 8.8).
Start of the window: midnight UTC of the first day read.
End of the window: midnight UTC after the last day read, or the time of the request when that is earlier - usage that has not happened is not reported.
The length of each line's period: a calendar month or a UTC day, cut to the window at either end.
month, day What the lines are split by. The per-instance and per-application reads are always split by instance.
meter, cluster, application, instance Ordered by meter, then group, then period. Grouped by meter, every meter answers every period, even with nothing used. Grouped by cluster, application or instance, a group that used none of a meter in a period it was fully measured has no line.
Show child attributes
Show child attributes