{"_id":"@agentic-no/sdk","name":"@agentic-no/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@agentic-no/sdk","version":"0.1.0","description":"Pay-per-call inference from agentic.no with your app's own wallet (x402, USDC on Base).","license":"MIT","type":"module","engines":{"node":">=20"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"bin":{"agentic-sdk":"dist/cli.js"},"scripts":{"build":"tsc -p tsconfig.json && chmod +x dist/cli.js","typecheck":"tsc -p tsconfig.test.json --noEmit","test":"vitest run","prepublishOnly":"pnpm typecheck && pnpm test && pnpm build"},"dependencies":{"@x402/core":"^2.25.0","@x402/evm":"^2.25.0","@x402/fetch":"^2.25.0","viem":"^2.21.0"},"devDependencies":{"@types/node":"^20.0.0","tsx":"^4.19.0","typescript":"^5.7.0","vitest":"^3.0.5"},"_id":"@agentic-no/sdk@0.1.0","gitHead":"41667df72c6ab09aad8d6a14e5ff168fb023ace7","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-IrYjF+bDOZhT0xYg/8JwRp5NzoSKkiyDbA+wZ7yu/WoGiyJ3oXLcJJhh0z0CxtAVXgGM754QBRYo2qcvuqhvUQ==","shasum":"6eed006b933ab24953ce234d1a1e5df12ccf1fa6","tarball":"https://registry.npmjs.org/@agentic-no/sdk/-/sdk-0.1.0.tgz","fileCount":32,"unpackedSize":73004,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGbf54o4Ml4fuVZAgshilsLwfixykTNnF31QURJpVrl8AiEAg6eY7cRTpopvSzd4AKFO+v8scv8ZvC5RkARbqWWDAuA="}]},"_npmUser":{"name":"trygverefvem","email":"trygve@adfunc.com"},"directories":{},"maintainers":[{"name":"trygverefvem","email":"trygve@adfunc.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1788820346408_0.3801194277098141"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-07T22:32:26.200Z","0.1.0":"2026-09-07T22:32:26.568Z","modified":"2026-09-07T22:32:26.804Z"},"maintainers":[{"name":"trygverefvem","email":"trygve@adfunc.com"}],"description":"Pay-per-call inference from agentic.no with your app's own wallet (x402, USDC on Base).","license":"MIT","readme":"# @agentic-no/sdk\n\nPay-per-call inference from [agentic.no](https://agentic.no) with your app's own wallet. No account, no API key on\nour side: your app holds a wallet, each call is paid in USDC on Base with x402, 98 % goes to the seller and 2 % to\nagentic.no. Server-side only (Node 20+, edge runtimes with Node compatibility).\n\n## 1. Create the app wallet\n\n```bash\nnpx @agentic-no/sdk init\n```\n\nWrites `AGENTIC_KEY` to `.env` (mode 600, added to `.gitignore`) and prints the deposit address. Send USDC to it\n(Base Sepolia while testing: https://faucet.circle.com; Base mainnet: any wallet). No ETH is needed. Check with\n`npx @agentic-no/sdk balance`.\n\n## 2. Call a model\n\n```ts\nimport { Agentic } from \"@agentic-no/sdk\";\n\nconst agentic = new Agentic(); // reads AGENTIC_KEY from the environment\nconst r = await agentic.chat({\n  model: \"qwen2.5-3b-instruct-q4\",\n  messages: [{ role: \"user\", content: \"Summarise this in one line: ...\" }],\n});\nconsole.log(r.choices[0].message.content);\nconsole.log(r.agentic); // { seller, model, priceUsd, tx, network, latencyMs }\n```\n\nAlso `agentic.embed({ model, input })`, `agentic.transcribe({ model, file, filename })` and `agentic.providers(model)`.\nResponses are OpenAI-compatible plus an `agentic` field with what was paid and to whom.\n\nPer call options: `{ maxUsd, seller, timeoutMs }`. The default price cap is $0.05 per call (`AGENTIC_MAX_USD`).\n\n## Which models?\n\n```bash\nnpx @agentic-no/sdk providers qwen2.5-3b-instruct-q4\n```\nor `GET https://agentic.no/api/providers`. The SDK picks the cheapest online seller, ties broken by probe score.\n\n## Environment\n\n| Variable | Default | Meaning |\n|---|---|---|\n| `AGENTIC_KEY` | required | 0x private key of the app wallet (or `AGENTIC_KEY_FILE`) |\n| `AGENTIC_NETWORK` | `eip155:84532` (Base Sepolia) | `eip155:8453` for Base mainnet |\n| `AGENTIC_DIRECTORY` | `https://agentic.no` | directory to discover sellers from |\n| `AGENTIC_MAX_USD` | `0.05` | refuse any single call quoted above this |\n\n## Errors\n\n`NoProviderError` (no online seller; lists models that are online), `PriceCapError` (nothing paid), `PaymentError`\n(signing or settlement failed; check the balance), `SellerError` (the seller answered non-2xx; the relay only settles\non a successful reply, so you were not charged and `.tx` is normally undefined; it is set only in the rare case a\nsettlement header came back with the error), `ConfigError` (environment; message tells you to run `init`).\n\n## Money\n\nThe key never leaves your process; the SDK only talks to the directory and the seller it picked. One in-flight\npayment per call. If the seller is offline before anything is paid, the SDK fails over once to the next seller; a\nnon-2xx answer after the payment step is not retried and is not settled, so a failed call costs nothing. Fund the\nwallet like any other budget.\n","readmeFilename":"README.md","_rev":"1-582dcd9562948b3ef3bc7f9078ad0154"}