Skip to content

GetUsage

Source: src/AWS/ApiGateway/GetUsage.ts

Runtime binding for reading usage data of a UsagePlan (apigateway:GET on /usageplans/{id}/usage).

Bind a usage plan inside a function runtime to meter per-key API consumption — the primitive for building billing or quota dashboards. Provide ApiGateway.GetUsageHttp on the Function effect to implement the binding.

// init
const getUsage = yield* ApiGateway.GetUsage(plan);
// runtime
const usage = yield* getUsage({
keyId,
startDate: "2026-07-01",
endDate: "2026-07-14",
});