Assistant Billing

API Reference

The platform API lets you manage sessions, wallets, API keys, provider keys, and customers programmatically. Access it via the TypeScript SDK (@assistant-billing/sdk) or direct REST calls.

Base URL

https://api.assistant-billing.dev

Or your custom API domain if configured.

Authentication

Two authentication modes — see Authentication for full details.

  • Platform key (sk_pj_*) — server-side operations. Pass as Authorization: Bearer sk_pj_*
  • Session token (sess_*) — client-side operations scoped to a workspace/user. Pass as Authorization: Bearer sess_*

Conventions

  • All responses are JSON.
  • Dates are ISO 8601.
  • Amounts are strings in USD with 6 decimal places (e.g., "1.234567").
  • Pagination uses limit and offset query parameters.
  • IDs are 48-character strings.

Endpoints

Sessions

MethodPathDescription
POST/v1/platform/sessionsCreate a session token

Wallet

MethodPathDescription
GET/v1/platform/wallet/balanceGet wallet balance
GET/v1/platform/wallet/transactionsList wallet transactions
POST/v1/platform/wallet/checkoutCreate a Stripe checkout session

API Keys

MethodPathDescription
GET/v1/platform/api-keysList API keys
POST/v1/platform/api-keysCreate an API key
DELETE/v1/platform/api-keys/:idRevoke an API key

Temporary Keys

MethodPathDescription
GET/v1/platform/temp-keysList temporary keys
POST/v1/platform/temp-keysCreate a temporary key
DELETE/v1/platform/temp-keys/:idRevoke a temporary key

Provider Keys

MethodPathDescription
GET/v1/platform/provider-keys/:providerIdGet provider key status
PUT/v1/platform/provider-keys/:providerIdSet a provider key
DELETE/v1/platform/provider-keys/:providerIdRemove a provider key
POST/v1/platform/provider-keys/:providerIdVerify a provider key

Customers

MethodPathDescription
GET/v1/platform/customersList all customers
GET/v1/platform/customers/:workspace_id/balanceGet customer balance
GET/v1/platform/customers/:workspace_id/transactionsList customer transactions
GET/v1/platform/customers/:workspace_id/usageGet customer usage

Stats

MethodPathDescription
GET/v1/platform/statsGet project statistics

Settings

MethodPathDescription
GET/v1/platform/settingsGet project settings
PUT/v1/platform/settingsUpdate project settings

Project

MethodPathDescription
GET/v1/platform/projectGet project info

Models

MethodPathDescription
GET/v1/platform/modelsList available models

Analytics

MethodPathDescription
GET/v1/platform/analytics/overviewGet analytics overview
GET/v1/platform/analytics/timeseriesGet timeseries data

Cache

MethodPathDescription
GET/v1/platform/cache/statsGet cache statistics