{
  "openapi": "3.1.0",
  "info": {
    "title": "Sui Address Inspector",
    "version": "1.0.0",
    "description": "Balances, objects, and stakes for any Sui mainnet address, paid per call in USDC."
  },
  "servers": [
    {
      "url": "https://sui-inspector-x402.vercel.app"
    }
  ],
  "paths": {
    "/inspect": {
      "post": {
        "operationId": "inspect",
        "summary": "Inspect any Sui mainnet address: coin balances with symbols and human units, owned-object profile, staking snapshot, SuiNS name, and the current epoch.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "suinsName": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "SuiNS name if one is set, otherwise null"
                    },
                    "suiBalance": {
                      "type": "string",
                      "description": "Total SUI in human units"
                    },
                    "balances": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "coinType": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "decimals": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "balance": {
                            "type": "string",
                            "description": "Raw base-unit balance"
                          },
                          "humanBalance": {
                            "type": "string",
                            "description": "Balance adjusted for decimals"
                          }
                        },
                        "required": [
                          "coinType",
                          "symbol",
                          "decimals",
                          "balance",
                          "humanBalance"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "objects": {
                      "type": "object",
                      "properties": {
                        "sampledCount": {
                          "type": "number",
                          "description": "Objects counted (first 50)"
                        },
                        "hasMore": {
                          "type": "boolean"
                        },
                        "stakedSuiObjects": {
                          "type": "number",
                          "description": "StakedSui objects in the sample"
                        },
                        "topTypes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "count"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "sampledCount",
                        "hasMore",
                        "stakedSuiObjects",
                        "topTypes"
                      ],
                      "additionalProperties": false
                    },
                    "inspectedAtEpoch": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "address",
                    "suinsName",
                    "suiBalance",
                    "balances",
                    "objects",
                    "inspectedAtEpoch"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Payment required — the body carries an x402 accepts[] envelope (scheme \"exact\", network sui). Sign it and retry with the X-PAYMENT header."
          },
          "422": {
            "description": "Invalid request body — never charged"
          }
        },
        "x-payment-info": {
          "pricingMode": "fixed",
          "price": "0.01",
          "currency": "USDC",
          "protocols": [
            "mpp",
            "x402"
          ],
          "x402": {
            "scheme": "exact",
            "network": "sui:mainnet",
            "asset": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
            "payTo": "0xd228592180633594752f32acd3a2ed612d2f4b61e9c9e86ddc4e1f676dbcbe4b"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Sui address to inspect (0x-prefixed, mainnet)"
                  }
                },
                "required": [
                  "address"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    }
  }
}