Skip to main content

Overview

Every Nevermined account can belong to one or more organizations — first-class workspaces with their own members, agents, plans, and billing. The Payments SDK exposes three building blocks for working with them from your code:
  • List your memberships — every organization you’re an active member of, with your role in each.
  • Publish into a specific workspace — when you register an agent, plan, or API key, tell the SDK which workspace should own it.
  • Read the activity feed — paginated events for everything happening in an organization (member changes, customers, subscriptions, webhook deliveries).
These map to a small, focused surface on payments.organizations and a single optional organizationId argument on the publish methods you already use.
Workspace selection is transported by the X-Current-Org-Id header. The backend resolves it in priority order: route path parameter → this header → the API key’s organization tag → your most-recent active membership → personal account. Pinning a workspace via the SDK is the same control your webapp’s workspace switcher uses.

List the organizations you belong to

Use this to drive a workspace picker in your own tools, or to confirm where a publish will land before sending it.
A typical response (a Premium org and an Enterprise one):
If you have no active memberships the list is empty — you’re operating as a personal account.

Publish into a specific organization

Two ways to choose where a published agent, plan, or API key lands. Pick whichever fits the calling code. Pass organizationId (TypeScript) or organization_id= (Python) to the publish method. The SDK sends X-Current-Org-Id for that call only — your instance-level workspace is untouched.
The same organizationId / organization_id option works on registerAgentAndPlan / register_agent_and_plan and on the plan-registration helpers (registerPlan, registerCreditsPlan, registerTimePlan and their register_*_plan Python equivalents).

Pin a workspace for the whole session

Set the organization once and every subsequent call from this Payments instance — including all sub-APIs (agents, plans, requests, …) — uses it.
You can also pin from the constructor:
Targeting an organization you’re not a member of (or an inactive membership) is rejected by the backend with a 403. The SDK surfaces this as a PaymentsError.

Read the organization activity feed

Paginated events for member changes, customer additions, subscription transitions, and webhook deliveries. Only members of the organization can read it; the backend enforces a Premium+ entitlement.
All filters are optional. The eventType filter accepts a single value or a list of values (sent as a comma-separated list); limit is the page size (backend cap: 200). The known event types you can filter on: New event types are accepted without an SDK upgrade — the eventType field is a plain string in both SDKs. Each event also carries a subject: { kind, id, …extras } payload describing the resource it’s about (e.g. invitations include role + email, members include role + userId, subscriptions include tier).

How workspace context is resolved

When the backend handles an authenticated request, it picks the active organization in this order — the first match wins:
1

Route path

If the URL itself includes :orgId (for example /organizations/{orgId}/activity), that organization is used directly.
2

X-Current-Org-Id header

Set by the SDK from your pin or per-call override. The backend validates that you’re an active member of the requested org before honoring it.
3

API key tag

If your NVM API key was minted scoped to a specific organization, that scope is applied.
4

Fallback membership

Your most-recent active membership — preserves backwards compatibility for single-org callers that don’t set anything explicitly.
5

Personal account

No active membership → resources you publish are owned by your personal account.
The SDK never picks a workspace silently — if you don’t set one, the backend’s fallback rules apply.

Organizations on Nevermined

Concepts, tiers, and the webapp surface for organization owners.

Quickstart — TypeScript

Set up the SDK and publish your first agent.

Quickstart — Python

Set up the Python SDK and publish your first agent.

Payment Models

Fixed, usage-based, and outcome-based pricing patterns.