Skip to content

Feature request: optional per-call x402 payment for executable skills (paid skill authoring) #2297

Open

Description

@dhyabi2

Is your feature request related to a problem? Please describe.

Refly's executable skills are free and open — any user or agent can pull and run any skill. There is no mechanism for a skill author to charge per-call: a skill that costs the author money to run (API calls, data acquisition, private model inference) has no way to recoup that cost inside the platform.

Users who want to share a paid data-retrieval skill (a domain lookup, a content extraction, a verified-check tool) currently have to set up their own x402 endpoint and manage payment outside Refly — or not offer the skill at all.

Describe the solution you'd like

Add an optional x402Payment field to a skill's metadata (in the skill declaration / skill.json or the refly-skills registry):

{
  "name": "domain-intel",
  "x402Payment": {
    "price_xno": 0.0001,
    "pay_to": "nano_1yo6c1t64ahfjdw1dxizmbbnpdmbrckwhw9phbg5pdkeubrizga4qhnjmnx7",
    "accepts": [
      {"chain": "nano", "network": "mainnet", "token": "XNO", "standard": "exact"}
    ]
  }
}

When a user or agent invokes a skill that declares x402Payment, the Refly runtime:

  1. returns an x402 payment challenge (structured payment_required result / HTTP 402),
  2. the client (Claude Code / Cursor / Codex / API) presents the challenge,
  3. the caller authenticates a Nano payment and retries with the settlement proof,
  4. the skill executes.

This is the same pattern as MCP x402 pay-per-call endpoints (spec: x402.org, x402Version 2).

Describe alternatives you've considered

  • Keep all skills free. Works, but a skill author who pays for data/APIs has no way to recoup per-call cost inside Refly.
  • Set up a separate paid endpoint outside Refly. Adds ops overhead and splits the skill from its payment.

Additional context

A working reference. Vend API Merchant MCP (extract.paypercall.dev/mcp) already implements this pattern: pay-per-call tools (web extract, link checker, geoip, domain intelligence, web search, youtube transcript) — each call ~0.0001 XNO, no signup, no API keys.

Why this is additive

  • Not a change to how free skills work — just an optional metadata field.
  • Lets skill authors recover API costs per-call without building a separate payment system.
  • Brings Refly's executable skills to the x402 agent-payment ecosystem for free.
  • The payer infrastructure (x402 client wallet, Nano settlement) already exists and is framework-agnostic.

Security

  • The x402 payment is settled peer-to-peer (no escrow, no platform trust).
  • The Refly runtime only relays the x402 challenge and checks the settlement proof on retry — it never holds or touches funds.
  • A skill without x402Payment works exactly as before.

Activity

  1. dhyabi2 commented on Sep 25, 2026

    @dhyabi2
    Author

    A working, tested paid-skill example — data extraction, settled in Nano (XNO) per call

    This is exactly the "paid skill authoring" case in practice, with the full flow
    verified end-to-end: a skill author exposes a live pay-per-call skill without a
    subscription or API-key program, and a caller pays in-flow per call.

    Live target: Vend extract (Nano / XNO, exact x402 scheme)

    https://extract.paypercall.dev/api/v1/extract answers a bare GET with
    402 Payment Required and a valid x402 v2 envelope:

    • headers: payment-required: <envelope>, x-402-version: 2
    • envelope: accepts[0] = {scheme:"exact", network:"nano:mainnet", asset:"XNO", amount:"0.0001", payTo:"nano_1yo6c1t64..."}
    • no API key, no subscription; price is metered and known before any spend

    A real on-ledger payment to that quoted address (send 8546D8DF5810...,
    0.0001 XNO) bought one delivered call: HTTP 200 with the page text and a
    receipt naming the paying account; replaying the same block is refused
    (402 already_redeemed).

    The skill-side tool an author would ship

    from x402_vend import VendExtract
    
    # author: publish the endpoint + a small tool that returns the paid result
    skill = VendExtract()                       # no wallet -> dry-run quote only
    print(skill.quote(url="https://example.com"))
    # {"price_xno":"0.0001","scheme":"exact","network":"nano:mainnet",
    #  "asset":"XNO","pay_to":"nano_1yo6c1t64..."}
    
    # caller: a configured payer honors the 402 in-flow
    result = VendExtract(wallet=Wallet(seed="...")).call(url="https://example.com/article")

    This is a per-call settlement rail for a skill that costs the author money to
    run (data acquisition, extraction, inference): the price is quoted before the
    spend, and the caller pays only when the endpoint actually answers a 402. Happy
    to shape this into a refly skill / registry entry if the x402Payment field
    lands.

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