{"_id":"@agentrouter/agentrouter","_rev":"6-780550bd6efe12add9c487e788a163f3","name":"@agentrouter/agentrouter","dist-tags":{"latest":"0.1.12"},"versions":{"0.1.7":{"name":"@agentrouter/agentrouter","version":"0.1.7","keywords":["agentrouter","sdk","typescript","agents"],"_id":"@agentrouter/agentrouter@0.1.7","maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"homepage":"https://docs.agentrouter.to/integrations/sdk","bugs":{"url":"https://github.com/pageonelab/web-agentrouter/issues"},"bin":{"agentrouter":"dist/cli.js"},"dist":{"shasum":"8173f4b598eba24d066320eef166b2c2ed620e07","tarball":"https://registry.npmjs.org/@agentrouter/agentrouter/-/agentrouter-0.1.7.tgz","fileCount":11,"integrity":"sha512-H1VHN+8/kmuA4rYuL+UMIHjujgAE4Bj1InWH64Pdmt6u18E6k8JsXie+ADlDBabs1b5gY/IHFIbpqpFB6V3W4g==","signatures":[{"sig":"MEUCIAg6T+xOdTQbN1Dv9F9KGLEsd3KkUp0BfLsrJb5x5HiAAiEAqdgK40V5/CRC495vI1KTd+pD+GSoSh4O1qdUvOxqXCY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76689},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"019665b79170989af9d824eab79d32136ac8de7e","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"iamleoooo","email":"leo@pageonelab.com"},"repository":{"url":"git+https://github.com/pageonelab/web-agentrouter.git","type":"git","directory":"sdk/agentrouter"},"_npmVersion":"10.8.2","description":"TypeScript SDK for AgentRouter.","directories":{},"sideEffects":false,"_nodeVersion":"20.19.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/agentrouter_0.1.7_1776900180944_0.8285107224925659","host":"s3://npm-registry-packages-npm-production"}},"0.1.8":{"name":"@agentrouter/agentrouter","version":"0.1.8","keywords":["agentrouter","sdk","typescript","agents"],"_id":"@agentrouter/agentrouter@0.1.8","maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"homepage":"https://docs.agentrouter.to/integrations/sdk","bugs":{"url":"https://github.com/pageonelab/web-agentrouter/issues"},"bin":{"agentrouter":"dist/cli.js"},"dist":{"shasum":"a520aef658a36b5fd13f665a62e47572d74ee10c","tarball":"https://registry.npmjs.org/@agentrouter/agentrouter/-/agentrouter-0.1.8.tgz","fileCount":11,"integrity":"sha512-+hmctTGMXugKlk/JcUukQ/lj0tRNeOIzr8EaAEQkIiC6DdkLCLS3mfrtr5kZfffncrFo7Yn4hLsvjFaBeorjZg==","signatures":[{"sig":"MEUCIC+vm9WPDlVWl5fp3/VTxEr1YKkcn/eZyl3bcuOrLw3wAiEAij08lajrsu2IH9Mfrirc/wOiNqqL1M7EhW1tXg9EGPI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76689},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"9ebef251ffed3408c54e25270769aa7ae18caddf","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bf963d49-519c-4a03-ba80-88096c82c41e"}},"repository":{"url":"git+https://github.com/pageonelab/web-agentrouter.git","type":"git","directory":"sdk/agentrouter"},"_npmVersion":"11.11.0","description":"TypeScript SDK for AgentRouter.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/agentrouter_0.1.8_1776900493999_0.21273463762142608","host":"s3://npm-registry-packages-npm-production"}},"0.1.9":{"name":"@agentrouter/agentrouter","version":"0.1.9","keywords":["agentrouter","sdk","typescript","agents"],"_id":"@agentrouter/agentrouter@0.1.9","maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"homepage":"https://www.agentrouter.to/docs/integrations/sdk","bugs":{"url":"https://github.com/pageonelab/web-agentrouter/issues"},"bin":{"agentrouter":"dist/cli.js"},"dist":{"shasum":"a605a5c9d0ab0f4ef4287b030136b2c40de9113f","tarball":"https://registry.npmjs.org/@agentrouter/agentrouter/-/agentrouter-0.1.9.tgz","fileCount":11,"integrity":"sha512-WsN/iUe/xMlqqzCh6M1ly7o8wvodOPMP9caBAPQ+9EykbNsFap1h5dDcqbpiWjbYz6Crh2CZlzdRM0YBnjgNLg==","signatures":[{"sig":"MEUCIEtMruE4QoW9a18SoFcGrO5dDGiABPnBZcU9mWotjRTSAiEAjDkiX23CwzKP3t0+pvEM7Ms60UZF3A0+oCpWZJLfdvk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82019},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"8517b89a70011eb4214d95b9a420493e42ea9a51","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bf963d49-519c-4a03-ba80-88096c82c41e"}},"repository":{"url":"git+https://github.com/pageonelab/web-agentrouter.git","type":"git","directory":"sdk/agentrouter"},"_npmVersion":"11.11.0","description":"TypeScript SDK for AgentRouter.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/agentrouter_0.1.9_1776985269256_0.36555183886136833","host":"s3://npm-registry-packages-npm-production"}},"0.1.10":{"name":"@agentrouter/agentrouter","version":"0.1.10","keywords":["agentrouter","sdk","typescript","agents"],"_id":"@agentrouter/agentrouter@0.1.10","maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"homepage":"https://docs.agentrouter.to/integrations/sdk","bugs":{"url":"https://github.com/pageonelab/web-agentrouter/issues"},"bin":{"agentrouter":"dist/cli.js"},"dist":{"shasum":"b4bd1d476d9a7184852f3e57d6561088ab868d99","tarball":"https://registry.npmjs.org/@agentrouter/agentrouter/-/agentrouter-0.1.10.tgz","fileCount":11,"integrity":"sha512-XODTQ1pysCqt2Y2sBckrIaeCqoza1AmRGgVMXFdmaKsawkjc8PoaOLsO94K9Isa+xmfMb6GnfZW4zHxl3cyyuw==","signatures":[{"sig":"MEUCIAJr1Ums9hVeIfdj6MhBIAioAJeQIFIZnxXzcG+RsixgAiEAjiAilgI3Bn5Tj29vWiaImbdIYtk9tgE8Rif6maZFILU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":91313},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"5a75db46ad1a6da7eef26da6cf60d6d0c208c78a","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bf963d49-519c-4a03-ba80-88096c82c41e"}},"repository":{"url":"git+https://github.com/pageonelab/web-agentrouter.git","type":"git","directory":"sdk/agentrouter"},"_npmVersion":"11.11.0","description":"TypeScript SDK for AgentRouter.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/agentrouter_0.1.10_1777596768745_0.15554948482574216","host":"s3://npm-registry-packages-npm-production"}},"0.1.11":{"name":"@agentrouter/agentrouter","version":"0.1.11","keywords":["agentrouter","sdk","typescript","agents"],"_id":"@agentrouter/agentrouter@0.1.11","maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"homepage":"https://docs.agentrouter.to/integrations/sdk","bugs":{"url":"https://github.com/pageonelab/web-agentrouter/issues"},"bin":{"agentrouter":"dist/cli.js"},"dist":{"shasum":"599497c0188770482f73c0f37454a1b805e76df1","tarball":"https://registry.npmjs.org/@agentrouter/agentrouter/-/agentrouter-0.1.11.tgz","fileCount":11,"integrity":"sha512-3/+RY//oAz0wj5twvYvC3XVFzjG6Kfzpjm1zn2LbBG5XvpqM4HJAxGHDqeudJUkXBourQyZPLO60BUBaVj/05g==","signatures":[{"sig":"MEYCIQDCcWtHTt6y7ZHuxMUiDZnl/5ijdpLx4fxga5kBnFri7QIhAK8z+PfES5E00bg7F4pfiPV77EnC3ajw7OGJwZnZBYdm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":115009},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"fcf7619f5d2f404b5fdabbf6ee9cdfb3273ce879","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bf963d49-519c-4a03-ba80-88096c82c41e"}},"repository":{"url":"git+https://github.com/pageonelab/web-agentrouter.git","type":"git","directory":"sdk/agentrouter"},"_npmVersion":"11.11.0","description":"TypeScript SDK for AgentRouter.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/agentrouter_0.1.11_1778513863623_0.8791231995323987","host":"s3://npm-registry-packages-npm-production"}},"0.1.12":{"name":"@agentrouter/agentrouter","version":"0.1.12","description":"TypeScript SDK for AgentRouter.","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"agentrouter":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"sideEffects":false,"engines":{"node":">=18"},"repository":{"type":"git","url":"git+https://github.com/pageonelab/web-agentrouter.git","directory":"sdk/agentrouter"},"homepage":"https://docs.agentrouter.to/integrations/sdk","bugs":{"url":"https://github.com/pageonelab/web-agentrouter/issues"},"keywords":["agentrouter","sdk","typescript","agents"],"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json"},"gitHead":"d0b1c5e462c793b4c7756818ed4303a598a2b08a","_id":"@agentrouter/agentrouter@0.1.12","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-8uMUdn4DxZzulIPRgkiOtHVogwCSavN13esYCqUHLxPKICMtRweV2d694bKahh2UrtFfmHbZ4R6oyesTZE+jEw==","shasum":"db2b01bfd70b50d2f6fb78f4fcf06f1940489c01","tarball":"https://registry.npmjs.org/@agentrouter/agentrouter/-/agentrouter-0.1.12.tgz","fileCount":11,"unpackedSize":115079,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFrZ4BFAZOQp0K/2qH4/+C/QaE8WwzkyF/YOI5lMQQ2YAiEAhsePiMM3bspUrFrV3dqeKyyAHLoq+EN+XA/516xG7Ts="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bf963d49-519c-4a03-ba80-88096c82c41e"}},"directories":{},"maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agentrouter_0.1.12_1778619295930_0.8781652446869335"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-22T23:23:00.862Z","modified":"2026-05-12T20:54:56.221Z","0.1.7":"2026-04-22T23:23:01.067Z","0.1.8":"2026-04-22T23:28:14.163Z","0.1.9":"2026-04-23T23:01:09.416Z","0.1.10":"2026-05-01T00:52:48.888Z","0.1.11":"2026-05-11T15:37:43.784Z","0.1.12":"2026-05-12T20:54:56.087Z"},"bugs":{"url":"https://github.com/pageonelab/web-agentrouter/issues"},"homepage":"https://docs.agentrouter.to/integrations/sdk","keywords":["agentrouter","sdk","typescript","agents"],"repository":{"type":"git","url":"git+https://github.com/pageonelab/web-agentrouter.git","directory":"sdk/agentrouter"},"description":"TypeScript SDK for AgentRouter.","maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"readme":"# AgentRouter SDK\n\nTypeScript SDK for the AgentRouter.\n\nAgentRouter supports both a structured capability-first flow and an intent-first\nentrypoint. The intent-first path is backed by AgentRouter's hosted intent\nresolver, so the SDK can start from a natural-language prompt, inspect the\nselected route context, and then execute explicitly through one client.\n\n- Package: `@agentrouter/agentrouter`\n- Docs: `https://docs.agentrouter.to/integrations/sdk`\n- Base URL: `https://api.agentrouter.to/api/agentic-api`\n\n## Install\n\n```bash\nnpm install @agentrouter/agentrouter\n```\n\n## Get an API Key\n\nHosted AgentRouter requests require an API key.\n\n1. Open `https://www.agentrouter.to/agentic-api/install`\n2. Sign in and copy your API key\n3. Export it in your shell\n\n```bash\nexport AGENTIC_API_KEY=your_key_here\n```\n\nFor local development against a local AgentRouter server, you can also use\n`userId` instead of an API key.\n\n## Quick Start\n\nIntent-first:\n\n```ts\nimport { AgentRouterClient } from \"@agentrouter/agentrouter\";\n\nconst client = new AgentRouterClient({\n  apiKey: process.env.AGENTIC_API_KEY,\n});\n\nconst recommendation = await client.recommend(\n  \"can you help me buy an email inbox?\",\n);\n\nconst routeContext = await client.catalog.routes.context(recommendation.recommendedRouteKey);\n\nconst result = await client.capabilities.execute({\n  domain: recommendation.resolution.domainKey,\n  capability: recommendation.resolution.capabilityId,\n  routeKey: recommendation.recommendedRouteKey,\n  input: {\n    inbox_name: \"launch-updates\",\n  },\n  allowFallback: true,\n});\n```\n\nIf you want the hosted mapping step directly, call:\n\n```ts\nconst resolution = await client.intent.resolve(\n  \"can you help me buy an email inbox?\",\n);\n```\n\nStructured:\n\n```ts\nimport { AgentRouterClient } from \"@agentrouter/agentrouter\";\n\nconst client = new AgentRouterClient({\n  apiKey: process.env.AGENTIC_API_KEY,\n});\n\nconst domains = await client.catalog.domains.list();\nconst capabilities = await client.catalog.capabilities.list(\"email\");\n\nconst recommendation = await client.capabilities.recommend({\n  domain: \"email\",\n  capability: \"send\",\n  input: {\n    optimizationPreferences: [\"cost\", \"quality\"],\n  },\n});\n\nconst result = await client.capabilities.execute({\n  domain: \"email\",\n  capability: \"send\",\n  input: {\n    to: \"maya@example.com\",\n    subject: \"Hello from AgentRouter\",\n    html: \"<p>Hello</p>\",\n  },\n  provider: recommendation.recommendedProvider,\n  allowFallback: true,\n});\n```\n\n## CLI\n\nThe package also ships a thin CLI wrapper over the same SDK semantics.\n\nCreate an API key at `https://www.agentrouter.to/agentic-api/install` and\nexport it before hosted CLI requests:\n\n```bash\nexport AGENTIC_API_KEY=your_key_here\n```\n\nInstall locally:\n\n```bash\nnpm install @agentrouter/agentrouter\nnpx agentrouter domains list\n```\n\nOr run it without adding the package to your app:\n\n```bash\nnpx -p @agentrouter/agentrouter agentrouter domains list\n```\n\nExamples:\n\n```bash\nagentrouter wallet\nagentrouter capabilities list email\nagentrouter capabilities list models\nagentrouter capabilities list text\nagentrouter capabilities list translation\nagentrouter capabilities list finance\nagentrouter capabilities list tax\nagentrouter capabilities list captcha\nagentrouter capabilities list commerce\nagentrouter capabilities list lottery\nagentrouter capabilities list music\nagentrouter capabilities list property\nagentrouter capabilities list media\nagentrouter capabilities list web\nagentrouter routes context email.send.resend\nagentrouter routes context models.chat.complete.deepseek.mpp\nagentrouter routes context models.chat.complete.groq.mpp\nagentrouter routes context text.analyze.diffbot-nl.mpp\nagentrouter routes context translation.text.rephrase.deepl.mpp\nagentrouter routes context web.extract.diffbot.mpp\nagentrouter routes context web.publication.list.dripstack.mpp\nagentrouter routes context web.publication.post.get.dripstack.mpp\nagentrouter routes context enrichment.people.enrich.diffbot.mpp\nagentrouter routes context finance.equity.quote.alphavantage.mpp\nagentrouter routes context finance.fx.rate.abstract-exchange-rates.mpp\nagentrouter routes context finance.fx.convert.abstract-exchange-rates.mpp\nagentrouter routes context finance.fx.rate.historical.abstract-exchange-rates.mpp\nagentrouter routes context tax.vat.validate.abstract-vat.mpp\nagentrouter routes context tax.vat.calculate.abstract-vat.mpp\nagentrouter routes context tax.vat.categories.list.abstract-vat.mpp\nagentrouter routes context captcha.task.create.twocaptcha.mpp\nagentrouter routes context commerce.product.search.kicksdb.stockx.mpp\nagentrouter routes context lottery.round.active.megapot\nagentrouter routes context music.song.generate.suno.mpp\nagentrouter routes context property.records.search.rentcast.mpp\nagentrouter routes context media.image.generate.fal.mpp\nagentrouter routes context travel.airport.operations.flightapi.mpp\nagentrouter recommend email send --input '{\"optimizationPreferences\":[\"cost\"]}'\nagentrouter recommend text analyze --input '{\"provider\":\"diffbot-nl\",\"fields\":\"entities,sentiment,language\",\"optimizationPreferences\":[\"quality\"]}' --json\nagentrouter execute models chat-complete --input '{\"model\":\"deepseek-v4-flash\",\"messages\":[{\"role\":\"user\",\"content\":\"Say AgentRouter DeepSeek smoke OK.\"}]}' --route-key models.chat.complete.deepseek.mpp --json\nagentrouter execute translation text-rephrase --input '{\"text\":\"Please make this product update friendlier.\",\"targetLanguage\":\"EN-US\",\"tone\":\"prefer_friendly\"}' --route-key translation.text.rephrase.deepl.mpp --json\nagentrouter execute web extract --input '{\"url\":\"https://www.example.com/article\"}' --route-key web.extract.diffbot.mpp --json\nagentrouter execute web publication-list --input '{\"allowFallback\":false}' --route-key web.publication.list.dripstack.mpp --json\nagentrouter execute web publication-posts-list --input '{\"publicationSlug\":\"newsletter.morning-brew.morningbrew.com\",\"allowFallback\":false}' --route-key web.publication.posts.list.dripstack.mpp --json\nagentrouter execute web publication-post-get --input '{\"publicationSlug\":\"newsletter.morning-brew.morningbrew.com\",\"postSlug\":\"cheers-to-beer-20260506\",\"allowFallback\":false}' --route-key web.publication.post.get.dripstack.mpp --json\nagentrouter execute enrichment people-enrich --input '{\"fullName\":\"Sam Altman\",\"companyName\":\"OpenAI\"}' --route-key enrichment.people.enrich.diffbot.mpp --json\nagentrouter recommend finance equity-quote --input '{\"symbol\":\"MSFT\",\"optimizationPreferences\":[\"speed\",\"quality\"]}' --json\nagentrouter recommend finance fx-convert --input '{\"fromCurrency\":\"USD\",\"toCurrency\":\"JPY\",\"amount\":25,\"optimizationPreferences\":[\"cost\"]}' --json\nagentrouter execute email send --input @send-email.json --route-key email.send.resend --allow-fallback\nagentrouter execute finance equity-quote --input '{\"symbol\":\"MSFT\"}' --route-key finance.equity.quote.alphavantage.mpp --json\nagentrouter execute finance fx-convert --input '{\"fromCurrency\":\"USD\",\"toCurrency\":\"JPY\",\"amount\":25}' --route-key finance.fx.convert.abstract-exchange-rates.mpp --json\nagentrouter execute tax vat-validate --input '{\"vatNumber\":\"DE123456789\",\"countryCode\":\"DE\",\"allowFallback\":false}' --route-key tax.vat.validate.abstract-vat.mpp --provider abstract-vat --json\nagentrouter execute tax vat-calculate --input '{\"countryCode\":\"DE\",\"amount\":100,\"calculationType\":\"add\",\"allowFallback\":false}' --route-key tax.vat.calculate.abstract-vat.mpp --provider abstract-vat --json\nagentrouter execute media image-generate --input '{\"prompt\":\"Create a clean launch hero image for an AI developer tool\",\"aspectRatio\":\"16:9\",\"allowFallback\":false}' --route-key media.image.generate.fal.mpp --provider fal --json\nagentrouter execute travel airport-operations --input '{\"iataCode\":\"JFK\",\"mode\":\"departures\",\"limit\":1}' --route-key travel.airport.operations.flightapi.mpp --provider flightapi --json\nagentrouter route enrichment --input '{\"intent\":\"Find the work email for the VP Engineering at Example Corp\"}'\n```\n\nFinance commands require a deployment that actually exposes `GET /domains/finance`. If that domain returns `DOMAIN_NOT_FOUND` or the finance execute endpoints return `404`, the rollout is not live on that environment yet.\n\nTax VAT commands require a deployment that exposes `GET /domains/tax`. The live Abstract VAT routes are `tax.vat.validate.abstract-vat.mpp`, `tax.vat.calculate.abstract-vat.mpp`, and `tax.vat.categories.list.abstract-vat.mpp`.\n\nText analysis is currently recommend/context only. `text.analyze.diffbot-nl.mpp` is mapped through Diffbot NL, but May 5, 2026 direct wrapper checks returned HTTP 429 before payment and no AgentRouter credits were charged, so do not execute it until the catalog reports it executable and paid smoke evidence exists.\n\nMedia image generation and edit are live through fal MPP image routes. media.video.generate.fal.mpp remains gated after upstream paymentauth 524 timeouts reproduced outside AgentRouter, so use recommend/context for video generation until the catalog reports it executable and paid smoke evidence exists.\n\nEnvironment variables:\n\n- `AGENTIC_API_BASE_URL`\n- `AGENTIC_API_KEY`\n- `AGENTIC_API_SESSION_TOKEN`\n- `AGENTIC_API_USER_ID`\n- `AGENTIC_API_TIMEOUT_MS`\n\n## Recommended Flow\n\n1. List domains with `client.catalog.domains.list()`\n2. List capabilities with `client.catalog.capabilities.list(domainKey)`\n3. Inspect routes or contracts for a capability\n4. Ask for a recommendation\n5. Execute explicitly\n\nThis keeps your integration stable even when providers or routes change.\n\n## Catalog Discovery\n\n```ts\nconst domain = await client.catalog.domains.get(\"enrichment\");\n\nconst capability = await client.catalog.capabilities.get(\"email\", \"send\");\n\nconst routes = await client.catalog.capabilities.routes(\"email\", \"send\");\n\nconst contract = await client.catalog.capabilities.contract(\"email\", \"send\");\n\nconst routeContext = await client.catalog.routes.context(\"email.send.resend\");\n```\n\nCapability contracts describe the common input shape for a workflow. Route\ncontexts describe the executable surface for one selected route, including\nroute-specific fields and possible provider/wrapper values. Read each possible\nvalue's label and description to map natural language to the exact value.\n\nWhen you want one concrete route, execute through the capability endpoint and\npass `routeKey`; the SDK sends it in the request body.\n\n```ts\nconst result = await client.capabilities.execute({\n  domain: \"travel\",\n  capability: \"flight-search\",\n  routeKey: \"travel.flight.search.stabletravel.googleflights.agentcash\",\n  input: {\n    departure_id: \"JFK\",\n    arrival_id: \"LAX\",\n    outbound_date: \"2026-05-01\",\n    type: \"2\",\n    travel_class: \"1\",\n    adults: 1,\n  },\n  allowFallback: false,\n});\n```\n\nThe same generic surface also works for physical-mail workflows:\n\n```ts\nconst postcard = await client.capabilities.execute({\n  domain: \"post\",\n  capability: \"postcard-send\",\n  routeKey: \"post.postcard.send.papercut.mpp\",\n  input: {\n    roast: \"Launch follow-up postcard\",\n    github_username: \"codepoet\",\n    type: \"digital\",\n  },\n  allowFallback: false,\n});\n```\n\nIt also works for public-broadcast price checks:\n\n```ts\nconst broadcastQuote = await client.capabilities.execute({\n  domain: \"broadcast\",\n  capability: \"message-quote\",\n  routeKey: \"broadcast.message.quote.billboard.mpp\",\n  input: {},\n  allowFallback: false,\n});\n```\n\nAs of May 1, 2026, `broadcast.message.send.billboard.mpp` is still intentionally gated because one live execute would create a real public post and the latest observed supplier challenge was about `$40.96`.\n\nFor text analysis, use the generic surface for recommendation and route context only until the Diffbot NL route clears its runtime gate:\n\n```ts\nconst textRecommendation = await client.capabilities.recommend({\n  domain: \"text\",\n  capability: \"analyze\",\n  input: {\n    provider: \"diffbot-nl\",\n    fields: \"entities,sentiment,language\",\n    optimizationPreferences: [\"quality\"],\n  },\n});\n\nconst textContext = await client.catalog.routes.context(\n  \"text.analyze.diffbot-nl.mpp\",\n);\n\nconsole.log(textRecommendation.recommendedRouteKey);\nconsole.log(textContext.routeKey);\n```\n\nThe current Diffbot NL route is not a live execute example. It returned HTTP 429 before payment during May 5, 2026 direct wrapper checks, so keep integrations to recommend/context until `canExecuteNow` is true and a paid route smoke succeeds.\n\nIt also works for route-pinned fal image generation through the media domain:\n\n```ts\nconst heroImage = await client.capabilities.execute({\n  domain: \"media\",\n  capability: \"image-generate\",\n  routeKey: \"media.image.generate.fal.mpp\",\n  input: {\n    prompt: \"Create a clean launch hero image for an AI developer tool\",\n    aspectRatio: \"16:9\",\n  },\n  provider: \"fal\",\n  allowFallback: false,\n});\n\nconsole.log(heroImage.primaryImageUrl);\n```\n\nmedia.video.generate.fal.mpp remains gated after upstream paymentauth 524 timeouts reproduced outside AgentRouter, so do not execute video generation until route context reports `canExecuteNow=true` and paid smoke evidence exists.\n\nIt also works for DeepL Write rephrase through the translation domain:\n\n```ts\nconst rewrite = await client.capabilities.execute({\n  domain: \"translation\",\n  capability: \"text-rephrase\",\n  routeKey: \"translation.text.rephrase.deepl.mpp\",\n  input: {\n    text: \"Please make this product update friendlier.\",\n    targetLanguage: \"EN-US\",\n    tone: \"prefer_friendly\",\n  },\n  allowFallback: false,\n});\n\nconsole.log(rewrite.rewrittenText);\n```\n\nFor DeepL rephrase, fetch route context before execution and use the exposed DeepL Write fields: `text`, `targetLanguage`, and optional `tone`.\n\nIt also works for route-pinned airport schedule operations on FlightAPI:\n\n```ts\nconst airportOperations = await client.capabilities.execute({\n  domain: \"travel\",\n  capability: \"airport-operations\",\n  routeKey: \"travel.airport.operations.flightapi.mpp\",\n  input: {\n    iataCode: \"JFK\",\n    mode: \"departures\",\n    limit: 1,\n  },\n  provider: \"flightapi\",\n  allowFallback: false,\n});\n```\n\nFlightAPI airport operations passed a May 8, 2026 production smoke through `travel.airport.operations.flightapi.mpp`. Fetch route context first and pin the route when you need that concrete provider.\n\nIf your deployment exposes the finance domain, it also works for finance market-data routes:\n\n```ts\nconst marketStatus = await client.capabilities.execute({\n  domain: \"finance\",\n  capability: \"market-status\",\n  routeKey: \"finance.market.status.alphavantage.mpp\",\n  input: {},\n  allowFallback: false,\n});\n\nconst quote = await client.capabilities.execute({\n  domain: \"finance\",\n  capability: \"equity-quote\",\n  routeKey: \"finance.equity.quote.alphavantage.mpp\",\n  input: {\n    symbol: \"MSFT\",\n  },\n  allowFallback: false,\n});\n\nconst fxRate = await client.capabilities.execute({\n  domain: \"finance\",\n  capability: \"fx-rate\",\n  routeKey: \"finance.fx.rate.abstract-exchange-rates.mpp\",\n  input: {\n    fromCurrency: \"USD\",\n    toCurrency: \"EUR\",\n  },\n  allowFallback: false,\n});\n\nconst fxConversion = await client.capabilities.execute({\n  domain: \"finance\",\n  capability: \"fx-convert\",\n  routeKey: \"finance.fx.convert.abstract-exchange-rates.mpp\",\n  input: {\n    fromCurrency: \"USD\",\n    toCurrency: \"JPY\",\n    amount: 25,\n  },\n  allowFallback: false,\n});\n\nconst historicalFxRate = await client.capabilities.execute({\n  domain: \"finance\",\n  capability: \"fx-rate-historical\",\n  routeKey: \"finance.fx.rate.historical.abstract-exchange-rates.mpp\",\n  input: {\n    fromCurrency: \"USD\",\n    toCurrency: \"GBP\",\n    date: \"2024-01-01\",\n  },\n  allowFallback: false,\n});\n```\n\nIf your deployment exposes the tax domain, the same generic surface works for VAT validation, calculation, and category-rate lookup:\n\n```ts\nconst vatValidation = await client.capabilities.execute({\n  domain: \"tax\",\n  capability: \"vat-validate\",\n  routeKey: \"tax.vat.validate.abstract-vat.mpp\",\n  input: {\n    vatNumber: \"DE123456789\",\n    countryCode: \"DE\",\n  },\n  allowFallback: false,\n});\n\nconst vatCalculation = await client.capabilities.execute({\n  domain: \"tax\",\n  capability: \"vat-calculate\",\n  routeKey: \"tax.vat.calculate.abstract-vat.mpp\",\n  input: {\n    countryCode: \"DE\",\n    amount: 100,\n    calculationType: \"add\",\n  },\n  allowFallback: false,\n});\n\nconst vatCategories = await client.capabilities.execute({\n  domain: \"tax\",\n  capability: \"vat-categories-list\",\n  routeKey: \"tax.vat.categories.list.abstract-vat.mpp\",\n  input: {\n    countryCode: \"DE\",\n  },\n  allowFallback: false,\n});\n```\n\nIf your deployment exposes the agents domain, the same generic surface also works for hosted-agent discovery and stateless paid execution:\n\n```ts\nconst agentSearch = await client.capabilities.recommend({\n  domain: \"agents\",\n  capability: \"search\",\n  input: {\n    query: \"privy\",\n    optimizationPreferences: [\"quality\"],\n  },\n});\n\nconst agentRun = await client.capabilities.execute({\n  domain: \"agents\",\n  capability: \"run\",\n  routeKey: \"agents.run.autoexchange.mpp\",\n  input: {\n    id: \"ab7527c0-6099-4145-9d8b-47f09dab9390\",\n    prompt: \"Say hello in one short sentence.\",\n    stateless: true,\n  },\n  allowFallback: false,\n});\n```\n\nThe generic surface also works for model inference through the `models` domain. The current live routes cover DeepSeek chat completion, code completion, and model listing, plus Groq chat completion and model listing through `models.chat.complete.groq.mpp` and `models.list.groq.mpp`:\n\n```ts\nconst modelChat = await client.capabilities.execute({\n  domain: \"models\",\n  capability: \"chat-complete\",\n  routeKey: \"models.chat.complete.deepseek.mpp\",\n  input: {\n    model: \"deepseek-v4-flash\",\n    messages: [\n      {\n        role: \"user\",\n        content: \"Say AgentRouter DeepSeek smoke OK.\",\n      },\n    ],\n  },\n  allowFallback: false,\n});\n\nconst modelList = await client.capabilities.execute({\n  domain: \"models\",\n  capability: \"list\",\n  routeKey: \"models.list.deepseek.mpp\",\n  input: {},\n  allowFallback: false,\n});\n\nconsole.log(modelChat.completionText);\nconsole.log(modelList.models);\n```\n\nFetch route context before execution to choose a supported model id. The May 5, 2026 live DeepSeek list route returned `deepseek-v4-flash` and `deepseek-v4-pro`, and the May 10, 2026 Groq chat smoke returned `AgentRouter Groq smoke OK` from `llama-3.1-8b-instant`.\n\n## Domain Helpers\n\nThe generic capability methods are the main contract. The SDK also includes\nhelper namespaces where they improve ergonomics:\n\n- `client.email`\n- `client.enrichment`\n- `client.social`\n- `client.web`\n- `client.post`\n- `client.broadcast`\n\nFinance and hosted agents are currently best accessed through the generic\ncapability methods rather than a dedicated helper namespace:\n\n```ts\nconst fxRate = await client.capabilities.execute({\n  domain: \"finance\",\n  capability: \"fx-rate\",\n  routeKey: \"finance.fx.rate.abstract-exchange-rates.mpp\",\n  input: {\n    fromCurrency: \"USD\",\n    toCurrency: \"EUR\",\n  },\n  allowFallback: false,\n});\n\nconst fxConversion = await client.capabilities.execute({\n  domain: \"finance\",\n  capability: \"fx-convert\",\n  routeKey: \"finance.fx.convert.abstract-exchange-rates.mpp\",\n  input: {\n    fromCurrency: \"USD\",\n    toCurrency: \"JPY\",\n    amount: 25,\n  },\n  allowFallback: false,\n});\n\nconst historicalFxRate = await client.capabilities.execute({\n  domain: \"finance\",\n  capability: \"fx-rate-historical\",\n  routeKey: \"finance.fx.rate.historical.abstract-exchange-rates.mpp\",\n  input: {\n    fromCurrency: \"USD\",\n    toCurrency: \"GBP\",\n    date: \"2024-01-01\",\n  },\n  allowFallback: false,\n});\n\nconst hostedAgent = await client.capabilities.execute({\n  domain: \"agents\",\n  capability: \"run\",\n  routeKey: \"agents.run.autoexchange.mpp\",\n  input: {\n    id: \"ab7527c0-6099-4145-9d8b-47f09dab9390\",\n    prompt: \"Say hello in one short sentence.\",\n    stateless: true,\n  },\n  allowFallback: false,\n});\n```\n\nExample:\n\n```ts\nconst routed = await client.enrichment.route({\n  intent: \"Find the work email for the VP Engineering at Example Corp\",\n  companyName: \"Example Corp\",\n  title: \"VP Engineering\",\n});\n\nconst contact = await client.enrichment.contactEnrich.execute(\n  {\n    linkedinUrl: \"https://www.linkedin.com/in/example\",\n  },\n  {\n    allowFallback: true,\n  },\n);\n\nconst graphPerson = await client.capabilities.execute({\n  domain: \"enrichment\",\n  capability: \"people-enrich\",\n  routeKey: \"enrichment.people.enrich.diffbot.mpp\",\n  input: {\n    fullName: \"Sam Altman\",\n    companyName: \"OpenAI\",\n  },\n  allowFallback: false,\n});\n\nconst graphCompany = await client.capabilities.execute({\n  domain: \"enrichment\",\n  capability: \"company-enrich\",\n  routeKey: \"enrichment.company.enrich.diffbot.mpp\",\n  input: {\n    companyName: \"OpenAI\",\n    domain: \"openai.com\",\n  },\n  allowFallback: false,\n});\n\nconst letterRecommendation = await client.post.letter.send.recommend({\n  to: {\n    name: \"Jianyu Li\",\n    address_line1: \"11030 SE 2nd St\",\n    city: \"Bellevue\",\n    state: \"WA\",\n    zip: \"98004\",\n    country: \"US\",\n  },\n  from: {\n    name: \"AgentRouter\",\n    address_line1: \"2261 Market St\",\n    city: \"San Francisco\",\n    state: \"CA\",\n    zip: \"94114\",\n    country: \"US\",\n  },\n  pdf: {\n    url: \"https://example.com/letter.pdf\",\n  },\n});\n\nconst postcard = await client.post.postcard.send.execute(\n  {\n    roast: \"Launch follow-up postcard\",\n    github_username: \"codepoet\",\n    type: \"digital\",\n  },\n  {\n    routeKey: \"post.postcard.send.papercut.mpp\",\n    allowFallback: false,\n  },\n);\n\nconst broadcastQuote = await client.broadcast.message.quote.execute(\n  {},\n  {\n    routeKey: \"broadcast.message.quote.billboard.mpp\",\n    allowFallback: false,\n  },\n);\n\nconst broadcastSendRecommendation =\n  await client.broadcast.message.send.recommend({\n    text: \"Launch update goes here.\",\n    optimizationPreferences: [\"quality\"],\n  });\n\nconst publications = await client.web.publications.list.execute(\n  {},\n  {\n    routeKey: \"web.publication.list.dripstack.mpp\",\n    allowFallback: false,\n  },\n);\n\nconst publicationPosts = await client.web.publications.posts.list.execute(\n  {\n    publicationSlug: \"newsletter.morning-brew.morningbrew.com\",\n  },\n  {\n    routeKey: \"web.publication.posts.list.dripstack.mpp\",\n    allowFallback: false,\n  },\n);\n\nconst publicationPost = await client.web.publications.post.get.execute(\n  {\n    publicationSlug: \"newsletter.morning-brew.morningbrew.com\",\n    postSlug: \"cheers-to-beer-20260506\",\n  },\n  {\n    routeKey: \"web.publication.post.get.dripstack.mpp\",\n    allowFallback: false,\n  },\n);\n\nconst publicationPostGeneric = await client.capabilities.execute({\n  domain: \"web\",\n  capability: \"publication-post-get\",\n  routeKey: \"web.publication.post.get.dripstack.mpp\",\n  input: {\n    publicationSlug: \"newsletter.morning-brew.morningbrew.com\",\n    postSlug: \"cheers-to-beer-20260506\",\n  },\n  allowFallback: false,\n});\n```\n\nTreat `broadcast.message.send` as a recommend-or-review step until a human explicitly approves the exact public message body and spend.\n\nDripStack publication discovery is exposed through `web.publication.list.dripstack.mpp` and `web.publication.posts.list.dripstack.mpp` as free reads. `web.publication.post.get.dripstack.mpp` retrieves one selected article and is a paid route that starts at 50 credits, so inspect route context and make an explicit article choice before execution.\n\n## Auth\n\nHosted usage:\n\n```ts\nconst client = new AgentRouterClient({\n  apiKey: process.env.AGENTIC_API_KEY,\n  baseUrl: \"https://api.agentrouter.to/api/agentic-api\",\n});\n```\n\nLocal development also supports user-scoped fallback against local AgentRouter\nservers:\n\n```ts\nconst wallet = await client.wallet.get({\n  userId: \"agentrouter-sdk-smoke-user\",\n});\n```\n\n## Security Note\n\nDo not expose `AGENTIC_API_KEY` in browser client code. Use this SDK from\nserver-side environments such as:\n\n- Node.js services\n- Next.js server routes and server actions\n- CLI tools\n- agent runtimes\n\n## API Surface\n\nTop-level modules:\n\n- `client.catalog`\n- `client.capabilities`\n- `client.wallet`\n- `client.usage`\n- `client.auth`\n- `client.raw`\n\n## Notes\n\n- Canonical capability IDs come from the catalog.\n- For email inbox acquisition, the canonical capability ID is `inbox-acquire`.\n- The backend may still accept legacy aliases such as `inbox-buy`, but the SDK\n  normalizes to canonical capability IDs.\n- Recommend, route, and execute responses preserve the raw backend payload on\n  `raw`.\n\n## Resources\n\n- SDK docs: `https://docs.agentrouter.to/integrations/sdk`\n- Install flow: `https://www.agentrouter.to/agentic-api/install`\n- skill.md: `https://www.agentrouter.to/SKILL.md`\n","readmeFilename":"README.md"}