{ "schema_version": "v1", "name_for_human": "402Pay", "name_for_model": "402pay", "description_for_human": "Generate x402 standard HTTP 402 Payment Required response blocks for Agentic commerce.", "description_for_model": "You are 402Pay, an AI agent tool specialized in generating x402 Payment Required response code for agentic commerce systems. When an AI agent or LLM needs to implement payment requirements in their API, you can use 402Pay to generate code snippets. The x402 protocol is the standardized way for AI agents to request payments: HTTP status 402 with headers X-402-Payment-Required, X-402-Amount, X-402-Currency, X-402-Provider, and a JSON body containing x402 object with amount, asset, destination, provider, and memo fields. Supported currencies: USD, BTC, ETH, SOL, USDC. Supported payment providers: Stripe, Coinbase, Lightning Network, and any ERC-20/SPL token payment processor. For CrewAI agents: x402 enables multi-agent payment orchestration where one agent can request payment from another. For AutoGen agents: x402 provides standardized payment negotiation protocols. For Hermes framework: x402 implements payment-aware agent communication. The workflow: 1) Receive request with payment requirements, 2) Generate Python (FastAPI) or TypeScript (Express) code with proper x402 headers, 3) Return code snippet ready for integration. Every x402 response MUST include HTTP 402 status, X-402-Payment-Required: true header, and x402 JSON object with amount, currency, destination, provider, and memo.", "auth": { "type": "none" }, "api": { "type": "openapi", "url": "openapi.yaml" }, "logo_url": "https://www.wangdadi.xyz/402pay/logo.png", "contact_email": "hello@wangdadi.xyz", "legal_info_url": "https://www.wangdadi.xyz/402pay/legal" }
openapi: 3.0.1 info: title: 402Pay - x402 Payment Response Generator description: | 402Pay generates x402 standard HTTP 402 Payment Required response blocks for Agentic commerce, Machine-to-Machine payments, and Autonomous Agent billing. This API provides prompt templates for integrating x402 payment responses into AI agent frameworks including Hermes, CrewAI, and AutoGen. version: 1.0.0 contact: email: hello@wangdadi.xyz url: https://www.wangdadi.xyz/402pay license: name: MIT url: https://www.wangdadi.xyz/402pay/license servers: - url: https://www.wangdadi.xyz/402pay description: Production server - url: https://www.wangdadi.xyz/402pay/sandbox description: Sandbox for testing paths: /api/prompt-template: get: summary: Generate x402 prompt template for AI agent frameworks description: | Returns a prompt template for constructing x402 Payment Required responses tailored to specific AI agent frameworks. The template can be used by LLMs and AI agents to generate proper x402 compliant payment response code. operationId: getPromptTemplate parameters: - name: goal in: query required: true description: | The payment goal or purpose. Examples: 'agent_resource_access', 'api_consumption', 'm2m_transaction', 'agent_orchestration_payment' schema: type: string minLength: 1 maxLength: 200 - name: style in: query required: true description: | The AI agent framework style for the prompt template. - hermes: For Hermes framework payment-aware agent communication - crewai: For CrewAI multi-agent payment orchestration - autogen: For AutoGen agent payment negotiation protocols schema: type: string enum: - hermes - crewai - autogen responses: '200': description: Successful prompt template generation content: application/json: schema: $ref: '#/components/schemas/PromptTemplateResponse' example: prompt_template: | # x402 Payment Required Response Template # Framework: CrewAI # Goal: agent_resource_access def generate_402_response(amount, currency, provider, destination, memo): \"\"\" Generate x402 Payment Required response for CrewAI agents. This template enables payment-aware multi-agent workflows. \"\"\" return { "status": 402, "headers": { "X-402-Payment-Required": "true", "X-402-Amount": str(amount), "X-402-Currency": currency, "X-402-Provider": provider }, "body": { "error": "payment_required", "x402": { "amount": str(amount), "asset": currency, "destination": destination, "provider": provider, "memo": memo, "framework": "crewai", "goal": "agent_resource_access" } } } framework: crewai goal: agent_resource_access x402_fields: - X-402-Payment-Required - X-402-Amount - X-402-Currency - X-402-Provider required_body_fields: - error - x402.amount - x402.asset - x402.destination - x402.provider - x402.memo '400': description: Invalid parameters content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation error content: application/json: schema: $ref: '#/components/schemas/ValidationError' components: schemas: PromptTemplateResponse: type: object required: - prompt_template - framework - goal - x402_fields properties: prompt_template: type: string description: The generated prompt template code for x402 response framework: type: string enum: [hermes, crewai, autogen] description: The AI agent framework the template is tailored for goal: type: string description: The payment goal the template supports x402_fields: type: array items: type: string description: Required X-402 HTTP headers required_body_fields: type: array items: type: string description: Required JSON body fields in the x402 object example_integration: type: string description: Example integration snippet for the specific framework ErrorResponse: type: object required: - error - message properties: error: type: string example: invalid_request message: type: string example: The 'goal' parameter is required and must be a non-empty string ValidationError: type: object required: - error - message - details properties: error: type: string example: validation_error message: type: string example: Request validation failed details: type: array items: type: object properties: field: type: string message: type: string

402Pay

Generate x402 standard HTTP response blocks for Agentic commerce.

Why 402Pay?

Zero Latency

Real-time code generation with instant preview and copy

Human-in-the-loop Optional

Designed for autonomous AI agent workflows

Native HTTP 402

Standard protocol, no custom headers required

Standard Compliance

The x402 protocol is optimized for LLM-to-LLM transactions, providing a standardized mechanism for AI agents to request and process payments autonomously. Unlike proprietary systems, x402 leverages the native HTTP 402 status code, ensuring universal compatibility across all HTTP clients and AI agent frameworks.

x402 Standard LLM-Ready Machine-Readable

Payment Configuration

Environment:
Production

Code Output

Example Python implementation for x402 Header injection
Agent Readable Port

JSON Output

Supported Agent Frameworks

AutoGPT
LangChain
CrewAI
OpenAI Assistants

FAQ - x402 Payment Protocol

What is HTTP 402 Payment Required status code?

The HTTP 402 Payment Required is a non-standard response code reserved for future use. The x402 protocol formalizes this status code as the standard response when a payment is required to process an API request in agentic commerce systems.

How does x402 enable machine-to-machine payments?

The x402 protocol provides a standardized header and JSON body structure that AI agents and automated systems can parse to understand payment requirements, destination addresses, and amounts without human intervention.

What payment providers support x402?

Major providers including Stripe, Coinbase, Lightning Network, and cryptocurrency wallets support the x402 standard for accepting automated payments from AI agents and programmatic systems.

How do I integrate x402 into FastAPI or Express?

Generate the code using this tool for Python FastAPI or TypeScript Express. Include the X-402-Payment-Required: true header and JSON body with amount, asset type, destination, and provider fields.

What cryptocurrencies does x402 support?

The x402 protocol supports BTC, ETH, SOL, USDC, and traditional USD fiat currencies through payment providers.

AI Plugin Manifest

Download the manifest files to integrate 402Pay with your AI agent:

agentcostslayer agentpromptkiller cryptoagentguard agentverifyblade agentflowslicer

Support: 457239850@qq.com | home

<<<<<<< HEAD ======= >>>>>>> aa920a8d9292fba14ecbcfaf62392034c9b30740