{
  "openapi": "3.1.0",
  "info": {
    "title": "HookSink Webhook Inbox & Signature Verifier API",
    "version": "1.0.0",
    "summary": "Provision instant public webhook URLs, verify Stripe/Shopify/GitHub/Slack HMAC signatures, and replay captured events at the edge.",
    "description": "Ephemeral Cloudflare Durable Object webhook capture inboxes, constant-time multi-provider HMAC-SHA256 signature verification (Stripe, GitHub, Shopify, Slack, Linear), and SSRF-guarded webhook replay for autonomous agents.\n\nEliminates spinning up ngrok tunnels, public servers, or error-prone raw-body HMAC/timestamp parsers when agents test integrations or receive async callbacks.",
    "contact": {
      "name": "Monetization Gateway Edge APIs",
      "url": "https://apikeg.com"
    }
  },
  "servers": [
    {
      "url": "https://hook-sink.apikeg.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Keg Key (ak_live_...)",
        "description": "Optional per-email monthly subscription API key ($5/$20/$50 tiers at https://apikeg.com/account). Omit this header to pay per request inline via HTTP 402 (x402 USDC)."
      }
    }
  },
  "security": [
    {},
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/create-inbox": {
      "post": {
        "operationId": "create_inbox",
        "summary": "Create Ephemeral Webhook Inbox",
        "description": "Provisions a fresh public webhook capture URL (/in/:inboxId) backed by an isolated Durable Object ring buffer (up to 100 events, 128 KiB each) with optional automatic HMAC signature verification. Why call instead of DIY: Replaces running ngrok/cloudflared tunnels, deploying temporary webhook servers, and managing TTL cleanup cron jobs. Pricing: Free ($0.00). Pass ?dry_run=true on REST to validate schema free.",
        "tags": [
          "developer-tools",
          "webhook-testing",
          "security-verification",
          "agent-infra"
        ],
        "externalDocs": {
          "description": "Create Ephemeral Webhook Inbox Specification & Examples",
          "url": "https://hook-sink.apikeg.com/tools/create-inbox"
        },
        "parameters": [
          {
            "name": "dry_run",
            "in": "query",
            "required": false,
            "description": "Validate request schema for free ($0.00) without executing or settling payment.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "stripe",
                      "github",
                      "shopify",
                      "slack",
                      "linear",
                      "generic_sha256"
                    ],
                    "description": "Optional webhook provider preset for automatic HMAC verification on capture (auto, stripe, github, shopify, slack, linear, generic_sha256)."
                  },
                  "signingSecret": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "description": "Optional webhook signing secret used to verify inbound webhook signatures automatically as events arrive."
                  },
                  "signatureHeader": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "Optional custom HTTP header name containing the HMAC signature when using generic_sha256 or linear."
                  },
                  "ttlSeconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400,
                    "default": 3600,
                    "description": "Ephemeral inbox retention TTL in seconds (60 to 86400, default 3600)."
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "provider": "stripe",
                "ttlSeconds": 3600
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution result.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "Base64-encoded x402 v2 payment settlement receipt (when paid).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Schema validation error (unbilled, $0.00)."
          }
        }
      }
    },
    "/v1/inspect-inbox-events": {
      "post": {
        "operationId": "inspect_inbox_events",
        "summary": "Inspect Captured Webhook Events",
        "description": "Retrieves captured webhook deliveries from an inbox (headers, raw body, SHA-256 digest, parsed JSON, and cryptographic signature verification), supporting cursor pagination via sinceEventId and retroactive ad-hoc signature checks. Why call instead of DIY: Provides structured raw-body + parsed-JSON payloads with constant-time HMAC verification in a single call. Pricing: $0.002 USD per inbox inspection query (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
        "tags": [
          "developer-tools",
          "webhook-testing",
          "security-verification",
          "agent-infra"
        ],
        "externalDocs": {
          "description": "Inspect Captured Webhook Events Specification & Examples",
          "url": "https://hook-sink.apikeg.com/tools/inspect-inbox-events"
        },
        "x-x402": {
          "version": 2,
          "scheme": "exact",
          "priceUsd": "0.002",
          "amountAtomicUnits": "2000",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "extensions": {
            "bazaar": {
              "discoverable": true,
              "category": [
                "developer-tools",
                "webhook-testing",
                "security-verification",
                "agent-infra"
              ],
              "info": {
                "input": {
                  "type": "http",
                  "method": "POST",
                  "bodyType": "json",
                  "example": {
                    "inboxId": "inb_0123456789abcdef01234567",
                    "readToken": "hsk_0123456789abcdef0123456789abcdef0123456789abcdef",
                    "limit": 20
                  }
                },
                "output": {
                  "type": "json"
                }
              },
              "schema": {
                "inputSchema": {
                  "type": "object",
                  "properties": {
                    "inboxId": {
                      "type": "string",
                      "minLength": 4,
                      "maxLength": 128,
                      "pattern": "^[A-Za-z0-9_-]+$",
                      "description": "Ephemeral inbox identifier returned by create_inbox."
                    },
                    "readToken": {
                      "type": "string",
                      "minLength": 8,
                      "maxLength": 256,
                      "description": "Secret read token returned by create_inbox."
                    },
                    "limit": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100,
                      "default": 50,
                      "description": "Maximum number of captured webhook events to return (1–100, default 50)."
                    },
                    "sinceEventId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "description": "Cursor pagination: return only events captured strictly after this eventId."
                    },
                    "signingSecret": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512,
                      "description": "Optional ad-hoc HMAC signing secret to retroactively verify captured webhook events."
                    },
                    "provider": {
                      "type": "string",
                      "enum": [
                        "auto",
                        "stripe",
                        "github",
                        "shopify",
                        "slack",
                        "linear",
                        "generic_sha256"
                      ],
                      "description": "Optional provider preset override for retroactive signature verification (auto, stripe, github, shopify, slack, linear, generic_sha256)."
                    },
                    "signatureHeader": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "description": "Optional custom header name for retroactive generic_sha256 verification."
                    },
                    "toleranceSeconds": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 86400,
                      "description": "Optional timestamp tolerance window in seconds (evaluated against each event's receivedAt timestamp)."
                    }
                  },
                  "required": [
                    "inboxId",
                    "readToken"
                  ],
                  "additionalProperties": false
                },
                "outputSchema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "_meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Deterministic structured tool result payload."
                    },
                    "_meta": {
                      "type": "object",
                      "required": [
                        "requestId",
                        "durationMs",
                        "chargedUsd",
                        "dryRun"
                      ],
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "dry_run",
            "in": "query",
            "required": false,
            "description": "Validate request schema for free ($0.00) without executing or settling payment.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inboxId": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 128,
                    "pattern": "^[A-Za-z0-9_-]+$",
                    "description": "Ephemeral inbox identifier returned by create_inbox."
                  },
                  "readToken": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 256,
                    "description": "Secret read token returned by create_inbox."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 50,
                    "description": "Maximum number of captured webhook events to return (1–100, default 50)."
                  },
                  "sinceEventId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "Cursor pagination: return only events captured strictly after this eventId."
                  },
                  "signingSecret": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "description": "Optional ad-hoc HMAC signing secret to retroactively verify captured webhook events."
                  },
                  "provider": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "stripe",
                      "github",
                      "shopify",
                      "slack",
                      "linear",
                      "generic_sha256"
                    ],
                    "description": "Optional provider preset override for retroactive signature verification (auto, stripe, github, shopify, slack, linear, generic_sha256)."
                  },
                  "signatureHeader": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "Optional custom header name for retroactive generic_sha256 verification."
                  },
                  "toleranceSeconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 86400,
                    "description": "Optional timestamp tolerance window in seconds (evaluated against each event's receivedAt timestamp)."
                  }
                },
                "required": [
                  "inboxId",
                  "readToken"
                ],
                "additionalProperties": false
              },
              "example": {
                "inboxId": "inb_0123456789abcdef01234567",
                "readToken": "hsk_0123456789abcdef0123456789abcdef0123456789abcdef",
                "limit": 20
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution result.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "Base64-encoded x402 v2 payment settlement receipt (when paid).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Schema validation error (unbilled, $0.00)."
          },
          "402": {
            "description": "Payment Required. Decode the Base64 PAYMENT-REQUIRED header and retry with PAYMENT-SIGNATURE.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 PaymentRequired JSON object.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/verify-webhook-signature": {
      "post": {
        "operationId": "verify_webhook_signature",
        "summary": "Verify Webhook HMAC Signature",
        "description": "Statelessly verifies webhook HMAC-SHA256 signatures and replay timestamps across Stripe, GitHub, Shopify, Slack, Linear, or custom headers using constant-time Web Crypto comparison. Why call instead of DIY: Prevents subtle raw-body serialization bugs, hex vs. base64 mismatches, timing side channels, and Stripe/Slack timestamp replay vulnerabilities. Pricing: $0.001 USD per stateless signature verification (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
        "tags": [
          "developer-tools",
          "webhook-testing",
          "security-verification",
          "agent-infra"
        ],
        "externalDocs": {
          "description": "Verify Webhook HMAC Signature Specification & Examples",
          "url": "https://hook-sink.apikeg.com/tools/verify-webhook-signature"
        },
        "x-x402": {
          "version": 2,
          "scheme": "exact",
          "priceUsd": "0.001",
          "amountAtomicUnits": "1000",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "extensions": {
            "bazaar": {
              "discoverable": true,
              "category": [
                "developer-tools",
                "webhook-testing",
                "security-verification",
                "agent-infra"
              ],
              "info": {
                "input": {
                  "type": "http",
                  "method": "POST",
                  "bodyType": "json",
                  "example": {
                    "provider": "stripe",
                    "rawBody": "{\"id\":\"evt_123\",\"type\":\"checkout.session.completed\"}",
                    "headers": {
                      "Stripe-Signature": "t=1700000000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
                    },
                    "secret": "whsec_test_secret",
                    "toleranceSeconds": 300
                  }
                },
                "output": {
                  "type": "json"
                }
              },
              "schema": {
                "inputSchema": {
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string",
                      "enum": [
                        "auto",
                        "stripe",
                        "github",
                        "shopify",
                        "slack",
                        "linear",
                        "generic_sha256"
                      ],
                      "default": "auto",
                      "description": "Webhook signature provider preset (auto, stripe, github, shopify, slack, linear, generic_sha256)."
                    },
                    "rawBody": {
                      "type": "string",
                      "maxLength": 262144,
                      "description": "Exact raw UTF-8 HTTP request body string as delivered by the webhook sender."
                    },
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "HTTP request headers map containing the webhook signature header(s)."
                    },
                    "secret": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512,
                      "description": "Webhook HMAC signing secret (e.g., whsec_... for Stripe)."
                    },
                    "toleranceSeconds": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 86400,
                      "default": 300,
                      "description": "Timestamp replay-window tolerance in seconds for Stripe and Slack (default 300)."
                    },
                    "signatureHeader": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "description": "Optional custom signature header name when provider is generic_sha256 or linear."
                    },
                    "nowSeconds": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Optional Unix epoch timestamp (seconds) override for deterministic replay checks."
                    }
                  },
                  "required": [
                    "rawBody",
                    "headers",
                    "secret"
                  ],
                  "additionalProperties": false
                },
                "outputSchema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "_meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Deterministic structured tool result payload."
                    },
                    "_meta": {
                      "type": "object",
                      "required": [
                        "requestId",
                        "durationMs",
                        "chargedUsd",
                        "dryRun"
                      ],
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "dry_run",
            "in": "query",
            "required": false,
            "description": "Validate request schema for free ($0.00) without executing or settling payment.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "stripe",
                      "github",
                      "shopify",
                      "slack",
                      "linear",
                      "generic_sha256"
                    ],
                    "default": "auto",
                    "description": "Webhook signature provider preset (auto, stripe, github, shopify, slack, linear, generic_sha256)."
                  },
                  "rawBody": {
                    "type": "string",
                    "maxLength": 262144,
                    "description": "Exact raw UTF-8 HTTP request body string as delivered by the webhook sender."
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "HTTP request headers map containing the webhook signature header(s)."
                  },
                  "secret": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "description": "Webhook HMAC signing secret (e.g., whsec_... for Stripe)."
                  },
                  "toleranceSeconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 86400,
                    "default": 300,
                    "description": "Timestamp replay-window tolerance in seconds for Stripe and Slack (default 300)."
                  },
                  "signatureHeader": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "Optional custom signature header name when provider is generic_sha256 or linear."
                  },
                  "nowSeconds": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Optional Unix epoch timestamp (seconds) override for deterministic replay checks."
                  }
                },
                "required": [
                  "rawBody",
                  "headers",
                  "secret"
                ],
                "additionalProperties": false
              },
              "example": {
                "provider": "stripe",
                "rawBody": "{\"id\":\"evt_123\",\"type\":\"checkout.session.completed\"}",
                "headers": {
                  "Stripe-Signature": "t=1700000000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
                },
                "secret": "whsec_test_secret",
                "toleranceSeconds": 300
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution result.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "Base64-encoded x402 v2 payment settlement receipt (when paid).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Schema validation error (unbilled, $0.00)."
          },
          "402": {
            "description": "Payment Required. Decode the Base64 PAYMENT-REQUIRED header and retry with PAYMENT-SIGNATURE.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 PaymentRequired JSON object.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/replay-event": {
      "post": {
        "operationId": "replay_event",
        "summary": "Replay Captured Webhook Event",
        "description": "Replays a captured webhook event (exact raw body, HTTP method, and signature headers) from an inbox to a public HTTP/HTTPS target URL protected by strict SSRF filtering, returning target status, latency, and response snippet. Why call instead of DIY: Safely redelivers exact byte-for-byte webhook payloads with original signatures intact without risking SSRF against internal networks. Pricing: $0.003 USD per SSRF-guarded webhook replay (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
        "tags": [
          "developer-tools",
          "webhook-testing",
          "security-verification",
          "agent-infra"
        ],
        "externalDocs": {
          "description": "Replay Captured Webhook Event Specification & Examples",
          "url": "https://hook-sink.apikeg.com/tools/replay-event"
        },
        "x-x402": {
          "version": 2,
          "scheme": "exact",
          "priceUsd": "0.003",
          "amountAtomicUnits": "3000",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "extensions": {
            "bazaar": {
              "discoverable": true,
              "category": [
                "developer-tools",
                "webhook-testing",
                "security-verification",
                "agent-infra"
              ],
              "info": {
                "input": {
                  "type": "http",
                  "method": "POST",
                  "bodyType": "json",
                  "example": {
                    "inboxId": "inb_0123456789abcdef01234567",
                    "readToken": "hsk_0123456789abcdef0123456789abcdef0123456789abcdef",
                    "eventId": "evt_000001_a1b2c3d4e5f6",
                    "targetUrl": "https://staging.example.com/webhooks/stripe",
                    "timeoutMs": 10000
                  }
                },
                "output": {
                  "type": "json"
                }
              },
              "schema": {
                "inputSchema": {
                  "type": "object",
                  "properties": {
                    "inboxId": {
                      "type": "string",
                      "minLength": 4,
                      "maxLength": 128,
                      "pattern": "^[A-Za-z0-9_-]+$",
                      "description": "Inbox identifier containing the captured event."
                    },
                    "readToken": {
                      "type": "string",
                      "minLength": 8,
                      "maxLength": 256,
                      "description": "Secret read token returned by create_inbox."
                    },
                    "eventId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "description": "Identifier of the captured webhook event to replay."
                    },
                    "targetUrl": {
                      "type": "string",
                      "minLength": 8,
                      "maxLength": 2048,
                      "description": "Publicly routable http:// or https:// URL to receive the replayed webhook."
                    },
                    "overrideHeaders": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Optional additional or overridden HTTP headers to send on replay."
                    },
                    "timeoutMs": {
                      "type": "integer",
                      "minimum": 500,
                      "maximum": 15000,
                      "default": 10000,
                      "description": "Outbound replay request timeout in milliseconds (500–15000, default 10000)."
                    }
                  },
                  "required": [
                    "inboxId",
                    "readToken",
                    "eventId",
                    "targetUrl"
                  ],
                  "additionalProperties": false
                },
                "outputSchema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "_meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Deterministic structured tool result payload."
                    },
                    "_meta": {
                      "type": "object",
                      "required": [
                        "requestId",
                        "durationMs",
                        "chargedUsd",
                        "dryRun"
                      ],
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "dry_run",
            "in": "query",
            "required": false,
            "description": "Validate request schema for free ($0.00) without executing or settling payment.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inboxId": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 128,
                    "pattern": "^[A-Za-z0-9_-]+$",
                    "description": "Inbox identifier containing the captured event."
                  },
                  "readToken": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 256,
                    "description": "Secret read token returned by create_inbox."
                  },
                  "eventId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "Identifier of the captured webhook event to replay."
                  },
                  "targetUrl": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 2048,
                    "description": "Publicly routable http:// or https:// URL to receive the replayed webhook."
                  },
                  "overrideHeaders": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Optional additional or overridden HTTP headers to send on replay."
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "minimum": 500,
                    "maximum": 15000,
                    "default": 10000,
                    "description": "Outbound replay request timeout in milliseconds (500–15000, default 10000)."
                  }
                },
                "required": [
                  "inboxId",
                  "readToken",
                  "eventId",
                  "targetUrl"
                ],
                "additionalProperties": false
              },
              "example": {
                "inboxId": "inb_0123456789abcdef01234567",
                "readToken": "hsk_0123456789abcdef0123456789abcdef0123456789abcdef",
                "eventId": "evt_000001_a1b2c3d4e5f6",
                "targetUrl": "https://staging.example.com/webhooks/stripe",
                "timeoutMs": 10000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution result.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "Base64-encoded x402 v2 payment settlement receipt (when paid).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Schema validation error (unbilled, $0.00)."
          },
          "402": {
            "description": "Payment Required. Decode the Base64 PAYMENT-REQUIRED header and retry with PAYMENT-SIGNATURE.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 PaymentRequired JSON object.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}