openapi: 3.1.0 info: title: Test x402 Billing Server description: Демонстрационный сервер с поддержкой протокола x402 v2 для micropayments. version: 1.0.0 contact: name: x402 Test Server servers: - url: http://localhost:3000 description: Локальный сервер для разработки - url: https://x402helper.xyz description: Продакшен сервер paths: /hello: get: summary: Бесплатный тестовый эндпоинт description: Возвращает сообщение, подтверждающее, что агент может подключаться к сети. responses: '200': description: Успешный ответ content: application/json: schema: type: object properties: status: { type: string, example: "ok" } message: { type: string, example: "Hello, agent! Your internet connection works." } timestamp: { type: string } /test-billing: get: summary: Платный тестовый эндпоинт (0.001 USDC) description: | Этот эндпоинт защищён протоколом x402 v2. При отсутствии валидной оплаты сервер возвращает статус 402 Payment Required с заголовком `payment-required`, содержащим base64-encoded требования оплаты (scheme: "exact", network: "eip155:8453", USDC и т.д.). responses: '200': description: Оплата успешно подтверждена, запрос выполнен content: application/json: schema: type: object properties: status: { type: string, example: "ok" } message: { type: string, example: "Payment verified! Billing check passed." } price: { type: string, example: "0.001 USDC" } network: { type: string, example: "Base (eip155:8453)" } receivedBy: { type: string } timestamp: { type: string } '402': description: Payment Required — требуется оплата через x402 v2 headers: payment-required: description: Base64-encoded JSON с требованиями оплаты (x402 v2 standard) schema: type: string example: "eyJ4NDAyVmVyc2lvbiI6MiwicmVzb3VyY2UiOnsidXJsIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwL3Rlc3QtYmlsbGluZyIsIm1pbWVUeXBlIjoiYXBwbGljYXRpb24vanNvbiJ9LCJhY2NlcHRzIjpbeyJzY2hlbWUiOiJleGFjdCIsIm5ldHdvcmsiOiJlaXAxNTU6ODQ1MyIsImFtb3VudCI6IjEwMDAiLCJtYXhBbW91bnRSZXF1aXJlZCI6IjEwMDAiLCJhc3NldCI6IjB4ODMzNTg5ZkNENmVEYjZFMDhmNGM3QzMyRDRmNzFiNTRiZEEwMjkxMyIsInBheVRvIjoiMHgzODAzQTE5MjgwRGVlRmU1MzNEMTc3QzRBMTY5NDEyQkQzNDExMDFiIiwibWF4VGltZW91dFNlY29uZHMiOjYwLCJleHRyYSI6eyJkZWNpbWFscyI6NiwibmFtZSI6IlVTRCBDb2luIiwidmVyc2lvbiI6IjIifX1dLCJlcnJvciI6IlBheW1lbnQgcmVxdWlyZWQifQ==" content: application/json: schema: type: object properties: error: { type: string, example: "Payment required" } accepts: type: array items: type: object properties: scheme: { type: string, example: "exact" } network: { type: string, example: "eip155:8453" } amount: { type: string, example: "1000" } asset: { type: string } payTo: { type: string } maxTimeoutSeconds: { type: integer } extra: { type: object } resource: { type: object } /test.html: get: summary: Тестовая HTML-страница description: Простая HTML-страница для тестирования. responses: '200': description: HTML content content: text/html: schema: type: string components: schemas: PaymentRequired: type: object properties: error: { type: string, example: "Payment required" } accepts: type: array items: type: object properties: scheme: { type: string, example: "exact" } network: { type: string, example: "eip155:8453" } amount: { type: string, example: "1000" } asset: { type: string } payTo: { type: string }