Skip to content

Feature request: calling x402-paywalled tools from an agent #5183

Description

@genesiscode2026

Feature request

Support for calling paywalled tools (specifically x402-protected HTTP endpoints) from an Agents SDK agent.

Problem

Tools are increasingly exposed as pay-per-call HTTP endpoints. There's no built-in way for an Agents SDK tool to receive a 402 Payment-Required challenge, sign the payment, and retry.

Proposed behavior

A helper (or tool wrapper) that:

  1. Makes the tool request.
  2. On HTTP 402, reads the Payment-Required header (x402 v2).
  3. Signs the quoted Base USDC amount with a configured wallet.
  4. Retries with a Payment-Signature header and returns the paid result.

Context

x402 is an open, HTTP-native payment standard (402 + Payment-Required/Payment-Signature headers) already used by several agent tools. A live example is POST https://genesis-agent-tools.genesisagenttools.workers.dev/api/flagships/release-guardian, which returns 402 on the first call and the paid verdict on a signed retry.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions