curl https://api.integrateledger.com/v1/usage/42 \
-H "Authorization: Bearer $LEDGER_API_KEY"
import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
const detail = await client.getUsageEvent({ id: 42 });
console.log(detail.charges, detail.overage);
import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
detail = client.get_usage_event(42)
print(detail["charges"], detail["overage"])
{
"event": {
"id": 42,
"customerId": "user_123",
"featureId": "enrich",
"requestId": "operation_123",
"status": "success",
"reason": null,
"outcome": "charged",
"chargedCredits": 4,
"overageCredits": 2,
"occurredAt": "2026-11-18T09:12:44.120Z",
"createdAt": "2026-11-18T09:12:44.120Z",
"featureName": "Enrich data",
"creditCost": 4
},
"charges": [
{
"creditAllocationId": 311,
"sourceType": "plan",
"sourceId": "growth",
"sourceName": "Growth",
"grantedAt": "2026-11-01T00:00:00.000Z",
"expiresAt": "2026-12-01T00:00:00.000Z",
"credits": 2
}
],
"overage": {
"credits": 2,
"unitAmountCents": 100,
"billingUnits": 1,
"rateSource": "plan",
"planName": "Growth",
"costCents": 200,
"billed": false,
"periodStart": "2026-11-01T00:00:00.000Z",
"periodEnd": "2026-12-01T00:00:00.000Z"
}
}
{
"error": "usage_event_not_found",
"message": "No usage event with this id exists in this environment. Take the id from GET /v1/usage with a key for the same environment."
}
Usage
Get a usage event
One tracked request, and the grants and overage it was charged from.
GET
/
v1
/
usage
/
{id}
curl https://api.integrateledger.com/v1/usage/42 \
-H "Authorization: Bearer $LEDGER_API_KEY"
import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
const detail = await client.getUsageEvent({ id: 42 });
console.log(detail.charges, detail.overage);
import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
detail = client.get_usage_event(42)
print(detail["charges"], detail["overage"])
{
"event": {
"id": 42,
"customerId": "user_123",
"featureId": "enrich",
"requestId": "operation_123",
"status": "success",
"reason": null,
"outcome": "charged",
"chargedCredits": 4,
"overageCredits": 2,
"occurredAt": "2026-11-18T09:12:44.120Z",
"createdAt": "2026-11-18T09:12:44.120Z",
"featureName": "Enrich data",
"creditCost": 4
},
"charges": [
{
"creditAllocationId": 311,
"sourceType": "plan",
"sourceId": "growth",
"sourceName": "Growth",
"grantedAt": "2026-11-01T00:00:00.000Z",
"expiresAt": "2026-12-01T00:00:00.000Z",
"credits": 2
}
],
"overage": {
"credits": 2,
"unitAmountCents": 100,
"billingUnits": 1,
"rateSource": "plan",
"planName": "Growth",
"costCents": 200,
"billed": false,
"periodStart": "2026-11-01T00:00:00.000Z",
"periodEnd": "2026-12-01T00:00:00.000Z"
}
}
{
"error": "usage_event_not_found",
"message": "No usage event with this id exists in this environment. Take the id from GET /v1/usage with a key for the same environment."
}
Returns one request from the usage log by its
id, with where its credits came from.
chargeslists each grant the request drew from: its plan or add-on (sourceType,sourceId,sourceName), when it was granted and expires, and thecreditstaken. Grants that expire soonest are spent first.overageis the part recorded as overage: its credits, the rate it was priced at (plan, or a customer’soverride), this request’scostCents, and whether it has beenbilledon an invoice.nullwhen the request stayed within its grants.- A refused request has no
chargesandoverageisnull. - An event from another workspace or environment returns
404 usage_event_not_found.
curl https://api.integrateledger.com/v1/usage/42 \
-H "Authorization: Bearer $LEDGER_API_KEY"
import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
const detail = await client.getUsageEvent({ id: 42 });
console.log(detail.charges, detail.overage);
import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
detail = client.get_usage_event(42)
print(detail["charges"], detail["overage"])
{
"event": {
"id": 42,
"customerId": "user_123",
"featureId": "enrich",
"requestId": "operation_123",
"status": "success",
"reason": null,
"outcome": "charged",
"chargedCredits": 4,
"overageCredits": 2,
"occurredAt": "2026-11-18T09:12:44.120Z",
"createdAt": "2026-11-18T09:12:44.120Z",
"featureName": "Enrich data",
"creditCost": 4
},
"charges": [
{
"creditAllocationId": 311,
"sourceType": "plan",
"sourceId": "growth",
"sourceName": "Growth",
"grantedAt": "2026-11-01T00:00:00.000Z",
"expiresAt": "2026-12-01T00:00:00.000Z",
"credits": 2
}
],
"overage": {
"credits": 2,
"unitAmountCents": 100,
"billingUnits": 1,
"rateSource": "plan",
"planName": "Growth",
"costCents": 200,
"billed": false,
"periodStart": "2026-11-01T00:00:00.000Z",
"periodEnd": "2026-12-01T00:00:00.000Z"
}
}
{
"error": "usage_event_not_found",
"message": "No usage event with this id exists in this environment. Take the id from GET /v1/usage with a key for the same environment."
}
Authorizations
Path Parameters
Response
One tracked request and the grants and overage it was charged from