Sample apps built with the Context Plugin
Four working Maxio Advanced Billing apps, each built by a coding agent with the Maxio Context Plugin installed and calling Maxio only through the typed TypeScript SDK.
A coding agent built four working apps for the billing problems Maxio customers solve every day. It had the Maxio Context Plugin installed, and each app calls Maxio only through the typed TypeScript SDK. Each app opens on a sandbox site with sample data, so you can try it without an API key. A Wire drawer in every app shows each SDK call as it happens: the typed call, the HTTP request and response, timing, retries and how errors were handled.
Meterline: usage billing and prepaid credits
Tiered token metering, event-based billing for GPU-seconds, prepaid credit packs and a projected invoice for an AI API company. 14 SDK operations.
Shift: plan changes with proration
Upgrades, downgrades, seats and add-ons, each previewed before it is applied, plus coupons and scheduled cancellations. 15 SDK operations.
Recover: failed-payment recovery
Past-due accounts by dunning stage, invoice histories, card updates, retries and offline payments for a help-desk SaaS. 15 SDK operations.
Groupwise: B2B consolidated invoicing
Subscription groups for enterprises with many business units, quoted with proforma invoices and billed on one consolidated invoice. 14 SDK operations.
What every app shares
| SDK | maxio-advanced-billing, the TypeScript SDK generated from the Advanced Billing OpenAPI definition |
| Stack | Vite, React, TypeScript, Tailwind; a Cloudflare Pages Function for live mode |
| Sandbox | The real SDK, with ClientOptions.fetch answered by an in-browser simulator that speaks Maxio's wire format. The SDK still decodes and validates every response |
| Live mode | Set MAXIO_SUBDOMAIN and MAXIO_API_KEY as secrets. The app's /api/maxio/* function adds Basic auth on the server and forwards to https://{subdomain}.chargify.com, so the key never reaches the browser |
| Errors | Each app handles real Maxio 422s by narrowing the operation's own typed error, and shows app rules that block a write before Maxio sees it |
The client
All four apps build the client the same way. The site subdomain fills the {site} variable of
https://{site}.chargify.com. The ebb server group is used for event-based billing on events.chargify.com.
import { MaxioAdvancedBillingClient, ServerEnvironment } from "maxio-advanced-billing";
const client = new MaxioAdvancedBillingClient({
serverEnvironment: ServerEnvironment.Us,
serverOptions: { production: { site: "acme" }, ebb: { site: "acme" } },
basicAuth: { username: process.env.MAXIO_API_KEY!, password: "x" },
// GETs and PUTs retry on 408, 429 and 5xx; POSTs are never re-sent
retry: { maxRetries: 2, delay: 400, timeout: 20_000 },
});ClientOptions.fetch is the SDK's one extension point. The apps use it for the Wire drawer, which records every
attempt, and to swap in the sandbox simulator or the live-mode proxy.
How the agent built them
- Installed the plugin. Download it from the Context Plugin page and add it to Claude Code, Cursor or Codex.
- Loaded the integrate skill.
typescript-integrate-maxio-advanced-billingsets a plan-first workflow and routes to the getting-started, calling-endpoints, models, error-handling, client-initialization and testing skills. - Wrote a contract sheet first. From
sdk-map.mdand themap/operations/*.mdpages, the agent listed every operation it would call, with its wire path, request fields, return type and error arms, before writing app code. - Let the compiler check it. Every SDK name and field was checked by
tsc. A smoke test calls each operation against the simulator, and the SDK's own schemas validate every response.