API Reference
Billing
Read the current plan, usage, invoices, and billing alerts for the active organisation. The billing routes live under
/org/billing/*; this page covers the most common read.GET/org/billing/current-plan
Authentication
Accepts a JWT bearer token (Authorization: Bearer eyJ…) or an API key (X-API-Key: ms_live_…). API-key callers should send X-Project-ID unless the key is project-locked. Cross-tenant operators must send X-Tenant-ID.
Response
Returns 200 OK with the following body.
| Field | Type | Required | Description |
|---|---|---|---|
plan_id | string | optional | Plan slug (free, pro, scale, …). |
status | string | optional | active | past_due | canceled. |
current_period_start | string | optional | RFC 3339 UTC. |
current_period_end | string | optional | RFC 3339 UTC. |
quotas | object | optional | { memory_writes, memory_queries, integrations, … }. |
usage | object | optional | Same shape as quotas with current consumption. |
200.json
{"plan_id": "pro","status": "active","current_period_start": "2026-05-01T00:00:00Z","current_period_end": "2026-06-01T00:00:00Z","quotas": {"memory_writes": 100000,"memory_queries": 1000000},"usage": {"memory_writes": 18421,"memory_queries": 211042}}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Body or query failed schema validation. The error includes the offending field name. |
| 401 | unauthenticated | Missing or invalid bearer token / API key. |
| 403 | forbidden | Authenticated principal lacks the required scope, role, or project access. |
| 404 | not_found | Target resource does not exist or is not visible to the calling tenant. |
| 429 | rate_limited | Per-IP or per-route limit exceeded. Respect the Retry-After header. |
| 500 | internal_error | Unhandled server error. Quote the request_id when contacting support. |
Examples
cURL
curl -X GET https://api.memorysync.io/org/billing/current-plan \-H "Authorization: Bearer $MEMORYSYNC_KEY"
javascript
import { MemorySync } from 'memorysync'const client = new MemorySync({ apiKey: process.env.MEMORYSYNC_KEY })const result = await client.request({method: 'GET',path: '/org/billing/current-plan',})console.log(result)
python
from memorysync import Clientclient = Client(api_key=os.environ["MEMORYSYNC_KEY"])result = client.request(method="GET",path="/org/billing/current-plan",)print(result)
Behavior & notes
Companion routes: GET /org/billing/usage, GET /org/billing/invoices, GET /org/billing/alerts, GET /org/billing/tax. Plan changes apply through POST /org/billing/scheduled-plans at the start of the next period.