API cleanup (Batch 1): mirror gateway billing/account route renames in SDK/CLI/MCP
Part of a pre-launch API-consistency cleanup happening in run402-private. Several gateway billing/account routes are being renamed for consistency. Because these are admin routes they're excluded from openapi.json/llms-full.txt, but they are baked into the published @run402/sdk, run402-mcp, the CLI, and the sync.test.ts cross-surface contract here — so this repo must mirror the renames in lockstep, and republish.
⚠️ Coordination: the gateway-side change for item 1 is implemented on branch api-cleanup-batch-1 in run402-private (not yet merged/deployed). Do not deploy the gateway rename until this repo's SDK/CLI/MCP changes are merged + published, otherwise published clients calling the old path will 404.
1. Shipping now (gateway side done): lease-perpetual fold-in
POST /billing-accounts/v1/admin/:id/lease-perpetual → POST /billing/v1/admin/accounts/:account_id/lease-perpetual
(The one-route /billing-accounts/v1/* namespace is retired; the toggle joins the /billing/v1/admin/accounts/* family next to credit/debit/set-tier.)
Files to update here:
2. Planned next (gateway shapes pending final design in run402-private)
These are the remaining Batch 1 consolidations. Listed so this repo has the full picture; exact target paths will be confirmed before the gateway change lands, then this issue (or a follow-up) will get the precise mapping.
Naming convention adopted (for reference)
- "admin" = platform staff (us); "operator" = the human customer who owns a billing account. Platform-admin actions stay under
/<resource>/v1/admin/*.
- Path params: resource-qualified snake_case (
:account_id), not bare :id.
cc: tracking the gateway side in run402-private branch api-cleanup-batch-1.
API cleanup (Batch 1): mirror gateway billing/account route renames in SDK/CLI/MCP
Part of a pre-launch API-consistency cleanup happening in
run402-private. Several gateway billing/account routes are being renamed for consistency. Because these are admin routes they're excluded fromopenapi.json/llms-full.txt, but they are baked into the published@run402/sdk,run402-mcp, the CLI, and thesync.test.tscross-surface contract here — so this repo must mirror the renames in lockstep, and republish.1. Shipping now (gateway side done):
lease-perpetualfold-inPOST /billing-accounts/v1/admin/:id/lease-perpetual→POST /billing/v1/admin/accounts/:account_id/lease-perpetual(The one-route
/billing-accounts/v1/*namespace is retired; the toggle joins the/billing/v1/admin/accounts/*family next to credit/debit/set-tier.)Files to update here:
sdk/src/namespaces/admin.ts—setLeasePerpetual()path (~L435/442)sdk/src/namespaces/admin.test.ts— URL assertions (~L214/229/256)src/index.ts— MCP tooladmin_set_lease_perpetualdescription "Calls POST …" (~L690)admin:lease-perpetual— URL buildercli-e2e.test.mjs— mock URL match (~L1883/1908)sync.test.ts— endpoint registry entry (~L374)@run402/sdk+run402-mcp; coordinate timing with the gateway deploy2. Planned next (gateway shapes pending final design in run402-private)
These are the remaining Batch 1 consolidations. Listed so this repo has the full picture; exact target paths will be confirmed before the gateway change lands, then this issue (or a follow-up) will get the precise mapping.
:account_idinstead of:wallet(credit,debit,set-tier) →/billing/v1/admin/accounts/:account_id/{credit,debit,set-tier}/billing/v1/accounts/:idunified to:account_id(UUID) +?wallet=/?email=lookup (today:idmeans wallet or email on GET but a UUID on link-wallet)/tiers/v1/:tier,/billing/v1/tiers/:tier/checkout,/billing/v1/admin/accounts/:wallet/set-tier)/billing/v1/checkouts,/billing/v1/tiers/:tier/checkout,/billing/v1/email-packs/checkout)Naming convention adopted (for reference)
/<resource>/v1/admin/*.:account_id), not bare:id.cc: tracking the gateway side in
run402-privatebranchapi-cleanup-batch-1.