Skip to content

Feature: Add Stripe Shared Payment Token (SPT) adapter #6

@up2itnow0822

Description

@up2itnow0822

Context

Stripe, Klarna, and Affirm just launched the Shared Payment Token (SPT) standard -- a unified agent payment rail that lets AI agents pay across multiple providers using a single tokenized payment method. This is part of the broader agent payment infrastructure war that is accelerating in Q1 2026.

Why this matters for agent-wallet-sdk

agent-wallet-sdk currently supports x402 native payments on 17 chains, CCTP cross-chain USDC transfers, and Jupiter swaps on Solana. The x402 implementation positions us well since Stripe is actively building on x402 for Base.

However, SPT is a separate standard targeting the custodial payment layer -- credit cards, BNPL, fiat rails -- that x402 does not cover. Agents that need to pay for services priced in fiat (SaaS subscriptions, API credits billed monthly, marketplace purchases) cannot use x402 today.

Proposed adapter

Add a StripeSPTAdapter that:

  1. Accepts a Stripe SPT (shared payment token) as a payment method in the wallet configuration
  2. Routes fiat-priced payments through the SPT instead of on-chain
  3. Falls back to x402/on-chain when SPT is not accepted by the merchant
  4. Maintains the same wallet.fetchWithPayment() interface so agent code does not need to change
const wallet = new AgentWallet({
  privateKey: process.env.AGENT_KEY,
  paymentAdapters: [
    new StripeSPTAdapter({ sharedPaymentToken: process.env.STRIPE_SPT }),
    new X402Adapter({ network: "base" })
  ]
});

// Wallet picks the right adapter based on merchant response
const result = await wallet.fetchWithPayment("https://api.example.com/data", {
  maxAmountUSDC: "0.01"
});

Evaluation needed

  • Review Stripe SPT API docs and token lifecycle
  • Assess Klarna and Affirm SPT compatibility (same token format?)
  • Define fallback priority order (SPT vs x402 vs direct on-chain)
  • Security review: SPT token storage, rotation, and revocation
  • Determine if SPT is agent-addressable (agent holds token vs. user holds token)

References

  • Stripe x402 announcement on Base
  • agent-wallet-sdk x402 support (v0.5.5)
  • Circle CCTP integration (v0.5.5)

Priority

High -- the agent payment rail war is moving fast. x402 covers the crypto-native side. SPT covers the fiat/custodial side. Both rails will likely coexist. We should support both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions