Get started with prepaid credits
This feature is currently in Beta and should not be used in a production environment.
To set up a prepaid billing model for a customer using credits, you need to:
- Create a credits-only plan
- Create a customer
- Start a subscription
- Grant prepaid credits
- Monitor the credit ledger
Metered usage automatically draws down from the grant balance.
Prerequisites
Kong Konnect
If you don’t have a Konnect account, you can get started quickly with our onboarding wizard.
- The following Konnect items are required to complete this tutorial:
- Personal access token (PAT): Create a new personal access token by opening the Konnect PAT page and selecting Generate Token.
-
Set the personal access token as an environment variable:
export KONNECT_TOKEN='YOUR KONNECT TOKEN'
Konnect roles
You need the Metering & Billing Admin role in Konnect to manage credits.
Configured meter
You need a configured meter, such as API Gateway requests or AI Gateway tokens.
Create a credits-only plan
To charge customers via prepaid credits, define a plan with the credit_only settlement mode.
All usage settles against credits.
If a customer runs out of credits, uncovered usage creates a negative credit balance on the ledger rather than generating an overage invoice.
- In the Konnect sidebar, click Metering & Billing.
- Click Product Catalog.
- Click the Plans tab and create a new plan.
- In the Billing section, configure the Currency (for example,
USD) and set the Settlement mode to Credits only. - Click Add Rate Card and select the feature you want to price.
- Configure a Usage based pricing model and set your price per unit.
- Save the rate card and click Publish Plan.
Create a customer
Customers represent the individuals or organizations that subscribe to plans and consume your metered features.
- In the Konnect sidebar, click Metering & Billing.
- In the Metering & Billing sidebar, click Billing.
- Click Create Customer.
- Enter the customer’s Name.
- Map the customer to a Consumer, Application, or Subject to ensure their usage is attributed correctly.
- Click Save.
Start a subscription
Subscriptions link customers to a pricing model and track their usage against rate cards.
- On the customer’s details page, click the Subscriptions tab.
- Add a new subscription and select the credits-only plan you created.
- Choose the start date and finalize the subscription.
Grant prepaid credits
Prepaid credits burn down as the customer incurs usage. Issue a grant directly to the customer’s balance.
- On the customer’s page, click the Credits tab.
- Click Grant Credits and select New credit grant.
- In the Grant section, enter the Credit amount.
- In the Charge section, select Promotional / Free as the charge type.
- Set the Credit availability to Available immediately on grant.
- Optionally, expand Policies to set a Credit draw-down order to control consumption priority if this customer has multiple grants.
- Click Next to review the Grant Summary.
- Click Grant credits to finalize.
A funded movement is recorded in the customer’s transaction history and their settled balance increases immediately.
Monitor the credit ledger
After the grant is issued, the customer’s available balance reflects the new credits.
Because this customer is on a credit_only plan, metered usage automatically deducts from this balance.
- On the customer’s page, click the Credits tab.
- Click Transaction History.
You’ll see:
- A
fundedmovement with a positive amount for the grant you issued. -
consumedmovements with negative amounts as usage charges are applied. - The running balance before and after each movement.
For more on movement types, pagination, and corrections, see Credit transaction history.