kasanegi.com x402 unpaid example

AI-readable review entry for the three current Kasanegi public-data API products. The full plain-text version is available at /ai-review.txt.

# x402 unpaid example — kasanegi.com broker gateway

This page shows the literal HTTP exchange a buyer (or AI agent) sees
the first time they hit a paid endpoint without a payment header. The
example uses JP Local Pack's combined payroll summary, but the same
shape applies to every endpoint under /v1/{namespace}/... .

## 1. Unpaid request (curl -i)

    curl -i "https://api.kasanegi.com/v1/local/combined/payroll-summary?monthly_salary=300000&year_month=2026-05"

## 2. Expected response

    HTTP/1.1 402 Payment Required
    Content-Type: application/json
    Accept-Payment: x402
    X-Payment-Currency: USDC
    X-Payment-Network: eip155:8453
    X-Payment-Info: /.well-known/x402

    {
      "error": "Payment Required",
      "message": "This endpoint requires x402 payment.",
      "x402": {
        "accepts": [{
          "scheme": "exact",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "<receiving wallet from /.well-known/x402>",
          "maxAmountRequired": "<amount in USDC base units>",
          "resource": "/v1/local/combined/payroll-summary"
        }],
        "description": "Combined Japan payroll summary",
        "mimeType": "application/json"
      }
    }

The exact payTo / maxAmountRequired values come from the live
https://api.kasanegi.com/.well-known/x402 manifest. Do not hardcode them; read them from
the 402 envelope or the manifest.

## 3. What the 402 means

- This is the paywall handshake, not an error or a block.
- A standard x402 client signs an EIP-3009 USDC transferWithAuthorization
  for the requested amount and replays the request with the
  X-PAYMENT header. The broker verifies and settles via the Coinbase
  CDP facilitator, then returns the 200 JSON response.
- 402 is expected on every unpaid request to /v1/...; it is not a
  signal that the service is down.

## 4. Wallet-free alternative (no 402)

Every paid endpoint has a sibling preview path that returns the same
JSON shape with no signup, no wallet, and no payment header:

    curl -s "https://api.kasanegi.com/preview/v1/local/combined/payroll-summary?monthly_salary=300000&year_month=2026-05"

Use the preview path to evaluate data quality before paying. The
production /v1/... path is identical except for the 402 paywall
handshake and source-of-truth status (the preview path is explicit
about preview status in its response body).

## 5. Marketplace API-key alternative (card / platform credit)

Buyers who do not want to hold crypto can use the marketplace route
when their product has a public listing. Current state:
One public marketplace listing is live for all current products at https://rapidapi.com/kasanegi123/api/jp-local-pack-japan-payroll-invoice-tax-apis.

The marketplace forwards calls to the origin route after subscription.
End buyers should not call the marketplace origin route directly.

## 6. What this page does NOT show

This page never includes a real X-PAYMENT payload, a real signature, a
private key, a CDP API key, or any other secret. The signing material
must come from the buyer's own wallet / x402 client.

For the JSON form of this page see https://api.kasanegi.com/.well-known/x402 (machine-
readable manifest of all paid endpoints).