← BSV MCPInstall
Paid services & sponsorship

x402_request

Request any HTTPS service without automatically paying. Returns the response if free, or a BSV payment quote for approval. POST/PUT/PATCH/DELETE may execute if the service does not require payment. Use auth=brc31 for BSV-authenticated/BRC-105 services. No API key required by the client; optional service credentials are scoped by X402_SERVICE_HEADERS. Supports BRC-105, bound BRC-120 with OP_TRUE nonces, and compact bsv-tx-v1 challenges.

Read as Markdown

Result

The service response or a payment quote, including its ID and expiry. Also returns structured content.

Permissions

Never automatically pays. The requested HTTP method may still change the service's state if no payment is required.

Inputs and availability

Full catalog · Before wallet setup; Legacy local wallet; Legacy local identity; Local Vault · broadcasting disabled; Local Vault · all roles; Local Vault · payment role only; Project · payments scope; External BRC-100 wallet; Local Vault + sponsor; Droplit wallet

FieldType / requiredDescription
urlstring
Required
See schema for details.

format: "uri"

method"GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD"
Optional
See schema for details.

default: "GET"

bodystring
Optional
See schema for details.

maxLength: 1398104

bodyEncoding"utf8" | "base64"
Optional
See schema for details.

default: "utf8"

headersobject
Optional
See schema for details.
auth"none" | "brc31"
Optional
See schema for details.

default: "none"

boundHeadersarray of string
Optional
BRC-120 header names bound by the service; defaults to supplied request headers

Nested fields are required only when their parent object or array item is supplied.

Full input schema
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri"
    },
    "method": {
      "default": "GET",
      "type": "string",
      "enum": [
        "GET",
        "POST",
        "PUT",
        "PATCH",
        "DELETE",
        "HEAD"
      ]
    },
    "body": {
      "type": "string",
      "maxLength": 1398104
    },
    "bodyEncoding": {
      "default": "utf8",
      "type": "string",
      "enum": [
        "utf8",
        "base64"
      ]
    },
    "headers": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "auth": {
      "default": "none",
      "type": "string",
      "enum": [
        "none",
        "brc31"
      ]
    },
    "boundHeaders": {
      "description": "BRC-120 header names bound by the service; defaults to supplied request headers",
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "url"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}