Skip to main content

Hybrid Model

Subscriptions and Topups

Many AI platforms start with subscriptions and later add topups to handle usage spikes.

Usage spikes can dramatically increase infrastructure spend, making subscription-only models insufficient for real-world profitability. That’s why a hybrid billing model, combining stable subscriptions with usage-based topups, is becoming prevalent in the AI economy.

Credyt supports this hybrid approach even if your subscriptions are already managed externally.

  • Subscriptions remain outside Credyt - you keep using your existing PSP and billing system.
  • Credyt is informed when a subscription payment succeeds via the Adjustments API, which credits the customer’s wallet.
  • Topups for additional usage can be handled in two ways:
    • Through Credyt - using the Billing Portal or topup API (requires connecting a Stripe account).
    • Outside Credyt - process the payment with your PSP, then notify Credyt using the Adjustments API.

This lets you add real-time usage billing without rebuilding your subscription flow or changing payment providers.

Implementation guide

Reflect Subscription Payments in Credyt

API Reference

When a subscription renews in your PSP, call the Adjustments API to increase the wallet balance:

POST https://api.credyt.ai/customers/:customerId/wallet/adjustments
{
"transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"account_name": "default",
"asset": "USD",
"amount": 25,
"description": "Monthly Subscription",
"reason": "external_topup",
"expires_at": "2024-07-29T15:51:28.071Z",
"metadata": {
"psp": "stripe",
"payment_intent": "pi_3RjbbNJNSIruR1rb0GwMGpH0"
}
}

Response

{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2024-07-29T15:51:28.071Z"
}

Wallet account balance increases by the subscription value.

Handle Topups for Additional Usage

API Reference

Option A: Use Credyt’s Payment Rails (Stripe Checkout)

  • Customer tops up via Billing Portal (self-service) or Topup API (your UI). Read about Topups.
  • Credyt processes the payment through Stripe.
  • Requires either creating a new Stripe account or connecting your existing one via Credyt.

Option B: Keep Topups External

  • Process the payment with your PSP.
  • Call the Adjustments API to reflect the new balance in Credyt.
POST https://api.credyt.ai/customers/:customerId/wallet/adjustments
{
"transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"account_name": "default",
"asset": "USD",
"amount": 25,
"description": "Ad-hoc usage",
"reason": "external_topup",
"expires_at": "2024-07-29T15:51:28.071Z",
"metadata": {
"psp": "stripe",
"payment_intent": "pi_3RjbbNJNSIruR1rb0GwMGpH0"
}
}

Response

{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2024-07-29T15:51:28.071Z"
}

Send Usage Events

API Reference

Once the wallet is funded (from subscription or topups), usage events will deduct balances in real time:

POST https://api.credyt.ai/events
{
"events": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"customer_id": "cust_473cr1y0ghbyc3m1yfbwvn3nxx",
"event_type": "message_completed",
"occurred_at": "2024-07-29T15:51:28.071Z",
"subject": "chat_5f53d23a4958",
"description": "Chat message completed",
"data": {
"model": "gpt-4-1",
"input_tokens": 2353,
"output_tokens": 34697
}
}
]
}