@useautumn/gateway weekly downloads statistics
Autumn usage tracking adapters for AI SDKs and gateways (Vercel AI SDK, OpenRouter)
@useautumn/gateway has 8,916 recorded weekly downloads on npm, an increase of 54.3% over the past 30 days, ranking #1316 of 3,247 tracked listings.
About @useautumn/gateway
@useautumn/gateway
Autumn adapters for AI SDKs and gateways. Wrap your model or client once and every LLM call's token usage is tracked against the customer's AI credit balance — no manual trackTokens calls.
Autumn converts the token counts to a dollar cost server-side using live models.dev rates plus your configured markup, so pricing changes never require a client redeploy.
Install
Requires Node.js 22+ and ESM imports. The AI SDK adapter targets AI SDK 7 and V4 language models; AI SDK 6 applications should stay on the previous gateway release.
npm install @useautumn/gateway
# or
bun add @useautumn/gateway
Authentication: pass an autumn client (from autumn-js), or set AUTUMN_API_KEY (or AUTUMN_SECRET_KEY) in the environment and omit it.
Vercel AI SDK
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
import { withAutumn } from "@useautumn/gateway/ai-sdk";
const model = withAutumn({
model: openai("gpt-4o"),
customerId: "user_123",
});
const { text } = await generateText({ model, prompt: "Hello!" });
// usage tracked automatically — streaming too
The wrapped model is a drop-in LanguageModelV4. Usage is read per model call from the response (or the stream's finish chunk), including each step in a tool loop, and reported as <provider>/<model> (e.g. anthropic/claude-sonnet-4-5). Tracking does not use AI SDK 7's aggregated top-level result.usage.
OpenAI, Anthropic, and Google provider names are normalized automatically: plain names and dotted SDK namespaces such as openai.responses, anthropic.messages, and google.generative-ai use their models.dev provider keys. Vercel's gateway namespace maps to vercel. Model IDs retain all dots and slashes. Other provider names pass through unchanged; use providerId for a custom mapping. Explicit overrides are always used verbatim.
OpenRouter
import { OpenRouter } from "@openrouter/sdk";
import { withAutumn, trackingSettled } from "@useautumn/gateway/openrouter";
const client = withAutumn({
openRouter: new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY }),
customerId: "user_123",
});
const result = await client.chat.send({
model: "openai/gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});
The wrapper forces OpenRouter usage accounting on every request, tracks chat.send (streaming and non-streaming) and the responses API (including @openrouter/agent's callModel), and reports models as openrouter/<slug> using the response's resolved model — router aliases like openrouter/auto bill against the model that actually served the request. OpenRouter's own reported charge is attached to each event as openrouter_cost.
Streaming usage is tracked in the background; call await trackingSettled(client) before reading balances that must reflect calls just made. For consumption patterns the wrapper doesn't cover, trackOpenRouterUsage({ usage, model, customerId }) accepts both SDK camelCase and raw snake_case usage objects.
Options
Both adapters accept the shared tracking options:
| Option | Required | Description |
|---|---|---|
customerId | Yes | Autumn customer ID to attribute usage to |
autumn | No | autumn-js client; falls back to AUTUMN_API_KEY env |
featureId | No | Target AI credit system feature (auto-detected if you have one) |
entityId | No | Entity for entity-scoped balances |
properties | No | Extra properties attached to each usage event |
Tracking failures are caught and logged — they never break your AI responses.
Docs
Description from the npm listing.
- autumn
- billing
- usage-based-billing
- ai-sdk
- openrouter
- llm
- token-tracking
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm AI SDKs plugins
All 20 @useautumn/gateway alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@useautumn/gateway. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.