@stigg/agent-sdk-js adds gating, metering and budgets to the LLM calls your agents make. See LLM wrappers for setup.
npm also lists versions 1.0.0, 1.0.1, 1.1.0 and 2.0.0. Those are pre-release builds published before the package was re-versioned, and they aren’t supported. Install 0.1.0 or later.
2026-10-14
Databricks
- Added:
databricksRecipe, matched automatically on a Databricks workspace’s/serving-endpointsor/ai-gateway/mlflow/v1URL. It covers both anOpenAIclient pointed at the workspace and Databricks’ own@databricks/sdk-modelservingqueryclient, and emitsdatabricks.chat.completions.create,databricks.responses.createanddatabricks.query. - Added: the model that answered is recorded as a dimension. On Databricks the
modelyou send is a serving endpoint name, so the response is the only place the real model appears. - Added:
databricksExternalRecipefor serving endpoints configured as external models, where the upstream provider bills you instead of Databricks. It emitsdatabricks-external.*events. It’s opt-in, because the two routes look identical from the client:stigg.wrap(client, { recipe: databricksExternalRecipe() }). - Neither recipe reports a
costmetric, because Databricks doesn’t state a price on any response. A workspace on a custom domain needs its base URL passed in:databricksRecipe({ baseUrl }).
- Added:
cloudflareRecipe, matched automatically for both Workers AI (api.cloudflare.com/client/v4/accounts/<id>/ai/v1) and AI Gateway (gateway.ai.cloudflare.com). It covers anOpenAIclient and thecloudflarepackage’s ownai.run, and emitscloudflare.chat.completions.create,cloudflare.responses.create,cloudflare.messages.createandcloudflare.ai.run. - Reports token counts only. Cloudflare doesn’t state a price or Neuron count on any response, so there’s no
costmetric. - On AI Gateway, the model that served and the
cf_aig_log_idare recorded as dimensions, and a cache hit isn’t metered because no one was billed for it. - Known limitation: a streamed
ai.runcall is gated but not metered, because Cloudflare returns raw SSE bytes for it.
2026-10-13
Initial release.Core
- Added:
StiggAgentSDK. Pass an API key, or one options object for the base URL, ingest mode and hooks. - Added:
stigg.wrap(client, { stiggContext }), which returns a copy of a vendor client whose calls are checked and metered. The context names the customer, the agent the call is attributed to, and an optionalentitlement. Naming an entitlement turns on gating. Without one, calls are metered but never refused. Any call can override the context in its own parameters, so one wrapped client can serve every customer. - Added:
stigg.register()andstigg.deregister()to create an agent entity with a budget and a parent. Both are optional. Without them, checks and usage apply to the customer. - Added: a refused call throws
AccessDeniedError. Pass it tostigg.denial(err)to get the decision, including which entity blocked the call and how to fix it. - Added:
ingest: 'async' | 'sync'. Usage is reported as raw events by default. A metric named after a credit currency draws the credit balance directly. Metering failures go to theonErrorhook and never break the call. - Added:
unitsPerTokensandweightedMetricsfor pricing token counts in code. Stigg recommends reporting raw token counts and converting them in Stigg instead.
- Added: Anthropic, OpenAI (Chat Completions and Responses), Google Gemini (models and chats), Groq, Mistral, Ollama and TypeSafe.
- Added: any other OpenAI-compatible endpoint, metered under
openai.*events.
- Added: OpenRouter, through an
OpenAIclient or OpenRouter’s own@openrouter/sdk. Reportscostand the model that served. - Added: LiteLLM. Reports
costfrom the response header and the model that served. - Added: Amazon Bedrock. Reports tokens only, because Bedrock doesn’t state a price.
- Added: a gateway you operate yourself. The wrapped client sends attribution as
x-stigg-*headers, and your gateway reports usage withstigg.ingestFromHeaders(...). This path meters but can’t refuse calls.