curl --request GET --fail-with-body --max-time 30 \
"${AMLOK_API_BASE_URL}/v1/billing/usage/billing_usage_example?snapshot_id=billing_snapshot_example" \
--header "Authorization: Bearer ${AMLOK_API_KEY}" \
--header "Accept: application/json"import os
import requests
base_url = os.environ["AMLOK_API_BASE_URL"].rstrip("/")
headers = {'Accept': 'application/json'}
headers["Authorization"] = "Bearer " + os.environ["AMLOK_API_KEY"]
response = requests.request(
"GET", base_url + "/v1/billing/usage/billing_usage_example?snapshot_id=billing_snapshot_example",
headers=headers, timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(response.json())
const baseUrl = process.env.AMLOK_API_BASE_URL;
const apiKey = process.env.AMLOK_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Configure AMLOK_API_BASE_URL and AMLOK_API_KEY");
const headers = {
"Accept": "application/json"
};
headers.Authorization = `Bearer ${apiKey}`;
const response = await fetch(baseUrl.replace(/\/$/, "") + "/v1/billing/usage/billing_usage_example?snapshot_id=billing_snapshot_example", {
method: "GET", headers,
redirect: "error", signal: AbortSignal.timeout(30000),
});
if (!response.ok) throw new Error(`AMLOK returned HTTP ${response.status}`);
console.log(await response.json());{
"data": {
"id": "billing_usage_example",
"object": "billing_usage",
"record_version": 1,
"created_at": "2026-10-23T14:00:00Z",
"updated_at": "2026-10-23T14:00:00Z",
"workspace_id": "wsp_example",
"billing_account_id": "billing_account_example",
"product": "insights",
"tier": "standard",
"source_resource_id": "wfr_example",
"unit": "completed_underwriting",
"quantity": "1",
"unit_rate": "5.00",
"currency": "CAD",
"amount": "5.00",
"entry_type": "charge",
"reverses_usage_id": null,
"status": "posted",
"subject_id": "biz_example",
"workflow_run_id": "wfr_example",
"application_id": "app_example",
"input_manifest_id": "manifest_example",
"risk_snapshot_id": "risk_snapshot_example",
"monitoring_period_id": null,
"occurred_at": "2026-10-23T14:00:00Z",
"posted_at": "2026-10-23T14:00:00Z",
"billing_period_start": "2026-10-01T00:00:00Z",
"billing_period_end": "2026-11-01T00:00:00Z",
"rate_card_id": "billing_rate_card_example",
"ledger_entry_id": "billing_credit_entry_example",
"snapshot_id": "billing_snapshot_example"
},
"meta": {
"request_id": "req_example",
"schema_version": "1.4.2",
"generated_at": "2026-10-23T14:00:00Z",
"data_status": "complete"
}
}Retrieve usage record
Read immutable usage charges and correcting reversals. Usage records exist only for actual deductions or their corrections; unfinished work is represented by its processing resource, not a pending credit category. Order by selected time_basis then id. No customer endpoint creates charges. Cancellation stops all further deductions.
Required scope: billing:read. The API key is bound to exactly one workspace, institution and environment. There is no workspace override; this binding applies to every read and export.
curl --request GET --fail-with-body --max-time 30 \
"${AMLOK_API_BASE_URL}/v1/billing/usage/billing_usage_example?snapshot_id=billing_snapshot_example" \
--header "Authorization: Bearer ${AMLOK_API_KEY}" \
--header "Accept: application/json"import os
import requests
base_url = os.environ["AMLOK_API_BASE_URL"].rstrip("/")
headers = {'Accept': 'application/json'}
headers["Authorization"] = "Bearer " + os.environ["AMLOK_API_KEY"]
response = requests.request(
"GET", base_url + "/v1/billing/usage/billing_usage_example?snapshot_id=billing_snapshot_example",
headers=headers, timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(response.json())
const baseUrl = process.env.AMLOK_API_BASE_URL;
const apiKey = process.env.AMLOK_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Configure AMLOK_API_BASE_URL and AMLOK_API_KEY");
const headers = {
"Accept": "application/json"
};
headers.Authorization = `Bearer ${apiKey}`;
const response = await fetch(baseUrl.replace(/\/$/, "") + "/v1/billing/usage/billing_usage_example?snapshot_id=billing_snapshot_example", {
method: "GET", headers,
redirect: "error", signal: AbortSignal.timeout(30000),
});
if (!response.ok) throw new Error(`AMLOK returned HTTP ${response.status}`);
console.log(await response.json());{
"data": {
"id": "billing_usage_example",
"object": "billing_usage",
"record_version": 1,
"created_at": "2026-10-23T14:00:00Z",
"updated_at": "2026-10-23T14:00:00Z",
"workspace_id": "wsp_example",
"billing_account_id": "billing_account_example",
"product": "insights",
"tier": "standard",
"source_resource_id": "wfr_example",
"unit": "completed_underwriting",
"quantity": "1",
"unit_rate": "5.00",
"currency": "CAD",
"amount": "5.00",
"entry_type": "charge",
"reverses_usage_id": null,
"status": "posted",
"subject_id": "biz_example",
"workflow_run_id": "wfr_example",
"application_id": "app_example",
"input_manifest_id": "manifest_example",
"risk_snapshot_id": "risk_snapshot_example",
"monitoring_period_id": null,
"occurred_at": "2026-10-23T14:00:00Z",
"posted_at": "2026-10-23T14:00:00Z",
"billing_period_start": "2026-10-01T00:00:00Z",
"billing_period_end": "2026-11-01T00:00:00Z",
"rate_card_id": "billing_rate_card_example",
"ledger_entry_id": "billing_credit_entry_example",
"snapshot_id": "billing_snapshot_example"
},
"meta": {
"request_id": "req_example",
"schema_version": "1.4.2",
"generated_at": "2026-10-23T14:00:00Z",
"data_status": "complete"
}
}billing:read
Read immutable usage charges and correcting reversals. Usage records exist only for actual deductions or their corrections; unfinished work is represented by its processing resource, not a pending credit category. Order by selected time_basis then id. No customer endpoint creates charges. Cancellation stops all further deductions.
Required scope: billing:read. The API key is bound to exactly one workspace, institution and environment. There is no workspace override; this binding applies to every read and export.
Product scope · Processing lifecycle · ErrorsAuthorizations
Server-to-server API key bound to exactly one workspace, institution tenant and environment. No caller-supplied workspace override is accepted. Do not use in public browser code.
Path Parameters
Authorized resource identifier.
Query Parameters
Reuse an immutable snapshot from this workspace. Omit to use a current snapshot. Cursors bind this value; unknown snapshots return 404 and conflicting cursor parameters return 400.