import requests
url = "https://api.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://api.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://api.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://api.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://api.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://api.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
Query Parameters
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).