Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Mesub API reference

@mesub/node wraps this API. Use it directly from any other language.

Base URL

curl "https://api.mesub.io/v1/project" \ -H "Authorization: Bearer $MESUB_API_KEY"
Every route lives under https://api.mesub.io/v1 and takes the project's API key as a bearer token. The key identifies the project: there is no project id in any path. Authentication has the detail.

Conventions

  • Fields are in snake case.
  • Dates are ISO 8601 strings in UTC.
  • Token amounts are strings in the token's smallest unit: "9990000" is 9.99 of a token with six decimals.
  • Statuses and reasons are lowercase. Mesub may add one later: keep a default branch.
  • A body field the route does not know is refused with a 400, not ignored. So is an unknown query parameter on /v1/subscriptions, /v1/access and /v1/events. The other routes ignore one.
  • Every error has the same body, with a code to branch on.

API version

The contract of /v1 is versioned by date. Name the version you wrote your code against in the Mesub-Version header:
curl "https://api.mesub.io/v1/project" \ -H "Authorization: Bearer $MESUB_API_KEY" \ -H "Mesub-Version: 2026-10-02"
2026-10-02 is the only version served today, and no answer depends on the version yet. @mesub/node sends the header on every call.
You sendMesub answers
A version Mesub servesAs that version
No headerAs the first version, 2026-10-02
Anything else, an empty header too400 unsupported_version
The message of an unsupported_version lists the versions served. The API key is checked first: a missing or wrong key answers 401 whatever the header says.
Every answer, errors included, says the version it was served as in its own Mesub-Version header.

Try a request

Each route's page has a Try it button. It opens a panel where you paste an API key, fill the parameters and send the request from your browser.
Calls are real: they act on the project the key belongs to. The key stays in your browser and goes only to the API.
The whole API is also described in one OpenAPI file, which these pages are drawn from. It was copied from the backend at commit fb782da, of 2026-10-20.

Routes

Access

RouteWhat it answersSDK
GET /v1/accessWhether a customer has access to a planhasAccess, access
GET /v1/accessWithout plan: every plan the customer has anything onaccessList
GET /v1/projectThe id of the project the key belongs to

Plans

RouteWhat it answersSDK
GET /v1/plansEvery published plan of the project that has a slug, sortedplans.list
GET /v1/plans/:slugOne plan: name, price, period, token, status, end dateplans.retrieve

Subscriptions

RouteWhat it doessubscriptions.
POST /v1/subscriptionsReserves one, builds what is signedcreate
POST /v1/subscriptions/:id/transactionBuilds a fresh transaction to signtransaction
POST /v1/subscriptions/:id/submitSends what the wallet signedsubmit
GET /v1/subscriptionsA customer's subscriptions, paginatedlist
GET /v1/subscriptions/:idOne subscriptionretrieve
GET /v1/subscriptions/:id/attemptsIts charges, with the total paidattempts
POST /v1/subscriptions/:id/retryCharges a late payment nowretry
POST /v1/subscriptions/:id/cancelBuilds the cancellationcancel
POST /v1/subscriptions/:id/cancel/confirmConfirms itconfirmCancel
POST /v1/subscriptions/:id/resumeBuilds the undo of a cancellationresume
POST /v1/subscriptions/:id/resume/confirmConfirms itconfirmResume
POST /v1/subscriptions/:id/closeBuilds the closing of an ended oneclose
POST /v1/subscriptions/:id/close/confirmConfirms itconfirmClose
See Subscribe from your server and Manage from your server for how these calls chain.

Events

RouteWhat it answersSDK
GET /v1/eventsThe webhook events of the last 30 days, newest firstevents.list
GET /v1/events/:idOne eventevents.retrieve

Pagination

Lists take limit (1 to 100, 20 by default, 25 on events) and starting_after, the id of the last item of the previous page, and answer { data, has_more }. Items come newest first. Attempts add paid, and events add available_since.
Two answers are not paginated: GET /v1/plans answers { plans }, every plan at once, and GET /v1/access without plan answers { plans, revalidate_after }.
GET /v1/subscriptions lists one customer's subscriptions, named by wallet, external_id or email. No route lists every subscription of the project: that list is in the dashboard and the MCP server.
curl -G "https://api.mesub.io/v1/subscriptions" \ -H "Authorization: Bearer $MESUB_API_KEY" \ -d external_id=user_42 \ -d limit=50 \ -d starting_after=cmg1x0abc0001
With the SDK, subscriptions.listAll and subscriptions.allAttempts walk every page for you.

Webhooks

Mesub also calls you. Webhooks lists every event and its payload.