# Tanso > Tanso is the free, open-source (AGPL-3.0) engine that lets AI agents sign > up, pay for, and use your B2B product: machine-readable pricing, > programmatic signup, and credit-based billing agents can query before they > commit. Built for teams selling credits or usage whose inference costs make > margin per customer a real question. You self-host it; there is no hosted > version. Every metered event carries its cost (tokens, model, provider, cost amount) alongside what was billed for it. Costs and revenue land in one ledger, so margin per customer, per feature, per model falls out of the same system that bills. Enforcement is real-time: entitlement checks, usage caps, and credit limits apply at event ingestion, not at invoice time. Stripe is the optional payment adapter, not the source of truth. ## Where things live - [Source code](https://github.com/tansohq/tanso-oss): AGPL-3.0, full feature set - [Documentation](https://tanso.mintlify.app): quickstart, API reference, MCP setup - [TypeScript SDK](https://www.npmjs.com/package/@tansohq/sdk): official JS/TS client - [Credit Estimator](https://github.com/tansohq/credit-estimator): burndown forecasting for sellers, pre-commit planning for buyers, embeddable widgets; six npm packages under @tansohq (MIT, works with or without Tanso) - [This site](https://tansohq.com): marketing, blog, and pricing research archive - [Machine-readable pricing](https://tansohq.com/pricing.json): this product in the agent-serve pricing.json schema ## Quickstart (Docker is the only prerequisite) git clone https://github.com/tansohq/tanso-oss.git cd tanso-oss/deploy cp .env.example .env # set JWT_SECRET docker compose up -d --build ./setup.sh # seeds a test account, prints credentials - [Full walkthrough](https://tanso.mintlify.app/quickstart): step-by-step self-host guide ## For agents A self-hosted instance can expose an MCP server at /mcp (off by default, enabled by the operator in config). It uses the same API-key auth and account scoping as the REST API, with no separate, weaker path for agents. Tools that spend money require an explicit confirmAction argument. - [MCP setup and tool catalog](https://tanso.mintlify.app/mcp): connection guide - [Agent integration guide](https://tansohq.com/AGENTS.md): REST loop + MCP config - [Agent auth guide](https://tansohq.com/docs/agent-auth.md): API keys, idempotency - [MCP tool reference](https://tansohq.com/api/llms.txt): high-use tools and parameters There is no hosted API at tansohq.com or api.tansohq.com. All integration happens against your own instance. ## Agent-serve (for your customers' agents) A Tanso-powered product can serve its END CUSTOMERS' buying agents, opt-in per account: - Machine-readable pricing at /public/v1/catalog/{slug}/pricing.json (agent-serve pricing.json schema). One GET, no auth, no key. - Programmatic signup: POST /public/v1/catalog/{slug}/signup returns a customer, a free-plan subscription, and a customer-scoped API key in one call. No CAPTCHA, no email loop. - Customer-scoped keys (ck_...) pinned to one customer with read/purchase scopes; deny-by-default everywhere else. - Payments without a browser: SetupIntent pre-authorization, off-session subscribe and credit top-ups; HTTP 402 + pollable checkout session when no card is on file; per-account agent spend caps. - Burndown API: per-feature projections and credit depletion dates; stable error codes; Idempotency-Key replay on mutating requests. ## Core model Feature -> Plan -> Rule (pricing: flat, usage, graduated; optional credit backing) -> Customer (keyed by your IDs) -> Subscription -> Events (idempotent, cost-stamped) -> Entitlements (fail-closed) -> Invoices (Stripe-synced or settled via mark-paid). Credit pricing has two server-side controls, both versioned and effective-dated. A weight tariff sets how many credits one usage unit burns, per feature and model. A price book sets what one credit costs the buyer, per denomination. Entitlement checks return a credit quote with estimated credits and, when priced, estimated cost. ## Integration loop 1. Check an entitlement before serving a request. 2. Serve the request. 3. Report a usage event after. - [Billing lifecycle walkthrough](https://tanso.mintlify.app/billing-lifecycle): the loop in detail ## More context - [Developer resources](https://tansohq.com/developers/llms.txt): APIs, SDK, discovery files - [Product overview](https://tansohq.com/product.md): The engine and the agent-serve surface - [Pricing](https://tansohq.com/pricing.md): free, AGPL-3.0, self-hosted - [How pricing works](https://tansohq.com/how-pricing-works.md): Plans, rules, credits, and enforcement end to end - [Glossary](https://tansohq.com/glossary.md): key terms - [Comparison vs Lago, Autumn, Stripe](https://tansohq.com/compare.md): honest side-by-side - [Billing platform comparison](https://tansohq.com/compare/billing-platforms.md): Wider field, same sourcing standard - [FAQ](https://tansohq.com/faq.md): common questions - [Subprocessors](https://tansohq.com/subprocessors.md): Who processes data for this site - [Full context file](https://tansohq.com/llms-full.txt): everything above in one document ## Free tools - [AI Pricing Finder](https://tansohq.com/ai-pricing-finder.md): how 90+ AI companies price, side by side - [Finder methodology](https://tansohq.com/methodology.md): Sourcing standard and classification rules - [Pricing Finder snapshot, June 2026](https://tansohq.com/data/pricing-finder-snapshot-2026-06-17.json): frozen 73-company dataset analyzed by Forth & Mansard (Pricing for the Agent Economy, Ch. 10) - [Margin Analyzer](https://tansohq.com/margin-analyzer.md): which customers are profitable; CSV stays in the browser - [Credit Estimator page](https://tansohq.com/credit-estimator.md): Embeddable credit forecasting, MIT licensed ## Blog - [Five Credit-Based Pricing Patterns, Pulled From Our Data](https://tansohq.com/blog/credit-pricing-patterns.md): Forth & Mansard analyze the Finder dataset - [PLG for the Agent Era, Part 3: Onboarding Agents](https://tansohq.com/blog/onboarding-agents.md): agent signup, auth, purchasing - [PLG for the Agent Era, Part 2: Is Your Site Ready for AI?](https://tansohq.com/blog/is-your-site-ready-for-ai.md): agent-readiness benchmarks - [PLG for the Agent Era, Part 1: Your Next Customer Might Be an Agent](https://tansohq.com/blog/agents-choosing-software.md): agents shape vendor choice - [The Missing Layer in Your Billing Stack](https://tansohq.com/blog/missing-layer-billing-stack.md) - [AI Credits: Shortcut or Trap?](https://tansohq.com/blog/credits-shortcut-trap.md) - [Self-Serve Isn't Dead. It Just Hasn't Been Rebuilt Yet.](https://tansohq.com/blog/agent-guided-self-serve.md) - [Why Falling Costs Don't Mean Better Margins](https://tansohq.com/blog/falling-costs-margins.md) - [Is Outcome-Based Pricing Real, or Just Marketing Hype?](https://tansohq.com/blog/is-outcome-based-pricing-real.md) - [AI Pricing Under Real Usage](https://tansohq.com/blog/ai-pricing-next.md) - [Outcome-Based Pricing for AI](https://tansohq.com/blog/outcome-based-pricing.md) - [When More Customers Mean Bigger Losses](https://tansohq.com/blog/more-customers-bigger-losses.md) - [Pricing Is a Real Moat in AI SaaS](https://tansohq.com/blog/pricing-moat-ai-saas.md) - [Why Pricing Infrastructure Gets Hard Fast for AI Startups](https://tansohq.com/blog/pricing-infrastructure-complexity.md) - [What's Actually Different About AI Pricing](https://tansohq.com/blog/ai-pricing-differences.md) - [How 30 AI Companies Actually Price Their Products](https://tansohq.com/blog/ai-pricing-research.md)