GitHub: Get billing premium request usage report for an organization
GitHub billing.billingGetGithubBillingPremiumRequestUsageReportOrg: arguments, response, policy and SDK examples.
← Billing operations · Get started
Operation github.billing_get_github_billing_premium_request_usage_report_org
Provider route: GET /organizations/{org}/settings/billing/premium_request/usage. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["billing"]["billingGetGithubBillingPremiumRequestUsageReportOrg"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.billing.billingGetGithubBillingPremiumRequestUsageReportOrg(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_github import GitHubIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.billing.billing_get_github_billing_premium_request_usage_report_org(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.org | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.year | integer | Optional | |
query.month | integer | Optional | |
query.day | integer | Optional | |
query.user | string | Optional | |
query.model | string | Optional | |
query.product | string | Optional |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get billing AI credit usage report for an organization — response body |
Referenced models: Get billing AI credit usage report for an organization — response body
Schemas
Section titled “Schemas”Get billing AI credit usage report for an organization — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
model | string | Optional | The model for the usage report. |
organization | string | Required within parent | The unique identifier of the organization. |
product | string | Optional | The product for the usage report. |
timePeriod | Model | Required within parent | Expand Get billing usage summary for a user — response body — time Period |
usageItems | array | Required within parent | |
usageItems[] | Model | Each item | Expand Get billing AI credit usage report for a user — response body — usage Items item |
user | string | Optional | The name of the user for the usage report. |
Referenced models: Get billing usage summary for a user — response body — time Period, Get billing AI credit usage report for a user — response body — usage Items item
Get billing usage summary for a user — response body — time Period
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
day | JSON | Optional | |
day (anyOf 1) | integer | Alternative | The day for the usage report. |
day (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
month | JSON | Optional | |
month (anyOf 1) | integer | Alternative | The month for the usage report. |
month (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
year | JSON | Required within parent | |
year (anyOf 1) | integer | Alternative | The year for the usage report. |
year (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Get billing AI credit usage report for a user — response body — usage Items item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
discountAmount | JSON | Required within parent | |
discountAmount (anyOf 1) | number | Alternative | Discount amount of the usage line item. |
discountAmount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
discountQuantity | JSON | Required within parent | |
discountQuantity (anyOf 1) | number | Alternative | Discount quantity of the usage line item. |
discountQuantity (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
grossAmount | JSON | Required within parent | |
grossAmount (anyOf 1) | number | Alternative | Gross amount of the usage line item. |
grossAmount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
grossQuantity | JSON | Required within parent | |
grossQuantity (anyOf 1) | number | Alternative | Gross quantity of the usage line item. |
grossQuantity (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
model | string | Required within parent | Model name. |
netAmount | JSON | Required within parent | |
netAmount (anyOf 1) | number | Alternative | Net amount of the usage line item. |
netAmount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
netQuantity | JSON | Required within parent | |
netQuantity (anyOf 1) | number | Alternative | Net quantity of the usage line item. |
netQuantity (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
pricePerUnit | JSON | Required within parent | |
pricePerUnit (anyOf 1) | number | Alternative | Price per unit of the usage line item. |
pricePerUnit (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
product | string | Required within parent | Product name. |
sku | string | Required within parent | SKU name. |
unitType | string | Required within parent | Unit type of the usage line item. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.billing_get_github_billing_premium_request_usage_report_org. Catalog operation: billing/get-github-billing-premium-request-usage-report-org. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}