x402

Pay x402 challenges for HTTPS resources from an EVM wallet on Base and read the payments back.

2 implemented operations

connector.yaml
payment.x402Pay the x402 challenge of one HTTPS resource and return the paid result.payment.x402
wallet/evm payment.x402write#
  • HostedReadyRuns hosted on Runx Connect.Each call needs approval evidence or standing approval.
Runx scope
payment.x402
Target
{"$argument":"/payment_signal/resource/url"}
Amount
Each call binds its amount to {"$argument":"/payment_signal/amount_minor"} smallest units of {"$argument":"/parent_payment_authority/currency"}, which the run's authority must cover.
Repeats
enforced: The provider deduplicates by the idempotency key.
Inputs
Field and constraintsType / valuesRequired
payment_signalOnly listed fields acceptedobjectYes
payment_signal.pay_toPattern: ^0x[0-9a-fA-F]{40}$stringNo
payment_signal.resourceOnly listed fields acceptedobjectYes
payment_signal.resource.urlFormat: uriPattern: ^https://Max. 2048 charactersstringYes
payment_signal.resource.bodyobjectYes
payment_signal.resource.method"POST"Yes
payment_signal.resource.headersobjectNo
payment_signal.resource.headers.*Max. 4096 charactersAny field not listedstringNo
payment_signal.resource.timeout_msMinimum 1Maximum 120000integerNo
payment_signal.resource.max_response_bytesMinimum 1Maximum 26214400integerNo
payment_signal.amount_minorMinimum 0Maximum 9007199254740991integerYes
parent_payment_authorityOnly listed fields acceptedobjectYes
parent_payment_authority.term_idMin. 1 characterMax. 256 charactersstringYes
parent_payment_authority.currency"USD"Yes
parent_payment_authority.resource_urlFormat: uriMax. 2048 charactersstringYes
parent_payment_authority.max_amount_minorMinimum 0Maximum 9007199254740991integerYes

Required fields apply within their containing object. Unlisted fields are rejected.

Full input schema
{
  "type": "object",
  "required": [
    "payment_signal",
    "parent_payment_authority"
  ],
  "properties": {
    "payment_signal": {
      "type": "object",
      "required": [
        "resource",
        "amount_minor"
      ],
      "properties": {
        "pay_to": {
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{40}$"
        },
        "resource": {
          "type": "object",
          "required": [
            "url",
            "method",
            "body"
          ],
          "properties": {
            "url": {
              "type": "string",
              "format": "uri",
              "pattern": "^https://",
              "maxLength": 2048
            },
            "body": {
              "type": "object"
            },
            "method": {
              "type": "string",
              "const": "POST"
            },
            "headers": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "maxLength": 4096
              }
            },
            "timeout_ms": {
              "type": "integer",
              "maximum": 120000,
              "minimum": 1
            },
            "max_response_bytes": {
              "type": "integer",
              "maximum": 26214400,
              "minimum": 1
            }
          },
          "additionalProperties": false
        },
        "amount_minor": {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "parent_payment_authority": {
      "type": "object",
      "required": [
        "term_id",
        "currency",
        "max_amount_minor",
        "resource_url"
      ],
      "properties": {
        "term_id": {
          "type": "string",
          "maxLength": 256,
          "minLength": 1
        },
        "currency": {
          "type": "string",
          "const": "USD"
        },
        "resource_url": {
          "type": "string",
          "format": "uri",
          "maxLength": 2048
        },
        "max_amount_minor": {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

Result fields payment_idchallenge_idamount_minorcurrencystatustransactionnetworkpayerpay_topurchase_idpayment_required_digestpayment_response_digestresource_statusresource_resultfinalityblock_number

Operation digest sha256:456ffedd00e405f968958d804411669774b45c9cc02b49719e5e947b10de0e13

payment.x402.readRead back one x402 payment and its resource result.payment.x402.read
wallet/evm payment.x402.readread#
  • HostedReadyRuns hosted on Runx Connect.
Runx scope
payment.x402.read
Target
{"$argument":"/resource_url"}
Inputs
Field and constraintsType / valuesRequired
payment_idMin. 1 characterMax. 300 charactersstringYes
resource_urlFormat: uriPattern: ^https://Max. 2048 charactersstringYes

Required fields apply within their containing object. Unlisted fields are rejected.

Full input schema
{
  "type": "object",
  "required": [
    "payment_id",
    "resource_url"
  ],
  "properties": {
    "payment_id": {
      "type": "string",
      "maxLength": 300,
      "minLength": 1
    },
    "resource_url": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://",
      "maxLength": 2048
    }
  },
  "additionalProperties": false
}

Result fields payment_idchallenge_idamount_minorcurrencystatustransactionnetworkpayerpay_topurchase_idpayment_required_digestpayment_response_digestresource_statusresource_resultfinalityblock_numberreadback_statusresource_state

Operation digest sha256:7bfd7dfe759ffaa608c7e9308f342f95cbced9ce41b5fc95f32fef3c9cdc359b

Authentication

Commands here are for runx 0.11.1.

x402 accepts a stored credential.

Stored credential wallet
A evm_private_key_v1 with 2 fields: address (EVM wallet address), private_key (EVM wallet private key). Sent only to mainnet.base.org. The hosted placement can hold it in Runx Connect’s credential custody instead.
Hosted key
Runx Connect holds the key for the hosted placement; it never returns to your machine.
runx connector use wallet/evm --hosted

Authentication methods describe what the provider requires. They do not imply Runx supports every way the provider authenticates, and they do not grant access to your account.

Permissions

Each operation requires every Runx scope it declares. The account or key behind an instance must also reach the target on x402’s side; setting one up adds no x402 permissions.

payment.x402
payment.x402
payment.x402.read
payment.x402.read

Approval

These operations need approval evidence on every call, which a grant alone never replaces: payment.x402.

Skills that use x402