---
title: Billing
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[AI Gateway](https://developers.cloudflare.com/api/go/resources/ai_gateway)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Billing

##### [Get credit balance](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/methods/credit_balance)

client.AIGateway.Billing.CreditBalance(ctx, query) (\*[BillingCreditBalanceResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing%20%3E%20(model)%20BillingCreditBalanceResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/ai-gateway/billing/credit-balance

##### [Get usage history](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/methods/usage_history)

client.AIGateway.Billing.UsageHistory(ctx, params) (\*[BillingUsageHistoryResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing%20%3E%20(model)%20BillingUsageHistoryResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/ai-gateway/billing/usage-history

##### [Get invoice history](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/methods/invoice_history)

client.AIGateway.Billing.InvoiceHistory(ctx, params) (\*[BillingInvoiceHistoryResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing%20%3E%20(model)%20BillingInvoiceHistoryResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/ai-gateway/billing/invoice-history

##### [Get invoice preview](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/methods/invoice_preview)

client.AIGateway.Billing.InvoicePreview(ctx, query) (\*[BillingInvoicePreviewResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing%20%3E%20(model)%20BillingInvoicePreviewResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/ai-gateway/billing/invoice-preview

#### BillingTopup

##### [Create a top-up](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/subresources/topup/methods/create)

client.AIGateway.Billing.Topup.New(ctx, params) (\*[BillingTopupNewResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing.topup%20%3E%20(model)%20BillingTopupNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/ai-gateway/billing/topup

##### [Check top-up status](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/subresources/topup/methods/status)

client.AIGateway.Billing.Topup.Status(ctx, params) (\*[BillingTopupStatusResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing.topup%20%3E%20(model)%20BillingTopupStatusResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/ai-gateway/billing/topup/status

#### BillingTopupConfig

##### [Get auto top-up configuration](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/subresources/topup/subresources/config/methods/get)

client.AIGateway.Billing.Topup.Config.Get(ctx, query) (\*[BillingTopupConfigGetResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing.topup.config%20%3E%20(model)%20BillingTopupConfigGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/ai-gateway/billing/topup/config

##### [Set auto top-up configuration](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/subresources/topup/subresources/config/methods/create)

client.AIGateway.Billing.Topup.Config.New(ctx, params) (\*[BillingTopupConfigNewResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing.topup.config%20%3E%20(model)%20BillingTopupConfigNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/ai-gateway/billing/topup/config

##### [Delete auto top-up configuration](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/subresources/topup/subresources/config/methods/delete)

client.AIGateway.Billing.Topup.Config.Delete(ctx, body) (\*[BillingTopupConfigDeleteResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing.topup.config%20%3E%20(model)%20BillingTopupConfigDeleteResponse%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/ai-gateway/billing/topup/config

#### BillingSpending Limit

##### [Get spending limit (deprecated)](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/subresources/spending_limit/methods/get)

client.AIGateway.Billing.SpendingLimit.Get(ctx, query) (\*[BillingSpendingLimitGetResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing.spending_limit%20%3E%20(model)%20BillingSpendingLimitGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/ai-gateway/billing/spending-limit

##### [Set spending limit (deprecated)](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/subresources/spending_limit/methods/create)

Deprecated

client.AIGateway.Billing.SpendingLimit.New(ctx, params) (\*[BillingSpendingLimitNewResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing.spending_limit%20%3E%20(model)%20BillingSpendingLimitNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/ai-gateway/billing/spending-limit

##### [Delete spending limit (deprecated)](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/billing/subresources/spending_limit/methods/delete)

client.AIGateway.Billing.SpendingLimit.Delete(ctx, body) (\*[BillingSpendingLimitDeleteResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.billing.spending_limit%20%3E%20(model)%20BillingSpendingLimitDeleteResponse%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/ai-gateway/billing/spending-limit