← UsageTapCONTENT HISTORY

Update to UsageTap

Snapshot Oct 24, 2026 · 13:23 UTC · version 1.1.0

Collection source: downloaded plugin package.

WHAT CHANGED

First saved snapshot

No earlier snapshot is available to establish a change.

Save UsageTap and check future changes in Following.

Up to 10 plugins free · no card required.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "description": "Add or repair UsageTap Meter in an existing server-side JavaScript or TypeScript application that calls OpenAI, Anthropic, or OpenRouter. Use when the user asks to instrument, wrap, meter, attribute, or verify LLM calls; do not use for ordinary usage analysis, pricing-plan design, Gateway adoption, or prompt compression.",
  "included_files": [
    {
      "relative_path": "agents/openai.yaml",
      "size_in_bytes": 248
    },
    {
      "relative_path": "references/integration-contract.md",
      "size_in_bytes": 4507
    },
    {
      "relative_path": "references/staging-evals.md",
      "size_in_bytes": 2982
    }
  ],
  "name": "integrate-usagetap",
  "skill_md_contents": "---\nname: integrate-usagetap\ndescription: Add or repair UsageTap Meter in an existing server-side JavaScript or TypeScript application that calls OpenAI, Anthropic, or OpenRouter. Use when the user asks to instrument, wrap, meter, attribute, or verify LLM calls; do not use for ordinary usage analysis, pricing-plan design, Gateway adoption, or prompt compression.\n---\n\n# Integrate UsageTap\n\nImplement the smallest safe UsageTap Meter change in the user's existing application. Preserve its provider, model selection, request and response shapes, streaming behavior, and error semantics.\n\nDo not stop at a plan or generic sample when the user asked for implementation and the repository is writable. Inspect, edit, and validate the actual integration.\n\n## Establish the contract\n\nBefore editing:\n\n1. Read `https://usagetap.com/llmreference` and treat it as the canonical current contract.\n2. Use `https://usagetap.com/embed-api?features=meter` for maintained stack-specific examples when needed.\n3. If the public reference is unavailable, read [references/integration-contract.md](references/integration-contract.md).\n4. Inspect the installed `@usagetap/sdk` version, exports, lockfile, and any local UsageTap documentation. Prefer the installed version's real API over a stale example, and report a material conflict rather than guessing.\n\n## Inspect the application\n\nFind the server runtime, package manager, provider SDKs, every relevant LLM call site, streaming paths, error handling, environment-file convention, tests, and the server-trusted customer or tenant identity.\n\nPreserve unrelated user changes. Do not instrument browser code with a UsageTap credential. Do not instrument test fixtures, examples, or dead code unless the user explicitly put them in scope.\n\nIf a stable server-trusted `customerId` cannot be identified, ask one concise question before choosing one. Do not substitute an email address, display name, request ID, session ID, or a newly generated value. Prefer the application's durable account or tenant identifier; add a stable non-PII end-user ID only when useful and already available.\n\n## Choose the integration\n\nRead [references/integration-contract.md](references/integration-contract.md) for the selection rules and invariants.\n\n- Prefer `withMetering` for supported OpenAI, Anthropic, and OpenRouter clients when UsageTap can wrap the existing provider call without changing application decisions.\n- Preserve the Anthropic call shape already in use. `@usagetap/sdk` 1.6.0 and newer retain `messages.create()` response helpers such as `.withResponse()` and `.asResponse()`, and support both `messages.create({ stream: true })` and synchronous `messages.stream()`, including event handlers, async iteration, cancellation, and final-message helpers. Do not rewrite one form into the other unless the installed UsageTap SDK predates that support.\n- Use `UsageTapClient.withUsage`, `beginCall`/`endCall`, or the documented HTTPS lifecycle when the application must inspect entitlements before selecting a model or tool, implement BLOCK or DOWNGRADE behavior, or coordinate an unsupported call shape.\n- Detect existing instrumentation before adding anything. Repair or extend it instead of double-wrapping or double-reporting a call.\n- Keep the wrapper near the authenticated request boundary when customer identity varies per request. Never bind all tenants to a sample or constant customer ID.\n\n## Implement safely\n\n- Add only the dependency and imports required by the chosen path.\n- Keep UsageTap and provider credentials in the server runtime. Never read, print, log, transmit, or commit secret values. Add variable names with placeholder values only to the project's example environment file; do not modify `.env`, `.env.local`, secret stores, or deployment configuration unless the user explicitly asks.\n- Reuse the application's existing provider client and model. Do not migrate providers or change models as part of metering.\n- Use a meaningful low-cardinality feature name derived from the product operation.\n- Preserve retries and use one idempotency key per logical UsageTap call, reusing it only for retries of that same call.\n- Ensure allowed calls finalize on success, provider error, stream completion, cancellation, and abort. A call denied by `call_begin` is already finalized and must not invoke the provider or call `call_end`.\n- Report provider-returned model and usage fields when available. Sanitize error metadata; never include prompts, responses, credentials, headers, or raw provider bodies.\n\nDo not add UsageTap Gateway, prompt compression, sampling or payload capture, provider migration, model changes, Stripe synchronization, plan mutation, browser embed sessions, or admin automation unless the user asks for that separate capability.\n\n## Validate and hand off\n\nRun focused tests plus the relevant type, lint, and build checks available in the repository. Add tests for the changed boundary when the project has a compatible test setup. Do not make a paid or externally visible live provider request unless the user explicitly authorizes it.\n\nWhen a connected UsageTap MCP server and an already-produced test call are available, use `find_customers` if identity resolution is needed, then `list_calls` with the exact customer ID and a bounded explicit time range. Verify customer attribution, feature, status, provider/model, and token fields. Do not claim live verification from code inspection alone.\n\nFinish with:\n\n- the call sites instrumented and the integration path chosen;\n- validation that ran and anything not run;\n- environment-variable names still required, without values;\n- the exact command or request that produces the first metered call;\n- any unresolved customer-identity or deployment action;\n- links to UsageTap [Live View](https://usagetap.com/live) and [Code Integration](https://usagetap.com/embed-api?features=meter).\n\nFor skill evaluation rather than an actual integration, use [references/staging-evals.md](references/staging-evals.md).\n"
}

SHA-256 of public snapshot: 5425f2fa61aa04ec73a5fc25f127dd5dc14ac14066a553d3c04827d61ec605fa