@paid-ai/cli
v1.0.0-alpha.1
Published
The monetization platform for AI agents. Design pricing, track costs, and show value.
Keywords
Readme
Paid CLI
OpenAPI-driven command line interface for the Paid API.
npx @paid-ai/cli init
npx @paid-ai/cli product list
npx @paid-ai/cli customer create --file ./customer.jsonThe CLI reads the canonical v2 OpenAPI spec from apps/backend/fern/openapi/v2/openapi.yml.
Commands are generated from OpenAPI tags and operation IDs, so operations are nested by resource while still tracking the spec.
Flat operation ID commands such as list-products are kept as hidden compatibility aliases.
Development
pnpm install
pnpm -C apps/cli run test
pnpm -C apps/cli run buildThe official OpenAPI Generator client can be emitted with:
pnpm -C apps/cli run generate:clientThat command requires a Java runtime because @openapitools/openapi-generator-cli runs the upstream OpenAPI Generator jar.
The CLI command surface is read from the OpenAPI document at runtime. Published packages include the spec at dist/openapi.yml; local development falls back to apps/backend/fern/openapi/v2/openapi.yml.
Auth
Run paid init to open the Paid API keys page and save an API key into ~/.paid.json with owner-only file permissions.
By default, paid init writes a profile named sandbox, labels it Sandbox, and makes it active.
During interactive setup, choose the profile label with the arrow keys: Sandbox, Production, or Custom.
Use paid env to see the active environment profile, its display label, and the API URL currently being used:
paid envYou can also pass credentials without writing config:
PAID_API_KEY=paid_xxx npx @paid-ai/cli product list
npx @paid-ai/cli product list --api-key paid_xxxGlobal options:
--api-key <key>overrides config andPAID_API_KEY--base-url <url>overrides the OpenAPI server URL--env <name>selects a saved environment profile, for examplesandbox,production, ordemo--timeout-ms <ms>controls HTTP timeout
Environment variable equivalents are PAID_API_KEY, PAID_BASE_URL, PAID_ENV, and PAID_ACTIVE_ENVIRONMENT.
Profiles and API URLs
Profiles are named API key/base URL entries in ~/.paid.json.
The active profile is used when --env and PAID_ENV are not set.
Create or update a profile by passing --env to paid init:
paid init
paid init --env sandbox --env-type Sandbox
paid init --env production
paid init --env sandbox --env-type Sandbox --base-url https://sandbox-api.example.com/api/v2
paid init --env demo --env-type "Customer demo"--env only selects a saved profile. It does not automatically switch between production and sandbox API URLs.
The request URL is resolved in this order:
--base-url <url>PAID_BASE_URL- the selected profile's
endpoint - the OpenAPI server URL
The profile type field is a display label set during paid init; routing is controlled by the base URL/endpoint.
Request Bodies
Commands with JSON request bodies accept a file, stdin, or shallow shorthand:
paid customer create --file ./customer.json
cat customer.json | paid customer create --stdin
paid customer create name="Acme Corp" externalId=acme