# Billing from your code (/docs/account/billing/api)

Authenticated with `?privateKey=YOUR_KEY` (see [Authentication](/docs/authentication)). Plans, invoices and payment methods change only in the dashboard or through the [MCP tools](/docs/account/billing/mcp).

<Endpoints ops={["GET /v3/websites/{websiteId}/credit-history", "GET /v3/billing/invoices", "GET /v3/billing/auto-topup", "PUT /v3/billing/auto-topup", "GET /v3/credits/summary", "GET /v3/billing/domains", "GET /v3/billing/open-invoices"]} />

<ApiPlayground
  ops={["GET /v3/websites/{websiteId}/credit-history", "GET /v3/billing/invoices", "GET /v3/billing/auto-topup", "PUT /v3/billing/auto-topup", "GET /v3/credits/summary", "GET /v3/billing/domains", "GET /v3/billing/open-invoices"]}
  method="get"
  path="/v3/websites/{websiteId}/credit-history"
  tool="get_website_credit_history"
  args={`{
  "websiteId": "64b7f0a1c2d3e4f5a6b7c8d9"
}`}
/>

## Use case: Alert before credits run out [#use-case-alert-before-credits-run-out]

Read the latest snapshot every morning: when `creditsRemaining` falls below a tenth of `creditsLimit`, post to your team chat.
