Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
标准化的 Payment Required 响应体
interface Response402 { x402Version: 1; accepts: PaymentRequirements[]; error?: string; errorStage?: "parse" | "verify" | "settle"; }
import { z } from "zod"; export const Response402Schema = z.object({ x402Version: z.literal(1), accepts: z.array(PaymentRequirementsSchema), error: z.string().optional(), errorStage: z.enum(["parse", "verify", "settle"]).optional(), });
{ "x402Version": 1, "error": "Payment required - Choose a token", "accepts": [ { "scheme": "exact", "network": "bsc", "asset": "0xUSDC", "maxAmountRequired": "1000000", "description": "USDC", "mimeType": "application/json", "payTo": "0xSeller", "maxTimeoutSeconds": 600 }, { "scheme": "exact", "network": "bsc", "asset": "0xDAI", "maxAmountRequired": "1000000000000000000", "description": "DAI", "mimeType": "application/json", "payTo": "0xSeller", "maxTimeoutSeconds": 600 } ] }
error
accepts
PaymentRequirements
{ "x402Version": 1, "error": "Payment required", "accepts": [ { "scheme": "exact", "network": "bsc", "maxAmountRequired": "1000000", "description": "Premium API access", "mimeType": "application/json", "payTo": "0xSeller", "maxTimeoutSeconds": 600, "asset": "0xUSDC", "paymentType": "permit" } ] }