{"_id":"@aispace.bot/x402","_rev":"6-589199e3060c22268f7e2e51b55407e7","name":"@aispace.bot/x402","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@aispace.bot/x402","version":"0.1.0","keywords":["aispace","x402","mcp","venice","agent","usdc","base","cli"],"license":"MIT","_id":"@aispace.bot/x402@0.1.0","maintainers":[{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"}],"homepage":"https://docs.aispace.bot/agent-api/sdk","bugs":{"url":"https://github.com/Juddlyfire01/aiSpace/issues"},"bin":{"aispace-x402":"bin.mjs"},"dist":{"shasum":"7655c0ff3652982a2115e0705d9fd1370a3c445a","tarball":"https://registry.npmjs.org/@aispace.bot/x402/-/x402-0.1.0.tgz","fileCount":7,"integrity":"sha512-aEWrKP4sg7t7WyQROokM1605l6t3TLwlxOZx8rpiNfjc1ruwU4I8LHgEnSqzokjg94DYPqbK8CMJQJdnlLxZwg==","signatures":[{"sig":"MEYCIQDxcUOxkgkQnTPmt5iuSVHI+YWDeuzmMzn9XYSvgtMHuwIhAPyYgDY9MROF2Dbzb8uP1EzmsjgYq3Atbj2GOsvXjePA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19778},"type":"module","engines":{"node":">=20"},"exports":{".":"./core.mjs"},"gitHead":"66c94301362df59c6e4e58c17bc318c57e0ba43d","private":false,"_npmUser":{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"},"overrides":{"axios":">=1.18.0"},"repository":{"url":"git+https://github.com/Juddlyfire01/aiSpace.git","type":"git","directory":"packages/aispace-x402"},"_npmVersion":"11.6.1","description":"AiSpace x402 marketplace agent client — CLI (default) + MCP over USDC on Base. Built in Venice.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"zod":"^3.23.8","viem":"^2.55.5","x402":"^1.2.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/x402_0.1.0_1785760475478_0.4409638993668372","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aispace.bot/x402","version":"0.1.1","keywords":["aispace","x402","mcp","venice","agent","usdc","base","cli"],"license":"MIT","_id":"@aispace.bot/x402@0.1.1","maintainers":[{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"}],"homepage":"https://docs.aispace.bot/agent-api/sdk","bugs":{"url":"https://github.com/Juddlyfire01/aiSpace/issues"},"bin":{"aispace-x402":"bin.mjs"},"dist":{"shasum":"97c4dfe421a7bf1ecaf42137cca07c6514634d78","tarball":"https://registry.npmjs.org/@aispace.bot/x402/-/x402-0.1.1.tgz","fileCount":7,"integrity":"sha512-ZPvT2Jd/5kgrS20CEWiiv0lV4V2AojxzCA+jdsRE8kPgXhSlx2lB/D6+rSZ7Fv9rEslbLH+wkECy14/GEzGRRA==","signatures":[{"sig":"MEQCIA9dtBNzHRK2N/6MFfB7yqzW5+v6JMGtnrcebgIpIjvNAiArpSOcpTZDwEAcJySaM20emx2g2agKb9WlrR1N8+bpcg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19778},"type":"module","engines":{"node":">=20"},"exports":{".":"./core.mjs"},"gitHead":"66c94301362df59c6e4e58c17bc318c57e0ba43d","private":false,"_npmUser":{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"},"overrides":{"axios":">=1.18.0"},"repository":{"url":"git+https://github.com/Juddlyfire01/aiSpace.git","type":"git","directory":"packages/aispace-x402"},"_npmVersion":"11.6.1","description":"AiSpace x402 marketplace agent client — CLI (default) + MCP over USDC on Base. Built in Venice.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"zod":"^3.23.8","viem":"^2.55.5","x402":"^1.2.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/x402_0.1.1_1785760761787_0.0747256746690137","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aispace.bot/x402","version":"0.1.2","keywords":["aispace","x402","mcp","venice","agent","usdc","base","cli"],"license":"MIT","_id":"@aispace.bot/x402@0.1.2","maintainers":[{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"}],"homepage":"https://docs.aispace.bot/agent-api/sdk","bugs":{"url":"https://github.com/Juddlyfire01/aiSpace/issues"},"bin":{"aispace-x402":"bin.js"},"dist":{"shasum":"d335c47b502e1d3fe63a7974cc1ebb6e40306809","tarball":"https://registry.npmjs.org/@aispace.bot/x402/-/x402-0.1.2.tgz","fileCount":8,"integrity":"sha512-bupPUBoEQXr8Pvi8CB5ENihMcYI1JjwuQDnegJ81sL1cagTAxivqTG1WqUOs75VQavQxcanKTVW9TLl5nFhlYw==","signatures":[{"sig":"MEUCIQDUF/4kPABeAFI7kAJrKL0dbacrqb6poc0/53XWfiUVRQIgZftjiTubGJ8VBvllBiG35oOfje59TVuDgHqXvBpwvPk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20005},"type":"module","engines":{"node":">=20"},"exports":{".":"./core.mjs"},"gitHead":"66c94301362df59c6e4e58c17bc318c57e0ba43d","private":false,"_npmUser":{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"},"overrides":{"axios":">=1.18.0"},"repository":{"url":"git+https://github.com/Juddlyfire01/aiSpace.git","type":"git","directory":"packages/aispace-x402"},"_npmVersion":"11.6.1","description":"AiSpace x402 marketplace agent client — CLI (default) + MCP over USDC on Base. Built in Venice.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"zod":"^3.23.8","viem":"^2.55.5","x402":"^1.2.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/x402_0.1.2_1785761454004_0.1781635595525104","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@aispace.bot/x402","version":"0.1.3","keywords":["aispace","x402","mcp","venice","agent","usdc","base","cli"],"license":"MIT","_id":"@aispace.bot/x402@0.1.3","maintainers":[{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"}],"homepage":"https://docs.aispace.bot/agent-api/sdk","bugs":{"url":"https://github.com/Juddlyfire01/aiSpace/issues"},"bin":{"aispace-x402":"bin.js"},"dist":{"shasum":"b53ceffee7f2f13e643507a5c8cfce2b4ec33d37","tarball":"https://registry.npmjs.org/@aispace.bot/x402/-/x402-0.1.3.tgz","fileCount":9,"integrity":"sha512-7KPUuz1XXBmyAy6FkQAtbSskGhxS+N7gdZUyKvgL379rkjR4o4f3rwyFwj9ys75AJhUz4bIGqtJ8PWQ3vDkJ+w==","signatures":[{"sig":"MEUCIELxzeBa/IORS5KyTRijCtV1NeTunBcpQgH1uca5mu9fAiEAyxyiUkbPb6pqqN9cqi3gvvuXYp88Vl40cYcKkoiHXdk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28328},"type":"module","engines":{"node":">=20"},"exports":{".":"./core.mjs","./async":"./async.mjs"},"gitHead":"6a50ed1ee321f613b83a10b82d945cfa1039ca33","private":false,"_npmUser":{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"},"overrides":{"axios":">=1.18.0"},"repository":{"url":"git+https://github.com/Juddlyfire01/aiSpace.git","type":"git","directory":"packages/aispace-x402"},"_npmVersion":"11.6.1","description":"AiSpace x402 marketplace agent client — CLI (default) + MCP over USDC on Base. Built in Venice.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"zod":"^3.23.8","viem":"^2.55.5","x402":"^1.2.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/x402_0.1.3_1785842317806_0.2992987742298976","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@aispace.bot/x402","version":"0.1.4","keywords":["aispace","x402","mcp","venice","agent","usdc","base","cli"],"license":"MIT","_id":"@aispace.bot/x402@0.1.4","maintainers":[{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"}],"homepage":"https://docs.aispace.bot/agent-api/sdk","bugs":{"url":"https://github.com/Juddlyfire01/aiSpace/issues"},"bin":{"aispace-x402":"bin.js"},"dist":{"shasum":"93782e9225aee01b02fffd4eac70fdeb48be3236","tarball":"https://registry.npmjs.org/@aispace.bot/x402/-/x402-0.1.4.tgz","fileCount":9,"integrity":"sha512-QHus2GILJLERu7dx8XcviF6jWYMK3kGibbSBClC+7Kog4oV73nVDCaOtcS3IFLa0Q8406HJx5rCYfkCE6A1etA==","signatures":[{"sig":"MEUCIQDYtuuep0IMnCvn1U6ZpkhqI9F2gU4D36QfPX7r7AoaAAIgLtb2MU9F8hurg2avHB4VNeT978IxhEasAz813fs20Zo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30245},"type":"module","engines":{"node":">=20"},"exports":{".":"./core.mjs","./async":"./async.mjs"},"gitHead":"638bddc2023df0e4444f0d0a1f7a8bb439aab4a0","private":false,"_npmUser":{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"},"overrides":{"axios":">=1.18.0"},"repository":{"url":"git+https://github.com/Juddlyfire01/aiSpace.git","type":"git","directory":"packages/aispace-x402"},"_npmVersion":"11.6.1","description":"AiSpace x402 marketplace agent client — CLI (default) + MCP over USDC on Base. Built in Venice.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"zod":"^3.23.8","viem":"^2.55.5","x402":"^1.2.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/x402_0.1.4_1785844914442_0.27886880978515527","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aispace.bot/x402","version":"0.2.0","description":"AiSpace x402 marketplace agent client (v2) — CLI (default) + MCP over USDC on Base. Built in Venice.","keywords":["aispace","x402","mcp","venice","agent","usdc","base","cli"],"homepage":"https://docs.aispace.bot/agent-api/sdk","repository":{"type":"git","url":"git+https://github.com/Juddlyfire01/aiSpace.git","directory":"packages/aispace-x402"},"type":"module","publishConfig":{"access":"public"},"bin":{"aispace-x402":"bin.js"},"exports":{".":"./core.mjs","./async":"./async.mjs"},"engines":{"node":">=20"},"dependencies":{"@modelcontextprotocol/sdk":"^1.12.0","@x402/core":"2.20.0","@x402/evm":"2.20.0","viem":"^2.55.5","zod":"^3.23.8"},"overrides":{"axios":">=1.18.0"},"license":"MIT","private":false,"gitHead":"aeb60cc2c1b364186a6be1f98787b871ae74e159","_id":"@aispace.bot/x402@0.2.0","bugs":{"url":"https://github.com/Juddlyfire01/aiSpace/issues"},"_nodeVersion":"22.14.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-qdTstBm5EJnpWeyx/SwsHaMx0F3xU8H5OYtfgzJMABucyyN/lHlNyZoePbHJG+1dJAyQ8fdC63avuMafuSQZJg==","shasum":"de345ab6832172d7d652729f48a0963063fa280f","tarball":"https://registry.npmjs.org/@aispace.bot/x402/-/x402-0.2.0.tgz","fileCount":9,"unpackedSize":31354,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC3gcnGev3c6dQq0ZqZkqZDWaCXjt08tEzUVqWMcxvfKAiEAt7np/+tuLIIfeP6m4l/h9vC2/DI+5k4PD41dzMpS6yw="}]},"_npmUser":{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"},"directories":{},"maintainers":[{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x402_0.2.0_1785853162286_0.6668338190325647"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-03T12:34:35.339Z","modified":"2026-08-04T14:19:22.613Z","0.1.0":"2026-08-03T12:34:35.638Z","0.1.1":"2026-08-03T12:39:21.932Z","0.1.2":"2026-08-03T12:50:54.150Z","0.1.3":"2026-08-04T11:18:38.005Z","0.1.4":"2026-08-04T12:01:54.580Z","0.2.0":"2026-08-04T14:19:22.410Z"},"bugs":{"url":"https://github.com/Juddlyfire01/aiSpace/issues"},"license":"MIT","homepage":"https://docs.aispace.bot/agent-api/sdk","keywords":["aispace","x402","mcp","venice","agent","usdc","base","cli"],"repository":{"type":"git","url":"git+https://github.com/Juddlyfire01/aiSpace.git","directory":"packages/aispace-x402"},"description":"AiSpace x402 marketplace agent client (v2) — CLI (default) + MCP over USDC on Base. Built in Venice.","maintainers":[{"name":"juddly01","email":"juddlyfire@hotmail.co.uk"}],"readme":"# @aispace.bot/x402\r\n\r\nAgent client for the [AiSpace x402 marketplace](https://x402.aispace.bot) — **built in Venice**. One package: **CLI (default)** + **MCP** + programmable core. Handles the full x402 payment loop (USDC on Base) so agents never hand-roll EIP-3009.\r\n\r\n## Three routes (in order)\r\n\r\n| Route | When |\r\n| --- | --- |\r\n| **1. CLI (`npx`)** — path of least resistance | Scripts, cron, any agent that can shell out |\r\n| **2. MCP** — complementary | Cursor, Claude Desktop, persistent hosts |\r\n| **3. Raw HTTP** — fallback | No Node; see [docs](https://docs.aispace.bot/agent-api/quickstart) |\r\n\r\n## CLI\r\n\r\n```bash\r\n# free\r\nnpx @aispace.bot/x402 models --type text\r\nnpx @aispace.bot/x402 openapi\r\nnpx @aispace.bot/x402 quote --kind video --body '{\"model\":\"wan-2-7-text-to-video\",\"duration\":\"5s\",\"aspect_ratio\":\"16:9\",\"resolution\":\"720p\"}'\r\n\r\n# paid (USDC on Base)\r\nexport AISPACE_X402_KEY=0x<base-wallet-private-key>\r\n# Use exact catalog ids from GET /api/v1/models or /models/traits (e.g. most_uncensored)\r\nnpx @aispace.bot/x402 chat --model venice-uncensored-1-2 --message \"hi\" --max-tokens 256\r\nnpx @aispace.bot/x402 call --path api/v1/image/generate --body '{\"model\":\"...\",\"prompt\":\"...\"}'\r\n```\r\n\r\n## Programmatic (core)\r\n\r\n```js\r\nimport { request, call } from '@aispace.bot/x402'\r\nimport { waitForAsyncJob, generateAsync } from '@aispace.bot/x402/async'\r\nimport { writeFileSync } from 'node:fs'\r\n\r\n// Binary routes (edit / speech / retrieve) expose `buffer` + `contentType`\r\nconst img = await call({\r\n  path: 'api/v1/image/background-remove',\r\n  body: { image: '<base64>' },\r\n})\r\nif (img.buffer) writeFileSync('out.png', img.buffer)\r\n\r\n// Async: queue is paid; retrieve/complete are free\r\nconst job = await generateAsync({\r\n  kind: 'video',\r\n  body: {\r\n    model: 'wan-2-7-text-to-video',\r\n    prompt: 'calm ocean wave',\r\n    duration: '5s',\r\n    aspect_ratio: '16:9',\r\n    resolution: '720p',\r\n  },\r\n})\r\nwriteFileSync('clip.mp4', job.buffer)\r\n// complete is best-effort; already-cleaned → { success: true, alreadyCompleted: true }\r\n```\r\n\r\n**Binary vs JSON:** many image edit/upscale/bg-remove, TTS, and async retrieve responses are raw `image/*` / `audio/*` / `video/*`. Prefer `result.buffer`. Do not assume JSON.\r\n\r\n**Async waiting:** `waitForAsyncJob` does not kill late jobs with a guessed max duration. It aborts hung HTTP fetches, fails only if `PROCESSING` stalls (`execution_duration` stops advancing ~3 min), and uses a high absolute ceiling (music 15m / video 30m) as a safety net only.\r\n\r\n## MCP\r\n\r\n```json\r\n{\r\n  \"mcpServers\": {\r\n    \"aispace-x402\": {\r\n      \"command\": \"npx\",\r\n      \"args\": [\"-y\", \"@aispace.bot/x402\", \"mcp\"],\r\n      \"env\": { \"AISPACE_X402_KEY\": \"0x…\" }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nTools: `aispace_models`, `aispace_openapi`, `aispace_quote`, `aispace_chat`, `aispace_call`.\r\n\r\n## Env\r\n\r\n| Var | Required for | Description |\r\n| --- | --- | --- |\r\n| `AISPACE_X402_KEY` | paid commands / tools | Base wallet private key with USDC. Env only — never a flag. |\r\n| `AISPACE_X402_BASE` | optional | Default `https://x402.aispace.bot` |\r\n\r\n## Docs\r\n\r\nhttps://docs.aispace.bot/agent-api/sdk\r\n","readmeFilename":"README.md"}