Skip to content
BlocksAI pricingMenu

AI pricing

Pricing for an agent product: plan columns with a live usage estimate in each, monthly or yearly billing, overage math and a model comparison.

Plan columns with a live usage estimate, monthly or yearly billing and a model comparison.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/ai-pricing.json

Usage

tsx
import { AiPricing } from "@/components/chatcn/sections/ai-pricing"

export default function Pricing() {
  return (
    <AiPricing
      onSelectPlan={({ plan, billing, runs, model }) =>
        startCheckout({ plan: plan.id, billing, estimate: runs * model.creditsPerRun })
      }
    />
  )
}

The estimate multiplies runs a month by the chosen model's credits per run and fills every plan's meter. Past a plan's credits the meter shows the overage and its cost when overagePer1k is set, or Limit reached when it is not. The cheapest plan that fits is marked.

Props

PropTypeDescription
plansAiPricingPlan[]Name, price per period, credits, overage price, models, features.
modelsAiPricingModel[]Name, credits per run and comparison values.
attributesComparisonAttribute[]Rows of the model comparison.
defaultBilling"monthly" | "yearly"Starting billing period. Default yearly.
defaultRunsnumberStarting estimate in runs a month. Default 1,200.
defaultModelstringModel id for the estimate. Defaults to the recommended one.
onSelectPlan(selection) => voidPlan, billing, runs and model: wire checkout here.
currency, localestringFormatting for prices. Default USD and en-US.

Accessibility

  • The estimate is a native range input with a value text in runs a month.
  • Billing period and model are button groups with aria-pressed, inside labelled fieldsets.
  • Each meter is a meter role with its value in credits.
  • The comparison table keeps its first column in view while the rest scrolls on small screens.

Motion

Meters fill with a 280 ms transform. Nothing else moves: prices change in place without counting up, and nothing driven by the keyboard animates.