mirror of
https://github.com/hanzoai/site.git
synced 2026-11-20 21:21:13 +00:00
1 line
3.3 KiB
JSON
1 line
3.3 KiB
JSON
{"text":["Billing & Metering","Hanzo Billing","Subscriptions, usage, invoices. Charge a fixed price, charge for what someone used, or charge for both on the same invoice. Plans, prices, meters, coupons and credits are separate objects, so a pricing change is a new price rather than a migration — and your servers never hold a card number to do any of it.","Read the docs","GitHub","Billing","— Hanzo","Metrics","Dashboards","O11y","AI Metrics","Plans & Pricing","Sessions","Annotation Queues","gateway","Ready","payments-api","checkout-web","Building","docs-site","Every request enters here, so the limiter does too.","api.hanzo.ai","/v1/billing","Open in the console","Example project. Every name in it is one you would give your own.","Paste and ship","Paste this into any agent. It reads the skill manifest and calls Billing from there.","Agent prompt","api","Copy","Read https://hanzo.ai/skill.md and use Hanzo Billing in my project. Start with: hanzo billing balance","What is Hanzo Billing","The objects you bill with","Small pieces that compose, rather than one plan type that has to cover every case.","01","Plans and prices","A plan says what someone gets. A price says what it costs. Keeping them apart is what lets you change a price without touching anyone already on the old one.","02","Meters","Post an event when something is used and the meter aggregates it. The invoice reads the meter at the end of the period, so nobody has to add up rows by hand.","03","Invoices","Line items assembled from the subscription and the meters, with tax calculated on the invoice itself. Preview one before it is issued, which is when a pricing mistake is still cheap.","Capabilities","What the endpoint gives you","Credits and refunds","Issue credit against a balance, or refund a payment that already settled. Both leave a record, because a customer arguing about a bill is really arguing about a history.","Coupons and discounts","Apply one to a subscription or to a single invoice. A discount is an object on the invoice rather than an adjusted number, so the reason the total changed is still legible.","Webhooks","The provider tells us a payment settled and we tell you. One endpoint per provider, so adding a second processor does not mean a second integration on your side.","Get started","Report the use, then charge for it","typescript","import","Hanzo","from","@hanzo/billing","const","billing = new","({","apiKey","process.env.HANZO_API_KEY","});","// Report usage in real time","await","billing.usage.","record","customer","cus_abc123","meter","api_requests","value","timestamp","new","Date","(),","// Subscribe with metered pricing","billing.subscriptions.","create","items","[{","price","price_api_metered","}],","payment_behavior","default_incomplete","View on GitHub","Send your first meter event","Report what someone used, and let the invoice read the meter at the end of the period.","Related capabilities","Logs","Search every line","Time series & SLOs","Get Billing","Metered billing engine","Apache-2.0","License:","hanzoai","Deploy to Cloud"],"links":["https://docs.hanzo.ai/docs/cli/billing","https://github.com/hanzoai","/metrics","/dashboards","/o11y","/cloud/ai-metrics","/billing","/cloud/plans","/cloud/sessions","/cloud/annotation-queues","https://hanzo.team/","/cloud/logs","https://platform.hanzo.ai/deploy"]} |