Skip to main content
Payment plans define the pricing and billing cadence for your service. Every checkout session and invoice in Retempo is tied to a specific plan, so the plan you choose determines how often subscribers are charged, in what amount, and through what mechanism. You can attach multiple plans to a single service — for example, a monthly tier, a weekly trial, and a one-time setup fee can all live under the same service.
All amounts are denominated in USDC.

Pricing types

Retempo supports three pricing types that cover the most common billing models for AI agents, API providers, and SaaS products.

FIXED_RECURRING

Charges the same amount on every billing interval. Use this for subscription tiers where the price doesn’t change month-to-month — a flat $49/month Pro plan, for example.

USAGE_BASED

Bills subscribers based on recorded usage events. The amount on the plan acts as a per-unit rate or cap. Retempo aggregates usage events attached to the invoice before settlement.

ONE_TIME

A single charge with no recurring component. The billingInterval is automatically set to NONE. Use this for setup fees, one-off API credits, or lifetime access purchases.

Billing intervals

The billingInterval field controls how frequently a recurring plan renews. For ONE_TIME plans, always use NONE.
IntervalDescription
MONTHPlan renews every calendar month.
WEEKPlan renews every seven days. Useful for short trials or weekly agent credits.
DAYPlan renews daily. Suitable for high-frequency API billing.
NONENo automatic renewal. Used for one-time charges or manual invoice workflows.

Creating a plan

To create a payment plan, send a POST request to /api/v1/services/:serviceId/plans. You must supply a name, a pricingType, and an amount. The billingInterval defaults to NONE if omitted, and currency defaults to USDC. Below are three examples covering each pricing type.

Monthly fixed plan

curl --request POST \
  --url https://api.retempo.xyz/api/v1/services/svc_01hx9kz3v8mq2t4yw6npd7e/plans \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Pro Monthly",
    "description": "Full API access, billed monthly.",
    "pricingType": "FIXED_RECURRING",
    "billingInterval": "MONTH",
    "amount": "49.000000",
    "currency": "USDC"
  }'
{
  "plan": {
    "id": "plan_01hx9m1bp4nq3s8zt7vce6r",
    "serviceId": "svc_01hx9kz3v8mq2t4yw6npd7e",
    "name": "Pro Monthly",
    "description": "Full API access, billed monthly.",
    "pricingType": "FIXED_RECURRING",
    "billingInterval": "MONTH",
    "amount": "49.000000",
    "currency": "USDC",
    "createdAt": "2025-01-14T10:45:00.000Z"
  }
}

Weekly usage-based plan

curl --request POST \
  --url https://api.retempo.xyz/api/v1/services/svc_01hx9kz3v8mq2t4yw6npd7e/plans \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Metered Weekly",
    "description": "Pay per API call, settled every week.",
    "pricingType": "USAGE_BASED",
    "billingInterval": "WEEK",
    "amount": "0.002000",
    "currency": "USDC"
  }'
{
  "plan": {
    "id": "plan_01hx9m4cq7pr5u2aw8ynf3t",
    "serviceId": "svc_01hx9kz3v8mq2t4yw6npd7e",
    "name": "Metered Weekly",
    "description": "Pay per API call, settled every week.",
    "pricingType": "USAGE_BASED",
    "billingInterval": "WEEK",
    "amount": "0.002000",
    "currency": "USDC",
    "createdAt": "2025-01-14T11:00:00.000Z"
  }
}

One-time setup fee

curl --request POST \
  --url https://api.retempo.xyz/api/v1/services/svc_01hx9kz3v8mq2t4yw6npd7e/plans \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Onboarding Fee",
    "description": "One-time account activation charge.",
    "pricingType": "ONE_TIME",
    "billingInterval": "NONE",
    "amount": "99.000000",
    "currency": "USDC"
  }'
{
  "plan": {
    "id": "plan_01hx9m6dz2ks9r1bx5vtg8m",
    "serviceId": "svc_01hx9kz3v8mq2t4yw6npd7e",
    "name": "Onboarding Fee",
    "description": "One-time account activation charge.",
    "pricingType": "ONE_TIME",
    "billingInterval": "NONE",
    "amount": "99.000000",
    "currency": "USDC",
    "createdAt": "2025-01-14T11:05:00.000Z"
  }
}

Listing plans

To see all payment plans attached to a service, send a GET request to the plans endpoint for that service:
curl --request GET \
  --url https://api.retempo.xyz/api/v1/services/svc_01hx9kz3v8mq2t4yw6npd7e/plans \
  --header 'Content-Type: application/json'
{
  "plans": [
    {
      "id": "plan_01hx9m1bp4nq3s8zt7vce6r",
      "serviceId": "svc_01hx9kz3v8mq2t4yw6npd7e",
      "name": "Pro Monthly",
      "pricingType": "FIXED_RECURRING",
      "billingInterval": "MONTH",
      "amount": "49.000000",
      "currency": "USDC",
      "createdAt": "2025-01-14T10:45:00.000Z"
    },
    {
      "id": "plan_01hx9m4cq7pr5u2aw8ynf3t",
      "serviceId": "svc_01hx9kz3v8mq2t4yw6npd7e",
      "name": "Metered Weekly",
      "pricingType": "USAGE_BASED",
      "billingInterval": "WEEK",
      "amount": "0.002000",
      "currency": "USDC",
      "createdAt": "2025-01-14T11:00:00.000Z"
    },
    {
      "id": "plan_01hx9m6dz2ks9r1bx5vtg8m",
      "serviceId": "svc_01hx9kz3v8mq2t4yw6npd7e",
      "name": "Onboarding Fee",
      "pricingType": "ONE_TIME",
      "billingInterval": "NONE",
      "amount": "99.000000",
      "currency": "USDC",
      "createdAt": "2025-01-14T11:05:00.000Z"
    }
  ]
}