code explains why, for example paid_plan_required.
Buying a plan, top-ups, automatic top-ups and invoices happen in the app under Settings → Workspace → Billing, through Stripe Checkout and the Stripe customer portal. They are not part of the public API.
Self-hosted deployments without billing set billing.provider to none and capabilities.billing to false; every workspace then has the features its deployment enables, without credit.