ai icon indicating copy to clipboard operation
ai copied to clipboard

Community provider: pay-per-call tools from an x402 marketplace (spend-guarded)

Open anatshad opened this issue 2 months ago • 30 comments

Description

Hey there! I maintain Fatstack (fatstack.net), a non-custodial marketplace where AI agents discover MCP/API tools and pay per call in USDC on Base via the x402 protocol.

I've built and published a tool provider for the AI SDK: @fatstack/ai-sdk-tools (npm). One import points an agent at our machine-readable registry and returns callable tools; payments run through a paying fetch with required spend guards - the constructor refuses to build without a daily cap, so there is no unguarded default. Runnable example against Base Sepolia included.

Before opening a PR, I wanted to ask how you'd prefer this to land: as an entry in the community providers registry/docs pointing at the published package, or is there a different home for third-party tool providers now? Happy to follow whatever structure you prefer - the package already mirrors the conventions from recently merged community providers.

Context on the marketplace side, in case it matters for review: catalog metrics are derived from confirmed on-chain payments (never self-reported), and the payment path is audited against published x402 attack classes - the write-up is public.

Reproduction

No response

AI SDK Version

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

anatshad avatar Sep 08 '26 13:09 anatshad

Identify issue type

Identified as Documentation
Confidence: Medium

Rationale

The request is primarily about documenting and listing an existing community provider, although it also seeks guidance on the appropriate location.

Evidence

  • The author asks whether the published third-party tool package should be added to the community providers registry/docs.
  • No broken SDK behavior or required product behavior change is described.
  • The proposed outcome is a documentation/registry entry pointing to an existing package.

ai-sdk-factory[bot] avatar Sep 08 '26 13:09 ai-sdk-factory[bot]

Identify documentation type

  • Identified as Needs Maintainer
  • Confidence: High

Rationale

The package already exists, but the requested documentation scope is unclear. The issue asks mainly for guidance on a registry entry linking to the package, which may be only a bare catalog mention rather than usable new integration documentation.

Evidence

  • The author has published the external integration as @fatstack/ai-sdk-tools, so runtime implementation does not appear to be missing.
  • The requested outcome is phrased as an entry in the community providers registry/docs pointing to the package.
  • The issue does not clearly propose installation, configuration, or usage documentation, although it mentions that a runnable example exists.
  • The author explicitly asks maintainers to decide the appropriate documentation location and structure.

Maintainer action required

Apply exactly one of documentation-fix or documentation-addition.

ai-sdk-factory[bot] avatar Sep 08 '26 13:09 ai-sdk-factory[bot]

Happy to make this zero-work for whoever picks it up: I've prepared the full docs entry - installation, configuration (including the required spend-guard setup), a usage example, and the registry line - following the structure of the existing community provider pages. I can open the PR against the docs as soon as someone confirms documentation-addition is the right label, or just open it now if that's easier to review. Whichever you prefer.

anatshad avatar Sep 08 '26 14:09 anatshad

Tested the marketplace end-to-end today (we run an x402 storefront on Base ourselves and wanted to list) and hit a hard blocker at sign-in worth flagging before this lands in the docs:

/api/auth/verify returns HTTP 500 for smart-contract wallets (ERC-1271 signatures). Repro (2026-09-08 ~16:40Z):

  1. GET /api/auth/nonce → 200, nonce OK
  2. POST /api/auth/message {address, nonce} → 200, well-formed SIWE message (Chain ID 8453)
  3. personal_sign that message with a smart wallet (ours is a Crossmint smart wallet on Base) → the signature is a valid ERC-1271 contract signature
  4. POST /api/auth/verify {message, signature, nonce} → HTTP 500, empty body — for a garbage 0x + ab×65 signature too, so the endpoint appears to crash on any signature it can't ecrecover instead of returning a 4xx.

Why it matters for this exact audience: smart wallets are the default wallet class for x402 agents on Base (CDP smart wallets, Crossmint, etc.). If providers can't sign in with one, the marketplace only accepts EOAs — which cuts against the "AI agents discover and pay per call" positioning. If the fix is isValidSignature (ERC-1271) fallback after ecrecover fails, the SIWE libs (siwe npm / siwe Rust) both support it via verify({ siwe })… actually the short version: fall back to ERC-1271 validation and return 400-with-reason on verification failure instead of a bare 500.

Happy to re-test the moment it's patched — we'd genuinely like to list our tool there (Solana Anchor static-analysis scan, live at audit.askzephy.com, USDC-on-Base via x402 since August). That's the use case working end-to-end for a provider with a smart wallet.

halobartku avatar Sep 08 '26 16:09 halobartku

Tested the marketplace end-to-end today (we run an x402 storefront on Base ourselves and wanted to list) and hit a hard blocker at sign-in worth flagging before this lands in the docs:

/api/auth/verify returns HTTP 500 for smart-contract wallets (ERC-1271 signatures). Repro (2026-09-08 ~16:40Z):

  1. GET /api/auth/nonce → 200, nonce OK
  2. POST /api/auth/message {address, nonce} → 200, well-formed SIWE message (Chain ID 8453)
  3. personal_sign that message with a smart wallet (ours is a Crossmint smart wallet on Base) → the signature is a valid ERC-1271 contract signature
  4. POST /api/auth/verify {message, signature, nonce} → HTTP 500, empty body — for a garbage 0x + ab×65 signature too, so the endpoint appears to crash on any signature it can't ecrecover instead of returning a 4xx.

Why it matters for this exact audience: smart wallets are the default wallet class for x402 agents on Base (CDP smart wallets, Crossmint, etc.). If providers can't sign in with one, the marketplace only accepts EOAs — which cuts against the "AI agents discover and pay per call" positioning. If the fix is isValidSignature (ERC-1271) fallback after ecrecover fails, the SIWE libs (siwe npm / siwe Rust) both support it via verify({ siwe })… actually the short version: fall back to ERC-1271 validation and return 400-with-reason on verification failure instead of a bare 500.

Happy to re-test the moment it's patched — we'd genuinely like to list our tool there (Solana Anchor static-analysis scan, live at audit.askzephy.com, USDC-on-Base via x402 since August). That's the use case working end-to-end for a provider with a smart wallet.

Thank you - this was exactly right, and now it's fixed and deployed. Verification goes through a public client: ecrecover → ERC-1271 isValidSignature → ERC-6492 for not-yet-deployed smart accounts. And no more bare 500s: every rejection is a 400 with a reason code (invalid_signature, nonce_mismatch, …)

I'll be glad if you find time to re-test and give your feedback!

anatshad avatar Sep 08 '26 18:09 anatshad

Documentation addition assessment

  • Subject: Fatstack (@fatstack/ai-sdk-tools)
  • External AI SDK evidence: inconclusive
  • Maintainer approval: not yet approved
  • Assessed: 2026-09-08T19:15:28.340Z

Fatstack's public pages document @fatstack/x402 and payFetch, but provide no concrete instructions for using @fatstack/ai-sdk-tools with the Vercel AI SDK. The claimed npm package returned HTTP 403 during inspection, and no public canonical repository was found, so its README, runnable example, and compatibility with the current AI SDK could not be verified.

Evidence

  • Fatstack — pay-per-call tools for AI agents — Documents @fatstack/x402 payFetch with spend guards, but does not mention @fatstack/ai-sdk-tools or show Vercel AI SDK usage.
  • How payment works · Fatstack — Explains x402 payments and spending limits but contains no Vercel AI SDK installation, configuration, or code.
  • Consumer console · Fatstack — Generates @fatstack/x402 payFetch configuration, not tools usable through the Vercel AI SDK.
  • Provider dashboard · Fatstack — Provides wallet sign-in for marketplace providers but no AI SDK integration instructions.
  • List a tool · Fatstack — Provides marketplace listing access but no AI SDK integration documentation.
  • @fatstack/ai-sdk-tools · npm — The package page returned HTTP 403 during inspection, preventing verification of its README, example, package version, and current AI SDK compatibility.
  • anatshad · GitHub — The issue author's public profile has no public repositories, so no canonical provider-controlled README or example could be verified there.

Next step

The issue author can add or correct provider-controlled AI SDK documentation links in a new comment. Factory will reassess author comments; a maintainer may explicitly override this evidence requirement by applying the approval label.

ai-sdk-factory[bot] avatar Sep 08 '26 19:09 ai-sdk-factory[bot]

Documentation addition assessment

  • Subject: Fatstack (@fatstack/ai-sdk-tools)
  • External AI SDK evidence: inconclusive
  • Maintainer approval: not yet approved
  • Assessed: 2026-09-08T19:17:05.418Z

Fatstack's accessible pages document @fatstack/x402 and spend-guarded payFetch usage, but none provide concrete instructions for using @fatstack/ai-sdk-tools with the current Vercel AI SDK. The claimed npm package consistently returned HTTP 403, and the author's GitHub profile exposes no canonical repository, so the package README, runnable example, authorship, and current-version compatibility could not be verified.

Evidence

  • Fatstack — pay-per-call tools for AI agents — Shows spend-guarded @fatstack/x402 payFetch code, but no @fatstack/ai-sdk-tools installation or Vercel AI SDK usage.
  • How payment works · Fatstack — Documents x402 payment flow and spending limits, but contains no Vercel AI SDK integration instructions.
  • Consumer console · Fatstack — Generates @fatstack/x402 payFetch configuration rather than tools configured for the Vercel AI SDK.
  • Provider dashboard · Fatstack — Provides marketplace wallet sign-in but no publicly readable AI SDK integration guide.
  • List a tool · Fatstack — Provides marketplace listing access but no publicly readable AI SDK installation, configuration, or usage example.
  • @fatstack/ai-sdk-tools · npm — Returned HTTP 403 during inspection, preventing verification of the package README, examples, version, repository identity, and current AI SDK compatibility.
  • anatshad · GitHub — The issue author's public profile shows no public repositories, so no canonical author-controlled README or runnable example could be inspected.

Next step

The issue author can add or correct provider-controlled AI SDK documentation links in a new comment. Factory will reassess author comments; a maintainer may explicitly override this evidence requirement by applying the approval label.

ai-sdk-factory[bot] avatar Sep 08 '26 19:09 ai-sdk-factory[bot]

Hmm not sure why our clankers got the 403 errors during evaluation.

We are happy to mention your 3rd party integration on our website at https://ai-sdk.dev/resources/tools

We ask for 3 things

  1. The integration is working as advertised
  2. You document on your website how the tool. is working with the AI SDK
  3. You set docsUrl to that documentation

When ready, send a PR to https://github.com/vercel/ai/blob/main/packages/ai/src/registry/index.ts

gr2m avatar Sep 08 '26 19:09 gr2m

Re-tested end-to-end ~1h after your fix (2026-09-08 ~20:30Z): nonce → message → personal_sign with the same Crossmint smart wallet on Base → /api/auth/verify now returns HTTP 200 with the session cookie. ERC-1271 path works exactly as advertised.

Garbage-signature handling also verified: no more bare 500s.

Follow-through: we've submitted our tool for listing (Solana Anchor static-analysis scan, live at https://audit.askzephy.com, USDC-on-Base via x402 since August) — it's sitting in your review queue now. Thanks for the fast turnaround on this.

halobartku avatar Sep 08 '26 20:09 halobartku

Hmm not sure why our clankers got the 403 errors during evaluation.

We are happy to mention your 3rd party integration on our website at https://ai-sdk.dev/resources/tools

We ask for 3 things

  1. The integration is working as advertised
  2. You document on your website how the tool. is working with the AI SDK
  3. You set docsUrl to that documentation

When ready, send a PR to https://github.com/vercel/ai/blob/main/packages/ai/src/registry/index.ts

Thanks @gr2m! Really appreciate your answer!

  1. Working as advertised. @fatstack/ai-sdk-tools is on npm and settles real payments end to end. I verify it against the published package in a clean install rather than the source tree, so what's tested is what someone actually downloads.

  2. Documentation on our site. https://www.fatstack.net/docs/ai-sdk ; install, the spend-guard configuration and why it has no default, and a runnable Base Sepolia example with the faucet flow.

  3. docsUrl set to that page, not a homepage.

PR incoming shortly.

anatshad avatar Sep 08 '26 22:09 anatshad

Documentation addition assessment

  • Subject: Fatstack (@fatstack/ai-sdk-tools)
  • External AI SDK evidence: found
  • Maintainer approval: not yet approved
  • Assessed: 2026-09-08T22:04:37.957Z

Fatstack now provides public, provider-controlled documentation and a canonical repository with concrete installation, spend-guard configuration, and generateText usage. The package manifest declares AI SDK ^7.0.0 compatibility, matching the current AI SDK major, and the implementation returns the SDK's ToolSet type.

Evidence

  • Using Fatstack tools with the AI SDK — Documents npm installation, wallet and required spend-guard configuration, passing the discovered tools to AI SDK generateText, and Base Sepolia test setup.
  • @fatstack/ai-sdk-tools README — Provides package installation and a concrete generateText example using an AI SDK model, plus catalogue filtering, mandatory spending limits, and testnet instructions.
  • Fatstack Agent quickstart — Gives a dedicated Vercel AI SDK workflow that installs the package, constructs paid tools with a wallet and guards, and supplies them to generateText.
  • @fatstack/ai-sdk-tools package manifest — Identifies package version 0.1.1, the canonical repository, and a peer dependency on ai ^7.0.0, establishing compatibility with the current AI SDK major.
  • @fatstack/ai-sdk-tools implementation — Shows the integration importing AI SDK tool and ToolSet, converting marketplace listings into executable SDK tools, and enforcing spend guards before discovery and payment.
  • Fatstack repository README — The canonical provider repository includes an agent quickstart that installs @fatstack/ai-sdk-tools and passes its spend-guarded tool set to AI SDK generateText.

Next step

A maintainer must apply task-documentation-addition-approved before Factory can implement this addition.

ai-sdk-factory[bot] avatar Sep 08 '26 22:09 ai-sdk-factory[bot]

Re-tested end-to-end ~1h after your fix (2026-09-08 ~20:30Z): nonce → message → personal_sign with the same Crossmint smart wallet on Base → /api/auth/verify now returns HTTP 200 with the session cookie. ERC-1271 path works exactly as advertised.

Garbage-signature handling also verified: no more bare 500s.

Follow-through: we've submitted our tool for listing (Solana Anchor static-analysis scan, live at https://audit.askzephy.com, USDC-on-Base via x402 since August) — it's sitting in your review queue now. Thanks for the fast turnaround on this.

Thanks! I really appreciate your work and attention! Your tool is live now on Fatstack. Check it out here: https://www.fatstack.net/catalog/askzephy-solana-audit

Best wishes!

anatshad avatar Sep 08 '26 22:09 anatshad

Documentation addition assessment

  • Subject: Fatstack (@fatstack/ai-sdk-tools)
  • External AI SDK evidence: found
  • Maintainer approval: not yet approved
  • Assessed: 2026-09-08T22:04:37.957Z

Fatstack now provides public, provider-controlled documentation and a canonical repository with concrete installation, spend-guard configuration, and generateText usage. The package manifest declares AI SDK ^7.0.0 compatibility, matching the current AI SDK major, and the implementation returns the SDK's ToolSet type.

Evidence

  • Using Fatstack tools with the AI SDK — Documents npm installation, wallet and required spend-guard configuration, passing the discovered tools to AI SDK generateText, and Base Sepolia test setup.
  • @fatstack/ai-sdk-tools README — Provides package installation and a concrete generateText example using an AI SDK model, plus catalogue filtering, mandatory spending limits, and testnet instructions.
  • Fatstack Agent quickstart — Gives a dedicated Vercel AI SDK workflow that installs the package, constructs paid tools with a wallet and guards, and supplies them to generateText.
  • @fatstack/ai-sdk-tools package manifest — Identifies package version 0.1.1, the canonical repository, and a peer dependency on ai ^7.0.0, establishing compatibility with the current AI SDK major.
  • @fatstack/ai-sdk-tools implementation — Shows the integration importing AI SDK tool and ToolSet, converting marketplace listings into executable SDK tools, and enforcing spend guards before discovery and payment.
  • Fatstack repository README — The canonical provider repository includes an agent quickstart that installs @fatstack/ai-sdk-tools and passes its spend-guarded tool set to AI SDK generateText.

Next step

A maintainer must apply task-documentation-addition-approved before Factory can implement this addition.

Taking some time to pause new PR action...

anatshad avatar Sep 08 '26 22:09 anatshad

@anatshad quick ops check on Fatstack: our second listing — askzephy-quick-scan, submitted Sep 9 ~16:40Z — has shown "Awaiting manual review" for ~48h now, vs ~1.5h turnaround on the first one (askzephy-solana-audit, live and clean since). No rush on the review itself; just want to confirm the submission isn't sitting somewhere silently. If it dropped or needs a re-submit, say the word.

halobartku avatar Sep 11 '26 16:09 halobartku

@anatshad quick ops check on Fatstack: our second listing — askzephy-quick-scan, submitted Sep 9 ~16:40Z — has shown "Awaiting manual review" for ~48h now, vs ~1.5h turnaround on the first one (askzephy-solana-audit, live and clean since). No rush on the review itself; just want to confirm the submission isn't sitting somewhere silently. If it dropped or needs a re-submit, say the word.

Hey there! Been out for few days, and thanks to you found some alert bug, now fixed and your listing approved! Working on auto-approve system to go live soon! Thanks for your attention!

anatshad avatar Sep 14 '26 11:09 anatshad

@halobartku

I corrected something on your two listings and want to be upfront about it. They were registered as protocol=http pointing at https://audit.askzephy.com, which 404s, so agents following the catalogue were getting nothing. Your server is fine: it speaks MCP at /mcp and lists three tools. I switched both to protocol=mcp, which makes us append the path, and they now resolve correctly. Nothing else changed: same endpoint, same price, same wallet. If you meant them as plain HTTP tools instead, say so and I'll put it back.

That was our failure more than yours: nothing checked whether a listing's endpoint answered before approving it. It does now. Approval probes with initialize, which is free and side-effect free, and refuses with a reason rather than letting a dead listing go live.

Apologies if you saw anything odd. Fixed.

anatshad avatar Sep 14 '26 13:09 anatshad

Documentation addition assessment

  • Subject: Fatstack (@fatstack/ai-sdk-tools)
  • External AI SDK evidence: found
  • Maintainer approval: approved
  • Assessed: 2026-09-16T03:30:51.740Z

Fatstack provides public, provider-controlled documentation and canonical repository examples covering installation, wallet and mandatory spend-guard configuration, Base Sepolia testing, and passing the returned ToolSet to AI SDK generateText. The integration declares ai ^7.0.0 compatibility, matching the current AI SDK major, and its implementation uses the current tool and ToolSet APIs.

Evidence

  • Using Fatstack tools with the AI SDK — Documents npm installation, wallet and required daily spend-cap configuration, Base Sepolia setup, and passing discovered Fatstack tools to generateText.
  • @fatstack/ai-sdk-tools README — Provides a concrete generateText example using fatstackTools, an AI SDK model, catalogue filtering, mandatory spending limits, and testnet instructions.
  • Fatstack Agent quickstart — Includes a dedicated Vercel AI SDK workflow that installs the package, constructs spend-guarded tools, and supplies them to generateText.
  • @fatstack/ai-sdk-tools package manifest — Identifies package version 0.1.1, its canonical repository, build exports, and peer compatibility with ai ^7.0.0.
  • @fatstack/ai-sdk-tools implementation — Imports tool and ToolSet from ai, converts marketplace listings into executable AI SDK tools, and enforces spend guards before discovery and payment.
  • Fatstack repository README — The canonical repository provides an AI SDK agent quickstart installing @fatstack/ai-sdk-tools and passing its returned tools to generateText.
  • Base Sepolia payment example — Provides runnable testnet code exercising Fatstack tool discovery, required guards, AI SDK tool construction, invocation, and x402 settlement.

Next step

Both gates are satisfied. Factory may proceed to correctness verification and implementation.

ai-sdk-factory[bot] avatar Sep 16 '26 03:09 ai-sdk-factory[bot]

Factory could not verify enough source material to publish correct documentation, so no pull request was created.

Fatstack's documentation and intended registry snippet use the default public catalogue with networks: ['base-sepolia'], while the provider's end-to-end example states that the public catalogue contains only Base mainnet listings and therefore creates a local Sepolia registry and tool. The live catalogue inspection likewise found only eip155:8453 listings. Consequently, the proposed safe testnet snippet can discover listings but cannot successfully pay for them on its configured network; linking to that setup would publish instructions that are not runnable as described.

A maintainer approval cannot override correctness. Please add clarifying source material in a new comment.

ai-sdk-factory[bot] avatar Sep 16 '26 04:09 ai-sdk-factory[bot]

Documentation addition assessment

  • Subject: Fatstack (@fatstack/ai-sdk-tools)
  • External AI SDK evidence: inconclusive
  • Maintainer approval: approved
  • Assessed: 2026-09-16T04:29:32.782Z

Fatstack documents installation, spend guards, and AI SDK 7 generateText usage, but the published instructions conflict on a runnable flow. The website, repository README, and agent quickstart configure Base Sepolia against the default public catalogue, while the live catalogue contains only Base mainnet listings. The repository's Sepolia example acknowledges this and substitutes a local registry and source-tree import rather than exercising the published package against the public catalogue. These conflicts prevent verification of currently usable end-to-end instructions.

Evidence

  • Using Fatstack tools with the AI SDK — Provides installation, mandatory spend-guard configuration, and generateText code, but configures Base Sepolia against a public catalogue that currently has only Base mainnet listings.
  • @fatstack/ai-sdk-tools README — Shows a concrete generateText integration and mainnet-default configuration, but its testnet section describes a discoverable Sepolia tool that is not present in the public catalogue.
  • Fatstack Agent quickstart — Installs the integration and viem and passes returned tools to generateText, but its Base Sepolia configuration uses the default mainnet-only catalogue.
  • Fatstack repository README — Identifies the canonical provider repository and repeats the AI SDK quickstart, including the conflicting Base Sepolia/default-catalogue setup.
  • @fatstack/ai-sdk-tools package manifest — Declares package version 0.1.1 and peer compatibility with ai ^7.0.0, matching the current AI SDK major.
  • @fatstack/ai-sdk-tools implementation — Uses the current AI SDK tool and ToolSet APIs, defaults payments to Base mainnet, and treats catalogue filtering separately from the configured payment networks.
  • Base Sepolia payment example — Explicitly states that the public catalogue has no Sepolia listings, then creates a local registry and imports the source tree to demonstrate testnet settlement.
  • Fatstack public tool registry — The live registry inspected on September 16, 2026 contains only eip155:8453 Base mainnet listings, confirming the documentation's public-catalogue Sepolia mismatch.

Next step

A maintainer applied task-documentation-addition-approved, overriding the external-documentation gate. Factory may proceed to correctness verification and implementation.

ai-sdk-factory[bot] avatar Sep 16 '26 04:09 ai-sdk-factory[bot]

Factory could not verify enough source material to publish correct documentation, so no pull request was created.

Provider-controlled sources still conflict about the runnable testnet flow. The documented Base Sepolia configuration cannot discover a payable Sepolia listing from the default public catalogue, so a correct verified guide and docsUrl-backed registry entry cannot be published.

A maintainer approval cannot override correctness. Please add clarifying source material in a new comment.

ai-sdk-factory[bot] avatar Sep 16 '26 04:09 ai-sdk-factory[bot]