This guide covers the catalog setup you make as the vendor — both from the Stigg console and via the SDK. Most of these are one-time or infrequent operations; the Check and Ingest calls happen per-request at runtime.
In the Stigg app, go to Governance → Entity types. The list shows all entity types defined for the environment, along with their attribution keys and the last time each was updated.
Click + New entity type to open the creation drawer.
Fill in:
Display name — a human-readable label (e.g. Organization). The entity type ID is auto-generated from it and can be edited.
Attribution keys — the dimension keys your usage events carry to identify instances of this type (e.g. orgId). Type a key and press Enter to add it; multiple keys are supported.
Once created, the new type appears in the list. Hover a row and click the ⋮ menu to Edit it.
Go to Customers → Customer accounts and open the customer record.
Click the Governance tab.
The tab shows the customer’s entity hierarchy on the left, their entity types in the Type column, and — for each entitlement — the current usage vs. limit broken out by scope (Node-wide and per-model or other dimension).
Use the Order by control (the sliders icon next to the type filter) to rank entities by consumption. Two modes are available:
Usage — ranks by absolute consumption, so the heaviest consumers appear first
Utilization — ranks by percentage of limit used, so entities closest to being blocked surface first
Switching to Utilization is the fastest way to spot entities that are about to hit their limit and may need a budget increase or intervention before they get blocked.
M2M client-credentials config (alternative to accessToken)
accountId
Your Stigg account ID
environmentId
The target environment ID
caller
Identifier for the calling service, used in logs
The client exposes six namespaces: governance.entityTypes, governance.entities, governance.capabilities, governance.assignments, governance.check, governance.ingest.Every method returns an Axios response — access .data to get the payload.
Entity types are the categories of resource you want to govern (e.g., org, team, user, agent). Define them once per environment. The attributionKeys are the dimension keys your ingest events carry to identify instances of each type.
When a customer creates an org, team, or user in your product, provision the corresponding entity in governance. The ownerId is the customer’s ID in your system.
Up to 100 entities per request. Idempotent — safe to re-run during re-syncs.Metadata patch semantics: keys present in metadata are merged over existing values. Set a key to "" to delete it. Omitting metadata entirely leaves the stored metadata unchanged.Response (200 OK):
Assignments set the usage limit for an (entity, capability) pair — they are the governance equivalent of entitlements, and appear as entitlement columns in the Stigg console’s Governance tab. They are typically created by your customers through an in-app interface, but you can also set them programmatically.
Patch semantics: on re-upsert, omitting usageLimit or cadence preserves the existing value. On first create, both are required.usageLimit: null — tracked but unlimited: setting usageLimit to null means usage is still counted and appears in check responses, but the limit never blocks. Useful for observability before enforcing.Response (200 OK):
The parentId field places an entity under a parent in the governance hierarchy. The check endpoint evaluates every budget in the chain from the target entity to the root — a request is only granted when all budgets along the path allow it.
parentId is tri-state: omitting it leaves the current parent unchanged (new nodes default to root); null detaches the entity to root; a refId sets or changes the parent. Reparenting is only allowed for leaf nodes — a node with children cannot be moved.
Add a tighter budget for a specific context by setting scopeEntityIds. The scoped budget applies only when every listed entity is present in the resolved set for the request.
await governance.assignments.assignmentControllerUpsert('cus-acme', { assignments: [ // Node-wide budget — always applies { entityId: 'team-eng', capabilityId: 'ai-tokens', scopeEntityIds: [], usageLimit: 200_000, cadence: 'P1M' }, // Tighter budget — applies only when model-gpt4o is in the request context { entityId: 'team-eng', capabilityId: 'ai-tokens', scopeEntityIds: ['model-gpt4o'], usageLimit: 10_000, cadence: 'P1M' }, ],});