{"_id":"@ai-token-tracker/sdk","_rev":"9-89af33060476561c011a5c13fade9913","name":"@ai-token-tracker/sdk","dist-tags":{"latest":"0.2.7"},"versions":{"0.1.0":{"name":"@ai-token-tracker/sdk","version":"0.1.0","author":{"name":"AiTokenTracker"},"license":"UNLICENSED","_id":"@ai-token-tracker/sdk@0.1.0","maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"dist":{"shasum":"685193fa8b04824c0f901b590a267f3ad17de48c","tarball":"https://registry.npmjs.org/@ai-token-tracker/sdk/-/sdk-0.1.0.tgz","fileCount":12,"integrity":"sha512-IGBfpL1TiCOpBDZaPRKskTbAPUU57TqZVAIXiCNEwuWYoE5hdM9nOcKTPPOcbjBpo+RSvfA5WXaNn7sC1pKzVQ==","signatures":[{"sig":"MEQCIE7ZeG60TX5G4gNhaBl7Ans2JylzrSsJ57JVCprk4eJuAiB10lSatkq4St/7K9lbFN/G+FTP/JzoqNr2Ug4LzGNopg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57989},"main":"./dist/index.cjs","type":"module","types":"./dist/types/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"d907b61228de8957ef01e129100df52b0b25f99e","scripts":{"test":"vitest run","build":"rm -rf dist && bun run build:esm && bun run build:cjs && bun run build:types","build:cjs":"bun build ./src/index.ts --target=node --format=cjs --outfile ./dist/index.cjs","build:esm":"bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js","typecheck":"tsc --noEmit","build:types":"tsc -p tsconfig.build.json","prepublishOnly":"bun run build"},"_npmUser":{"name":"ai-token-tracker","email":"support@aitokentracker.dev"},"_npmVersion":"10.9.2","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.5","typescript":"5.9.3","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1778611066318_0.8010507730564183","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@ai-token-tracker/sdk","version":"0.2.0","author":{"name":"AiTokenTracker"},"license":"UNLICENSED","_id":"@ai-token-tracker/sdk@0.2.0","maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"dist":{"shasum":"f983ed815ad62f8af838ed301cb9c04c7ab9a441","tarball":"https://registry.npmjs.org/@ai-token-tracker/sdk/-/sdk-0.2.0.tgz","fileCount":12,"integrity":"sha512-2q+dPT7M/8Su4ci81Gk8+I9npPl0uaC+Jzf8TfURv+wrh7hNwy4g82oof2Pwhu/bsIsCEIG7eC6n8/pQDrTgiw==","signatures":[{"sig":"MEUCIFEQHL7Cq023dTXaZ5m+eW8AI/wRkR2M91WQWgG+LjFAAiEAjfjvRvzSRLgSmmie6emgnFOtOeMi6RyEN5JpoCsuKrA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57576},"main":"./dist/index.cjs","type":"module","types":"./dist/types/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"d907b61228de8957ef01e129100df52b0b25f99e","scripts":{"test":"vitest run","build":"rm -rf dist && bun run build:esm && bun run build:cjs && bun run build:types","build:cjs":"bun build ./src/index.ts --target=node --format=cjs --outfile ./dist/index.cjs","build:esm":"bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js","typecheck":"tsc --noEmit","build:types":"tsc -p tsconfig.build.json","prepublishOnly":"bun run build"},"_npmUser":{"name":"ai-token-tracker","email":"support@aitokentracker.dev"},"_npmVersion":"10.9.2","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.5","typescript":"5.9.3","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.0_1778612055281_0.11057604251506303","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@ai-token-tracker/sdk","version":"0.2.1","author":{"name":"AiTokenTracker"},"license":"UNLICENSED","_id":"@ai-token-tracker/sdk@0.2.1","maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"dist":{"shasum":"7d018daa9769fff3fe04cf9aac945955128663f2","tarball":"https://registry.npmjs.org/@ai-token-tracker/sdk/-/sdk-0.2.1.tgz","fileCount":12,"integrity":"sha512-7uHtQQsTHpxAR/udNd9BR0sxILaigdpDKHugsRkfSGUui168CQrGeFmOpdHcCdow5aPkwhIaOcM+GDi7VTjxLA==","signatures":[{"sig":"MEQCIEh7loXzJld5GwDA7cIDYkZDZ/go2nIwALhG2lBweKZSAiAWzbzw618ZkuWxLiYu8DIa8mQo8aN8Zv7Mc+LEZlGbCw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57158},"main":"./dist/index.cjs","type":"module","types":"./dist/types/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"a824a387a8006f1d34b879250629350f156fa3b0","scripts":{"test":"vitest run","build":"rm -rf dist && bun run build:esm && bun run build:cjs && bun run build:types","build:cjs":"bun build ./src/index.ts --target=node --format=cjs --outfile ./dist/index.cjs","build:esm":"bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js","typecheck":"tsc --noEmit","build:types":"tsc -p tsconfig.build.json","prepublishOnly":"bun run build"},"_npmUser":{"name":"ai-token-tracker","email":"support@aitokentracker.dev"},"_npmVersion":"10.9.2","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.5","typescript":"5.9.3","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.1_1779237681871_0.9686104470498826","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@ai-token-tracker/sdk","version":"0.2.2","author":{"name":"AiTokenTracker"},"license":"UNLICENSED","_id":"@ai-token-tracker/sdk@0.2.2","maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"dist":{"shasum":"bafd064658ccc2e5309d4b63dbed2ba4a63b96ba","tarball":"https://registry.npmjs.org/@ai-token-tracker/sdk/-/sdk-0.2.2.tgz","fileCount":12,"integrity":"sha512-7FUH98LmEYKSxCYlEH6F8gYYk6dJaWKyJN3zjjAfJeONbDIAG+72fVh1cF8KuAUz9FvFl9EGYqH/Ove+WwXzXQ==","signatures":[{"sig":"MEQCIHwWUGdy1r2X6GWnYT6UU9+WJjt5gPUcNyfODjHMIfpWAiBcjWP8UhldQo3lUaoChFuDkHlHNrzEcLg9mQmDVHQ8zw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59006},"main":"./dist/index.cjs","type":"module","types":"./dist/types/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"a824a387a8006f1d34b879250629350f156fa3b0","scripts":{"test":"vitest run","build":"rm -rf dist && bun run build:esm && bun run build:cjs && bun run build:types","build:cjs":"bun build ./src/index.ts --target=node --format=cjs --outfile ./dist/index.cjs","build:esm":"bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js","typecheck":"tsc --noEmit","build:types":"tsc -p tsconfig.build.json","prepublishOnly":"bun run build"},"_npmUser":{"name":"ai-token-tracker","email":"support@aitokentracker.dev"},"_npmVersion":"10.9.2","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.5","typescript":"5.9.3","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.2_1779238552354_0.6122683762549666","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@ai-token-tracker/sdk","version":"0.2.3","author":{"name":"AiTokenTracker"},"license":"UNLICENSED","_id":"@ai-token-tracker/sdk@0.2.3","maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"dist":{"shasum":"58f0d4330606c37a4e7cc450255b1766b1b72a43","tarball":"https://registry.npmjs.org/@ai-token-tracker/sdk/-/sdk-0.2.3.tgz","fileCount":12,"integrity":"sha512-KGn0uIfNXkG1oDMPt+5/XJWzExAr4SybGC5M5GFxHfPgv2pgkzZbFx9Pe+Th26Wgkk6z+hZN57FuJKg3i/5ARg==","signatures":[{"sig":"MEYCIQDpaZxJLAkaUdmN3GxdBRqkIFjy55ir9qIMnULC3yrDDgIhAI1PMaaj4mtaR/rhv3b1vWpurad5Zdk89h2DM9ZcI2W0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59033},"main":"./dist/index.cjs","type":"module","types":"./dist/types/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"e421aedcc4c20cf290be93ea5c2e19f97d157604","scripts":{"test":"vitest run","build":"rm -rf dist && bun run build:esm && bun run build:cjs && bun run build:types","build:cjs":"bun build ./src/index.ts --target=node --format=cjs --outfile ./dist/index.cjs","build:esm":"bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js","typecheck":"tsc --noEmit","build:types":"tsc -p tsconfig.build.json","prepublishOnly":"bun run build"},"_npmUser":{"name":"ai-token-tracker","email":"support@aitokentracker.dev"},"_npmVersion":"10.9.2","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.5","typescript":"5.9.3","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.3_1779281964978_0.532574003321802","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@ai-token-tracker/sdk","version":"0.2.4","author":{"name":"AiTokenTracker"},"license":"UNLICENSED","_id":"@ai-token-tracker/sdk@0.2.4","maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"dist":{"shasum":"d1099a3287f5183672773164344f7e5914942fe1","tarball":"https://registry.npmjs.org/@ai-token-tracker/sdk/-/sdk-0.2.4.tgz","fileCount":12,"integrity":"sha512-H4DkvJ1lb2wGdvmMcQw+Dr2erKqN06/Tv8OByjfV9o9ct7o9EbLMz78NStW5jBicRfj2CnLct25MRlcOGo/7BQ==","signatures":[{"sig":"MEYCIQD0EgZhlBVxVy7OLWqYWwVHvTkt4eR49cIR6Y8PyeZVhQIhALrAe+Mrlk0oyU3v+iU8y54VXG05xefIRsqGJmWX+f8h","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59945},"main":"./dist/index.cjs","type":"module","types":"./dist/types/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"fbfb54dc6c60f1ae4b3c0ac198d607f1ecd1127a","scripts":{"test":"vitest run","build":"rm -rf dist && bun run build:esm && bun run build:cjs && bun run build:types","build:cjs":"bun build ./src/index.ts --target=node --format=cjs --outfile ./dist/index.cjs","build:esm":"bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js","typecheck":"tsc --noEmit","build:types":"tsc -p tsconfig.build.json","prepublishOnly":"bun run build"},"_npmUser":{"name":"ai-token-tracker","email":"support@aitokentracker.dev"},"_npmVersion":"10.9.2","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.5","typescript":"5.9.3","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.4_1779289672803_0.4822652407124295","host":"s3://npm-registry-packages-npm-production"}},"0.2.5":{"name":"@ai-token-tracker/sdk","version":"0.2.5","author":{"name":"AiTokenTracker"},"license":"UNLICENSED","_id":"@ai-token-tracker/sdk@0.2.5","maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"dist":{"shasum":"8fbb5d7da5c64d1f43d48a411f016d26caafe97b","tarball":"https://registry.npmjs.org/@ai-token-tracker/sdk/-/sdk-0.2.5.tgz","fileCount":12,"integrity":"sha512-HFdJAJQt9wc8iKmZhuEXQICVV+D+hIJatyzB3NACe7P2AosGjkOCJ92BSUfSaG+jx94Tm4SBu/BLK5RhtKdc7w==","signatures":[{"sig":"MEUCIQCb5K8/0IMcuvDQxFGFwyZLAPPRnE6n9qI197OFj7c+LQIgci6y8YuPXZSI1Q71Brfj71bg81wmElpoPZuaPWFwcGI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59488},"main":"./dist/index.cjs","type":"module","types":"./dist/types/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"eae4b00396dad4ac8a50171f01510906e26d4f88","scripts":{"test":"vitest run","build":"rm -rf dist && bun run build:esm && bun run build:cjs && bun run build:types","build:cjs":"bun build ./src/index.ts --target=node --format=cjs --outfile ./dist/index.cjs","build:esm":"bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js","typecheck":"tsc --noEmit","build:types":"tsc -p tsconfig.build.json","prepublishOnly":"bun run build"},"_npmUser":{"name":"ai-token-tracker","email":"support@aitokentracker.dev"},"_npmVersion":"10.9.2","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.5","typescript":"5.9.3","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.5_1779841797550_0.7693535685821649","host":"s3://npm-registry-packages-npm-production"}},"0.2.6":{"name":"@ai-token-tracker/sdk","version":"0.2.6","author":{"name":"AiTokenTracker"},"license":"UNLICENSED","_id":"@ai-token-tracker/sdk@0.2.6","maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"dist":{"shasum":"b0bc4b486195c564240818019d5d9577a3d6091c","tarball":"https://registry.npmjs.org/@ai-token-tracker/sdk/-/sdk-0.2.6.tgz","fileCount":12,"integrity":"sha512-24E5qIQc8NxZpKWuMHYhsc87ZL7XF1iVGFUoBnJXDY1Y1+dZG8w9EYUUyNNedTnuehTX2eXMS+EdDJnUShliHA==","signatures":[{"sig":"MEQCIF17aiyhpktlYERLntODLUKyZWdJC+zFK010PFTgemxzAiAy/eFC1Hi3GpuuG06EjQrWXKsmnIIgf6Oy7QXID83p4A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48356},"main":"./dist/index.cjs","type":"module","types":"./dist/types/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"d21d2762410de6dca37cd23002685f52d02ccb0d","scripts":{"test":"vitest run","build":"rm -rf dist && bun run build:esm && bun run build:cjs && bun run build:types","build:cjs":"bun build ./src/index.ts --target=node --format=cjs --outfile ./dist/index.cjs","build:esm":"bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js","typecheck":"tsc --noEmit","build:types":"tsc -p tsconfig.build.json","prepublishOnly":"bun run build"},"_npmUser":{"name":"ai-token-tracker","email":"support@aitokentracker.dev"},"_npmVersion":"10.9.2","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.5","typescript":"5.9.3","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.6_1781196838700_0.7625871838794656","host":"s3://npm-registry-packages-npm-production"}},"0.2.7":{"name":"@ai-token-tracker/sdk","version":"0.2.7","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","license":"UNLICENSED","author":{"name":"AiTokenTracker"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"scripts":{"build":"rm -rf dist && bun run build:esm && bun run build:cjs && bun run build:types","build:esm":"bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js","build:cjs":"bun build ./src/index.ts --target=node --format=cjs --outfile ./dist/index.cjs","build:types":"tsc -p tsconfig.build.json","test":"vitest run","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"devDependencies":{"@types/node":"^25.5.0","typescript":"5.9.3","vitest":"^3.0.5"},"_id":"@ai-token-tracker/sdk@0.2.7","gitHead":"65991470550faa58daea7197b539ebdae3372790","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-DaUjON6Uv92tVhZ2Mvc2FQPFmtRCWdzyMRggBqFtwGDOYbw6lXJBN8OcMX7Hou5iDHocu1444CxQE3AX/2y+uA==","shasum":"5df61bbc28e52e053d7a9033ff70423461b82f33","tarball":"https://registry.npmjs.org/@ai-token-tracker/sdk/-/sdk-0.2.7.tgz","fileCount":12,"unpackedSize":48530,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFAmxjv0CCj/7Nr2Ybg4iJ+DSeRbhNERz4QBxdUTj73wAiB3dxjCczhOcd68zuwkmbIe7W28TAzslIybXY7PmwKrJg=="}]},"_npmUser":{"name":"ai-token-tracker","email":"support@aitokentracker.dev"},"directories":{},"maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.2.7_1786405854059_0.35345552035192385"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-12T18:37:46.188Z","modified":"2026-08-10T23:50:54.334Z","0.1.0":"2026-05-12T18:37:46.496Z","0.2.0":"2026-05-12T18:54:15.421Z","0.2.1":"2026-05-20T00:41:22.053Z","0.2.2":"2026-05-20T00:55:52.512Z","0.2.3":"2026-05-20T12:59:25.127Z","0.2.4":"2026-05-20T15:07:52.967Z","0.2.5":"2026-05-27T00:29:57.733Z","0.2.6":"2026-06-11T16:53:58.851Z","0.2.7":"2026-08-10T23:50:54.202Z"},"author":{"name":"AiTokenTracker"},"license":"UNLICENSED","description":"TypeScript SDK for AiTokenTracker ingest and SDK call-scope tracking.","maintainers":[{"name":"ai-token-tracker","email":"support@aitokentracker.dev"}],"readme":"# AiTokenTracker TypeScript SDK\n\n`@ai-token-tracker/sdk` captures LLM request/response envelopes and sends them to your ingest API.\n\nThis v1 package mirrors the .NET SDK wrapper and explicit ingest behavior:\n\n1. `AiTokenTrackerIngestionClient` for direct envelope ingest.\n2. `AiTokenTrackerSdkClient` + call scope for provider SDK wrappers.\n\n## Installation\n\n```bash\nnpm install @ai-token-tracker/sdk\n```\n\n## Requirements\n\n- Node.js 18+\n\n## Configuration\n\n```ts\nimport { AiTokenTrackerIngestionClient } from \"@ai-token-tracker/sdk\";\n\nconst ingestionClient = new AiTokenTrackerIngestionClient({\n  authToken: \"your-subscription-or-api-key\",\n  enableAutoInterception: true, // optional\n});\n```\n\n`enableAutoInterception` defaults to `true`.\n\n## Wrapper Integration (`beginLlmCall`)\n\n```ts\nimport {\n  AiTokenTrackerIngestionClient,\n  AiTokenTrackerSdkClient,\n} from \"@ai-token-tracker/sdk\";\n\nconst ingestionClient = new AiTokenTrackerIngestionClient({\n  authToken: process.env.AI_TOKEN_TRACKER_API_KEY ?? \"\",\n});\n\nconst tracker = new AiTokenTrackerSdkClient(ingestionClient);\n\nconst scope = tracker.beginLlmCall(\n  {\n    model: \"gpt-4.1-mini\",\n    input: \"hello\",\n  },\n  {\n    additionalCustomFilters: {\n      Workflow: \"Example\",\n    },\n  },\n  \"openai\",\n);\n\ntry {\n  const providerResponse = {\n    id: \"resp_123\",\n    usage: {\n      input_tokens: 42,\n      output_tokens: 11,\n    },\n  };\n\n  void scope.complete(providerResponse, { statusCode: 200 });\n} catch (error) {\n  void scope.fail(error, { statusCode: 500 });\n  throw error;\n}\n```\n\n## Explicit Ingest (`track`)\n\n```ts\nimport { AiTokenTrackerIngestionClient } from \"@ai-token-tracker/sdk\";\n\nconst ingestionClient = new AiTokenTrackerIngestionClient({\n  authToken: \"your-subscription-or-api-key\",\n});\n\nawait ingestionClient.track({\n  providerHint: \"anthropic\",\n  method: \"POST\",\n  requestBody: JSON.stringify({ model: \"claude-sonnet-4-6\" }),\n  responseBody: JSON.stringify({ id: \"msg_123\" }),\n  statusCode: 200,\n  requestHeaders: {\n    \"content-type\": [\"application/json\"],\n  },\n  responseHeaders: {\n    \"x-request-id\": [\"request_123\"],\n  },\n  additionalCustomFilters: {\n    Workflow: \"ManualIngest\",\n  },\n});\n```\n\n## Automatic HTTP Interception\n\nUse SDK-managed interception for outbound LLM calls made through global `fetch`:\n\n```ts\nimport { AiTokenTrackerIngestionClient } from \"@ai-token-tracker/sdk\";\n\nconst ingestionClient = new AiTokenTrackerIngestionClient({\n  authToken: process.env.AI_TOKEN_TRACKER_API_KEY ?? \"\",\n  enableAutoInterception: true,\n});\n\n// Any classified LLM fetch call is automatically ingested.\nawait fetch(\"https://api.openai.com/v1/responses\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.OPENAI_API_KEY}` },\n  body: JSON.stringify({ model: \"gpt-4.1-mini\", input: \"hello\" }),\n});\n\n// Optional: call when shutting down app processes that no longer need interception.\ningestionClient.dispose();\n```\n\n### Scoped Custom Filters For Automatic Interception\n\nYou can register interception once, then apply custom filters anywhere through async scope context:\n\n```ts\nimport {\n  AiTokenTrackerIngestionClient,\n  createAiTokenTrackerInterceptionScope,\n  withAiTokenTrackerInterceptionScope,\n} from \"@ai-token-tracker/sdk\";\n\nconst _ = new AiTokenTrackerIngestionClient({\n  authToken: process.env.AI_TOKEN_TRACKER_API_KEY ?? \"\",\n  enableAutoInterception: true,\n});\n\nconst scope = createAiTokenTrackerInterceptionScope({\n  Workflow: \"CheckoutFlow\",\n});\n\nscope.addCustomFilters({ Tenant: \"acme\" });\n\nawait withAiTokenTrackerInterceptionScope(scope, async () => {\n  await fetch(\"https://api.openai.com/v1/responses\", {\n    method: \"POST\",\n    headers: { Authorization: `Bearer ${process.env.OPENAI_API_KEY}` },\n    body: JSON.stringify({ model: \"gpt-4.1-mini\", input: \"hello\" }),\n  });\n});\n```\n\nManual lifecycle option:\n\n```ts\nconst scope = createAiTokenTrackerInterceptionScope({\n  Workflow: \"CheckoutFlow\",\n});\n\nscope.addCustomFilters({ Tenant: \"acme\" });\n\ntry {\n  await fetch(\"https://api.openai.com/v1/responses\", {\n    method: \"POST\",\n    headers: { Authorization: `Bearer ${process.env.OPENAI_API_KEY}` },\n    body: JSON.stringify({ model: \"gpt-4.1-mini\", input: \"hello\" }),\n  });\n} finally {\n  scope.close();\n}\n```\n\n## Error Handling Behavior\n\nLike the .NET SDK, ingest attempts are non-throwing by default:\n\n- transport failures return `success: false`\n- non-2xx responses return `success: false` with `statusCode`\n- optional `logger.warn(...)` hooks can capture warning/error context\n","readmeFilename":"README.md"}