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
| Method | Path | Description |
|---|
| POST | /v1/platform/sessions | Create a session token |
Wallet
| Method | Path | Description |
|---|
| GET | /v1/platform/wallet/balance | Get wallet balance |
| GET | /v1/platform/wallet/transactions | List wallet transactions |
| POST | /v1/platform/wallet/checkout | Create a Stripe checkout session |
API Keys
| Method | Path | Description |
|---|
| GET | /v1/platform/api-keys | List API keys |
| POST | /v1/platform/api-keys | Create an API key |
| DELETE | /v1/platform/api-keys/:id | Revoke an API key |
Temporary Keys
| Method | Path | Description |
|---|
| GET | /v1/platform/temp-keys | List temporary keys |
| POST | /v1/platform/temp-keys | Create a temporary key |
| DELETE | /v1/platform/temp-keys/:id | Revoke a temporary key |
Provider Keys
| Method | Path | Description |
|---|
| GET | /v1/platform/provider-keys/:providerId | Get provider key status |
| PUT | /v1/platform/provider-keys/:providerId | Set a provider key |
| DELETE | /v1/platform/provider-keys/:providerId | Remove a provider key |
| POST | /v1/platform/provider-keys/:providerId | Verify a provider key |
Customers
| Method | Path | Description |
|---|
| GET | /v1/platform/customers | List all customers |
| GET | /v1/platform/customers/:workspace_id/balance | Get customer balance |
| GET | /v1/platform/customers/:workspace_id/transactions | List customer transactions |
| GET | /v1/platform/customers/:workspace_id/usage | Get customer usage |
Stats
| Method | Path | Description |
|---|
| GET | /v1/platform/stats | Get project statistics |
Settings
| Method | Path | Description |
|---|
| GET | /v1/platform/settings | Get project settings |
| PUT | /v1/platform/settings | Update project settings |
Project
| Method | Path | Description |
|---|
| GET | /v1/platform/project | Get project info |
Models
| Method | Path | Description |
|---|
| GET | /v1/platform/models | List available models |
Analytics
| Method | Path | Description |
|---|
| GET | /v1/platform/analytics/overview | Get analytics overview |
| GET | /v1/platform/analytics/timeseries | Get timeseries data |
Cache
| Method | Path | Description |
|---|
| GET | /v1/platform/cache/stats | Get cache statistics |