{"openapi":"3.1.0","info":{"title":"Obolpay Gateway — compatible with x402™","description":"Pay-per-call premium data for AI agents, settled in USDC on Base mainnet via HTTP 402. Paying needs the approval of the paying wallet's owner; each call costs the price quoted in the HTTP 402. Typical flow: GET /stats -> read `selected_product`; GET /api/v1/protected-data?types=<selected_product> -> HTTP 402 with a free preview and `accepts[]`; pay with an entry of accepts[] (standard x402 `exact`: an EIP-3009 authorization in the X-PAYMENT header — you pay no gas) and send X-Since-Seq to fetch only new data (token savings). No deposit and no account to open. Every delivery returns a signed proof-of-purchase receipt; stale data is never sold (freshness SLA — refused before any charge, or credited to your account balance here if found stale only after settlement). Full tools also via the MCP server at /mcp-server.py. Business use only. Terms: /terms · Legal notice: /legal. x402™ is a trademark of LF Projects, LLC.","version":"0.5.0"},"paths":{"/":{"get":{"summary":"Root","description":"ランディング（2026-09 G5 (i)）: 外部資産を一切読まない英語の静的な発見ページ。\n\n冒頭に施行規則 23 条 1〜3 号（商号・住所・電話番号・代表者名）を直書きし、\n「Legal notice (特定商取引法に基づく表記)」で /legal へ。\"business use only\" を表明。\n旧 MetaMask/WalletConnect 購入 UI（index.html）は examples/wallet_ui/ に退避し、\n本番では配信しない（リポ直下の index.html も読まない）。JS なし・第三者リクエスト 0 件を\nCSP `default-src 'none'` でブラウザに強制させる。","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/legal":{"get":{"tags":["discovery"],"summary":"特定商取引法に基づく表記 — legal notice (JSON, or HTML for browsers / ?format=html)","description":"特定商取引法に基づく表記（2026-09 G6）。日本語が正文・英語は参考訳。\n\n15 項目（販売業者・代表者・所在地・電話・メール・価格/必要料金・支払時期・支払方法・\n提供時期・撤回/解除・前払残高・動作環境・特記事項・適格請求書・資金決済法 13 条）。\n事業者の値は public_facts（FACTS.md 転記）、価格・支払方式・SLA 等は実装から。","operationId":"get_legal_notice","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","description":"ヘルスチェック。\n\nstandby / promoted は常に載せる（Blue-Green デプロイスクリプトと監視が\nスクリプタブルに読めるように。standby 中もステータスは 200 のまま——\ndocker healthcheck・cloudflared・デプロイのプローブは「プロセスが応答するか」を\n見ており、standby は故障ではない）。既定運用（standby 無効）では\nstandby=false / promoted=false が固定で返る。","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/.well-known/x402":{"get":{"summary":"Well Known X402","description":"x402 機械可読ディスカバリ・マニフェスト（AIエージェントが自動課金・利用するための入口）","operationId":"well_known_x402__well_known_x402_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Well Known X402  Well Known X402 Get"}}}}}}},"/llms.txt":{"get":{"summary":"Llms Txt","operationId":"llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/robots.txt":{"get":{"summary":"Robots Txt","operationId":"robots_txt_robots_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/sitemap.xml":{"get":{"summary":"Sitemap Xml","description":"クローラ/インデクサ向けサイトマップ。発見・商品エンドポイントを索引させる（集客導線）。","operationId":"sitemap_xml_sitemap_xml_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/pricing":{"get":{"tags":["discovery"],"summary":"Pricing","description":"価格・課金単位・返金条件（機械可読）。","operationId":"pricing_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Pricing Pricing Get"}}}}}}},"/terms":{"get":{"tags":["discovery"],"summary":"Terms","description":"利用規約（機械可読・正準 JSON）。402 の terms.sha256 と同じバイト列を返す。","operationId":"terms_terms_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/privacy":{"get":{"tags":["discovery"],"summary":"Privacy","description":"プライバシー方針（機械可読）。「取らない」と書いたものは実際に取らない。","operationId":"privacy_privacy_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Privacy Privacy Get"}}}}}}},"/client.py":{"get":{"summary":"Reference Client","description":"貼るだけで動く参照クライアント（AIエージェントの即時連携用）。ドメインを埋め込んで配信。","operationId":"reference_client_client_py_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/mcp-server.py":{"get":{"summary":"Mcp Server File","description":"MCPサーバ実装を配信（Claude等のMCPクライアントが discover/preview/purchase/verify をネイティブ利用）。","operationId":"mcp_server_file_mcp_server_py_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/verify-receipt":{"post":{"summary":"Verify Receipt","description":"支払い受領書(proof-of-purchase)を検証する。{message, signature} を受け取り、\nEIP-191で署名者を復元して本サーバの受領書署名アドレスと一致するか返す。誰でも第三者検証可能。\n\n公共ハブ拡張（VDP spec）: 任意の `expected_signer` を渡すと、**他ベンダーの\nレシートでも**復元署名者との一致を判定して返す（`valid_for_expected`）。\n`valid` は従来どおり「本サーバ発行か」だけを意味する——2つの意味を混ぜない。","operationId":"verify_receipt_verify_receipt_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/vdp":{"get":{"tags":["discovery"],"summary":"Verifiable Data Product spec (open standard, CC-BY-4.0)","description":"検証可能データ商品の公開仕様。本ゲートウェイが参照実装（名乗りと実装の一致）。\n\n参照実装の URL は正規ホストから、準拠状況は**配信中のカタログを同じ検査器で\n検査した結果**から組む（手書きの「all 9 categories」は 2026-09 G10 で廃止）。","operationId":"get_vdp_spec","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Vdp Spec"}}}}}}},"/wanted":{"get":{"tags":["discovery"],"summary":"Wanted board — recorded unmet demand; 2+ asks auto-productize","description":"求むデータ掲示板（③）。未充足需要を公開し、供給側の参加窓口を明示する。\n\nhonest numbers: ここに出るのは**外部の実要求だけ**（運用者プローブは記録段階で\n除外済み）。需要の演出はできない——0 件なら 0 件と表示される。","operationId":"get_wanted_board","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/patronage":{"post":{"tags":["discovery"],"summary":"Bundle receipts into ONE signed proof-of-patronage certificate","description":"パトロン証明（⑤）: 有効レシート束 → 署名付き証明書1通。\n\nレシートは無記名（bearer）なので、証明書も「この束の所持者」への証明である。\n各レシートは (a) 本サーバ署名の復元一致 (b) invoice_id が実消費済み\n(used_transactions に実在) の**両方**を満たすものだけ数える——署名だけだと\n「発行したが決済不成立」のレシートまで実績に化ける。\n現時点でこの証明書に価格特典は**付いていない**（付ける時は実装してから名乗る）。","operationId":"issue_patronage_certificate","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/warranty/claims":{"get":{"tags":["discovery"],"summary":"Public warranty-claim ledger (transparency)","description":"①拡張: 保証請求の公開台帳。反証された事実も却下した事実も**両方**晒す\n（「保証がある」という主張を検証可能にする。空なら空を正直に返す）。","operationId":"list_warranty_claims","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/vdp/validate":{"post":{"tags":["discovery"],"summary":"Machine-lint ANY item against the VDP spec (free)","description":"②拡張: 任意ベンダーの item を VDP 仕様に照らして機械検査する（無料・鍵不要）。\n検査は形式のみ——中身の真実性は各ベンダーのハッシュ束縛が担う（役割を混ぜない）。","operationId":"validate_vdp_item","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/wanted/{slug}/propose":{"post":{"tags":["discovery"],"summary":"Offer to supply a wanted category (manual review, honest)","description":"Send {contact, note} to offer to supply a category listed at GET /wanted. The contact and note are used only by the operator to review your offer and reply to you; they are not published and are deleted from the live database after 90 days (backups: see /privacy). Free; manual review.","operationId":"propose_supply","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/warranty/disprove":{"post":{"tags":["discovery"],"summary":"Disproof warranty: prove a delivered deterministic item wrong, get an automatic 2x refund","description":"①保証: 配信済みデータの機械的反証 → 2倍返金（前払い残高へ）。\n\n裁定はアーカイブ（receipt が束縛した配信原本）と pinned ソースからの\n**決定論再計算**のみで行う——人間の裁量なし・悪用は「本物のバグ」を要する。\ninvoice ごとに1回限り（warranty_claims PK）。standby 中は書かない。","operationId":"warranty_disprove","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/invoices/{invoice_id}":{"get":{"summary":"Get Invoice Status","description":"Invoiceの現在ステータスを照会する（クライアントのポーリング用）","operationId":"get_invoice_status_api_v1_invoices__invoice_id__get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/protected-data":{"get":{"tags":["paid-data"],"summary":"Fetch premium data (x402). Free preview if unpaid; GASLESS if you already hold an account balance.","description":"Returns the paid dataset. If unpaid, returns HTTP 402 with a free `preview` and the price. Pay with an entry of the 402 `accepts[]` — standard x402 `exact`: sign an EIP-3009 authorization and resend with the X-PAYMENT header (you pay no gas). If you already hold an account balance here (earlier top-ups or automatic refund credits), X-Account-Address / X-Account-Nonce / X-Account-Voucher spends it gaslessly; top-ups are not accepted. Call this with `?types=<category>` (use the value of `selected_product` from /stats to get the most-demanded data) and `X-Since-Seq=<the last seq you already hold>` to receive only new items (fewer tokens). Every successful (200) response includes a signed proof-of-purchase `receipt`.","operationId":"fetch_protected_data","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["paid-data"],"summary":"Fetch premium data (x402) via POST — identical semantics to the GET form.","description":"Same operation as `fetch_protected_data`, for agents that prefer POST.","operationId":"fetch_protected_data_via_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/account/{address}":{"get":{"tags":["balance"],"summary":"Check an account balance, next_nonce, and the exact voucher message to sign.","description":"Returns balance_units, calls_remaining, next_nonce, and `voucher_message`. A gasless call sends the EIP-191 signature of that message as X-Account-Voucher (with X-Account-Address and X-Account-Nonce=next_nonce).","operationId":"get_prepaid_account","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","title":"Address"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stats":{"get":{"tags":["discovery"],"summary":"Market demand analytics — which categories external buyers pay for (free).","description":"Demand statistics: `selected_product` (the category external buyers have paid the most for; null if none yet) and `top_demanded`. A category is requested with `?types=` on /api/v1/protected-data. Also shows revenue_by_category, gasless_calls, delta_calls. No payment required.","operationId":"get_demand_stats","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"tags":[{"name":"paid-data","description":"The paid resource (x402). Free preview, gasless, delta, categories."},{"name":"balance","description":"Look up and gaslessly spend an existing account balance (top-ups are not accepted)."},{"name":"discovery","description":"Machine-readable discovery & demand analytics for autonomous agents."}]}