{
  "openapi": "3.1.0",
  "info": {
    "title": "JUJIX Agent Token Security API",
    "version": "1.1.4",
    "description": "Captcha-free read-only token security scanner for BNB Smart Chain (BSC) and Solana with Binance Agent ID (.ai) EIP-712 authentication and Streamable HTTP MCP support. Never send private keys or seed phrases."
  },
  "servers": [
    {
      "url": "https://jujix.ai",
      "description": "Production server"
    }
  ],
  "paths": {
    "/api/v1/agent/info": {
      "get": {
        "operationId": "getAgentServiceInfo",
        "summary": "Read service metadata, contract addresses, quota tiers, and hub status",
        "responses": {
          "200": {
            "description": "Service metadata JSON"
          }
        }
      }
    },
    "/api/v1/agent/quota": {
      "get": {
        "operationId": "getAgentQuota",
        "summary": "Query current daily free quota and reset timestamp (trial IP or Bearer agentToken)",
        "responses": {
          "200": {
            "description": "Quota status JSON"
          },
          "401": {
            "description": "Invalid or expired Bearer agentToken"
          }
        }
      }
    },
    "/api/v1/agent/quick-check": {
      "post": {
        "operationId": "runQuickTokenSecurityCheck",
        "summary": "Scan a BSC (0x...) or Solana (Base58) token contract address for honeypot, tax, authority, and liquidity risks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["ca"],
                "properties": {
                  "ca": {
                    "type": "string",
                    "description": "BSC 20-byte hex address (0x...) or Solana Base58 mint address"
                  },
                  "chain": {
                    "type": "string",
                    "enum": ["bsc", "solana"]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Structured security, market & read-only offenseRadar report (deployer, bundler, views, and 12h FOMO/Pump traderViews; offenseRadar is null on canonical base/stable assets and preserves honest null / live_partial / not_indexed / partial_lane_unavailable / upstream_unavailable / cache_empty states; recordedCount is post record count while distinctTraderCount and distinctHoldingTraderCount are unique trader counts with consensusHolding requiring distinctHoldingTraderCount >= 2; verified .ai sessions unlock full deployer addresses on locked deep cards — open disclosure deep cards like JUJI and unindexed tokens resolved from live on-chain security sources return full deployer addresses by default on trial — plus bundler breakdown, narrative protagonists, and up to 3 de-branded <=120-char traderViews.highlights which are third-party user-submitted raw commentary for technical reference only and not investment advice) with securitySource ('goplus' | 'birdeye' | 'cache' | 'solana_rpc' | 'canonical_base' | null; plus cachedSecuritySource 'goplus' | 'birdeye' when 'cache') and top10Source ('helius' | 'nodereal' | 'goplus' | 'cache' | null; plus cachedTop10Source, top10HolderCount, top10UpdatedAtAsia, TOP10_SOURCE_STALE when served from <=24h top-10 cache, Solana top10Scope 'top20_token_accounts' — Estimated from top 20 token accounts, and BSC partial top10Scope 'partial_holders' — 只拿到前 N 个地址 / Only top N addresses available). security.top10ExPoolPct measures top-10 addresses after excluding identified pools, vaults, and burn addresses (扣除已辨识池子、金库等地址后的前十个地址): on BSC, if GoPlus's 10-row list drops below 10 addresses after unified pool/vault exclusions (or omits holders), edge quick-check recomputes the entire top-10 from single-source soft-capped NodeReal 4-param nr_getTokenHolders (top-30) + totalSupply; if NodeReal fails or also yields fewer than 10 addresses, the response reports the N addresses obtained with top10Scope 'partial_holders', top10HolderCount N, flag TOP10_PARTIAL, scope clause 只拿到前 N 个地址 / Only top N addresses available, and riskLevel never LOW (minimum MEDIUM). BSC security checks fall back from GoPlus to live Birdeye, then <=24h KV security cache (true riskLevel + SECURITY_SOURCE_STALE + dataUpdatedAt, quota refunded), or UNKNOWN when unavailable/incomplete (quota refunded). Solana top-10 ex-pool share is resolved via soft-capped Helius 3-in-1 RPC. When security.top10ExPoolPct is null (e.g., Birdeye BSC omits top-10 holders and NodeReal is unavailable/capped, or GoPlus returns empty holders), security.flags includes TOP10_UNAVAILABLE and riskLevel is never LOW (minimum MEDIUM).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickCheckResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid address or blocked credential input"
          },
          "402": {
            "description": "Trial IP daily free checks exhausted (authenticate with Binance Agent ID to unlock 20-30/day)"
          },
          "429": {
            "description": "Authenticated daily free quota exhausted"
          }
        }
      }
    },
    "/api/v1/agent/auth/challenge": {
      "post": {
        "operationId": "createAgentAuthChallenge",
        "summary": "Issue a 10-minute EIP-712 AgentAuth challenge for a public EVM wallet address",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["wallet"],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "Public 20-byte EVM wallet address (0x...)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "EIP-712 typedData and nonce (jujix_nonce_<32hex>)"
          }
        }
      }
    },
    "/api/v1/agent/auth/verify": {
      "post": {
        "operationId": "verifyAgentAuthSignature",
        "summary": "Verify EIP-712 signature (65-byte 0x or baw 128-hex + signatureRecovery 00/01) and check Binance Agent ID (.ai) ownership",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["wallet", "nonce", "signature"],
                "properties": {
                  "wallet": { "type": "string" },
                  "nonce": { "type": "string" },
                  "signature": { "type": "string" },
                  "signatureRecovery": { "type": "string", "enum": ["00", "01"] }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "24-hour read-only Bearer agentToken and unlocked daily quota (20 or 30/day)"
          },
          "403": {
            "description": "Wallet does not hold a Binance Agent ID (.ai) NFT"
          }
        }
      }
    },
    "/api/v1/agent/mcp": {
      "post": {
        "operationId": "handleStreamableHttpMcp",
        "summary": "Streamable HTTP MCP JSON-RPC 2.0 endpoint (initialize, tools/list, tools/call)",
        "description": "Exposes two read-only MCP tools: jujix_quick_check (arguments: { ca, chain? }) and jujix_quota_status (arguments: {}). Unauthenticated requests use the 3/day per IP trial tier; to unlock 20-30/day with Binance Agent ID (.ai), authenticate via REST POST https://jujix.ai/api/v1/agent/auth/challenge and POST https://jujix.ai/api/v1/agent/auth/verify and pass the issued agentToken in the optional HTTP Authorization: Bearer jujix_ag_<48hex> header.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["jsonrpc", "method"],
                "properties": {
                  "jsonrpc": { "type": "string", "enum": ["2.0"] },
                  "id": { "type": ["string", "number", "null"] },
                  "method": { "type": "string", "description": "MCP JSON-RPC method (initialize, notifications/*, ping, tools/list, tools/call)" },
                  "params": { "type": "object" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC 2.0 response"
          },
          "202": {
            "description": "Accepted MCP notification (no response body)"
          },
          "400": {
            "description": "Invalid JSON-RPC 2.0 request (-32600)"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "QuickCheckResponse": {
        "type": "object",
        "required": ["ok", "chain", "ca", "token", "market", "security", "offenseRadar", "summaryZh", "summaryEn", "quota", "riskDisclaimer", "riskDisclaimerZh", "riskDisclaimerEn"],
        "properties": {
          "ok": { "type": "boolean" },
          "chain": { "type": "string", "enum": ["bsc", "solana"] },
          "ca": { "type": "string" },
          "isBaseAsset": { "type": "boolean" },
          "securitySource": {
            "type": ["string", "null"],
            "enum": ["goplus", "birdeye", "cache", "solana_rpc", "canonical_base", null]
          },
          "cachedSecuritySource": {
            "type": ["string", "null"],
            "enum": ["goplus", "birdeye", null]
          },
          "top10Source": {
            "type": ["string", "null"],
            "enum": ["helius", "nodereal", "goplus", "cache", null]
          },
          "cachedTop10Source": { "type": ["string", "null"] },
          "top10Scope": {
            "type": ["string", "null"],
            "enum": ["top20_token_accounts", "partial_holders", null]
          },
          "top10HolderCount": { "type": ["integer", "null"] },
          "top10UpdatedAtEpochSec": { "type": ["integer", "null"] },
          "top10UpdatedAt": { "type": ["string", "null"] },
          "top10UpdatedAtAsia": { "type": ["string", "null"] },
          "token": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "symbol": { "type": "string" }
            }
          },
          "market": {
            "type": "object",
            "properties": {
              "priceUsd": { "type": ["number", "null"] },
              "marketCapUsd": { "type": ["number", "null"] },
              "liquidityUsd": { "type": ["number", "null"] },
              "volume24hUsd": { "type": ["number", "null"] },
              "pairAddress": { "type": ["string", "null"] }
            }
          },
          "security": { "type": "object" },
          "cachedDeepCard": { "type": ["object", "null"] },
          "offenseRadar": {
            "oneOf": [
              { "$ref": "#/components/schemas/OffenseRadar" },
              { "type": "null" }
            ],
            "description": "Read-only four-pillar offense radar; strictly null on canonical base/stable assets (WBNB, USDT, USDC, BUSD, SOL)."
          },
          "summaryZh": { "type": "string" },
          "summaryEn": { "type": "string" },
          "quota": { "type": "object" },
          "riskDisclaimer": { "type": "string" },
          "riskDisclaimerZh": { "type": "string" },
          "riskDisclaimerEn": { "type": "string" }
        }
      },
      "OffenseRadar": {
        "type": "object",
        "required": ["version", "tierAccess", "coverageStatus", "cardUpdatedAtEpochSec", "cardUpdatedAtAsia", "deployer", "bundler", "views", "traderViews"],
        "properties": {
          "version": { "type": "string", "const": "v1" },
          "tierAccess": { "type": "string", "enum": ["trial", "agent_id"] },
          "coverageStatus": {
            "type": "string",
            "enum": ["full", "partial", "unindexed"],
            "description": "full when deployer, bundler, and views are all indexed; partial when at least one pillar is indexed or traderViews has hits (ok / ok_partial); unindexed otherwise."
          },
          "cardUpdatedAtEpochSec": { "type": ["integer", "null"] },
          "cardUpdatedAtAsia": { "type": ["string", "null"], "description": "MM-DD HH:MM Asia time" },
          "deployer": { "$ref": "#/components/schemas/OffenseDeployer" },
          "bundler": { "$ref": "#/components/schemas/OffenseBundler" },
          "views": { "$ref": "#/components/schemas/OffenseViews" },
          "traderViews": { "$ref": "#/components/schemas/OffenseTraderViews" }
        }
      },
      "OffenseDeployer": {
        "type": "object",
        "required": ["status", "address", "isFactory", "createdCount", "graduatedCount", "graduatedPct", "prevRugged", "honeypotSameCreatorCount", "creatorHoldingPct"],
        "properties": {
          "status": {
            "type": "string",
            "enum": ["indexed", "live_partial", "not_indexed"],
            "description": "indexed when deep card provides deployer history; live_partial (most common on unindexed new tokens) when live on-chain security provides creator address/honeypot count/holding pct without deep-card history; not_indexed when all fields are null."
          },
          "address": {
            "type": ["string", "null"],
            "description": "Masked as 6+...+4 on trial ONLY for locked AI deep cards; full address returned on verified .ai (agent_id), open disclosure deep cards (e.g., JUJI), and unindexed live_partial on-chain reads."
          },
          "isFactory": { "type": ["boolean", "null"] },
          "createdCount": { "type": ["integer", "null"] },
          "graduatedCount": { "type": ["integer", "null"] },
          "graduatedPct": { "type": ["number", "null"] },
          "prevRugged": { "type": ["boolean", "null"] },
          "honeypotSameCreatorCount": { "type": ["integer", "null"] },
          "creatorHoldingPct": { "type": ["number", "null"] },
          "tokenStatus": {
            "type": ["string", "null"],
            "enum": ["creator_close", "holding", "burned", "locked", null],
            "description": "Included on verified .ai (agent_id) requests when an indexed deep card exists."
          }
        }
      },
      "OffenseBundler": {
        "type": "object",
        "required": ["status", "bundlerPct", "initialBundlerPct", "walletsCount", "sameFunderPct", "sameFunderWalletsCount", "isInsiderCabal"],
        "properties": {
          "status": { "type": "string", "enum": ["indexed", "not_indexed"] },
          "bundlerPct": { "type": ["number", "null"] },
          "initialBundlerPct": { "type": ["number", "null"] },
          "walletsCount": { "type": ["integer", "null"] },
          "sameFunderPct": { "type": ["number", "null"] },
          "sameFunderWalletsCount": { "type": ["integer", "null"] },
          "isInsiderCabal": { "type": ["boolean", "null"] },
          "soldPct": { "type": ["number", "null"], "description": "Verified .ai only (when indexed)" },
          "directSoldPct": { "type": ["number", "null"], "description": "Verified .ai only (when indexed)" },
          "sameBlockPct": { "type": ["number", "null"], "description": "Verified .ai only (when indexed)" },
          "sameBlockWalletsCount": { "type": ["integer", "null"], "description": "Verified .ai only (when indexed)" },
          "tagHoldPct": { "type": ["number", "null"], "description": "Verified .ai only (when indexed)" },
          "washTradeWalletsCount": { "type": ["integer", "null"], "description": "Verified .ai only (when indexed)" }
        }
      },
      "OffenseViews": {
        "type": "object",
        "required": ["status", "stamp", "stampCode", "officialStatus", "sourcesCount", "mentionsCount", "latestViewAtAsia"],
        "properties": {
          "status": { "type": "string", "enum": ["indexed", "not_indexed"] },
          "stamp": {
            "type": ["string", "null"],
            "enum": ["官方认过", "借名蹭热度", "有实绩支撑", "冒充造假", "关系未验", null]
          },
          "stampCode": {
            "type": ["string", "null"],
            "enum": ["OFFICIAL", "HYPE_RIDER", "PROVEN_TRACK", "FAKE", "UNVERIFIED", null]
          },
          "officialStatus": {
            "type": ["string", "null"],
            "enum": ["official", "self_unverified", "mentioned", "unrelated", "unknown", null]
          },
          "sourcesCount": { "type": ["integer", "null"] },
          "mentionsCount": { "type": ["integer", "null"] },
          "latestViewAtAsia": { "type": ["string", "null"], "description": "MM-DD HH:MM Asia time" },
          "protagonists": {
            "type": "array",
            "items": { "type": "string" },
            "description": "Verified .ai only (when indexed deep card exists)"
          },
          "launchAfterTweetSec": { "type": ["integer", "null"], "description": "Verified .ai only" },
          "smartOrKolHolderCount": { "type": ["integer", "null"], "description": "Verified .ai only" },
          "smartOrKolHoldingPct": { "type": ["number", "null"], "description": "Verified .ai only" }
        }
      },
      "OffenseTraderViews": {
        "type": "object",
        "required": [
          "status",
          "pumpSyncedInWindow",
          "fomoSyncedInWindow",
          "recordedCount",
          "distinctTraderCount",
          "distinctHoldingTraderCount",
          "fomoCount",
          "pumpCount",
          "holdingCount",
          "exitedCount",
          "unavailableStatusCount",
          "consensusHolding",
          "allExitedWarning",
          "singleHoldingValueUsd",
          "singleCostBasisUsd",
          "fastPumpSyncedAtEpochSec",
          "fastPumpSyncedAtAsia",
          "slowFomoSyncedAtEpochSec",
          "slowFomoSyncedAtAsia"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": ["ok", "ok_partial", "no_recorded_views", "partial_lane_unavailable", "upstream_unavailable", "cache_empty"],
            "description": "ok: both lanes synced within 12h with hits; ok_partial: one lane synced within 12h with hits, other lane unsynced/stale (unsynced lane count is null); no_recorded_views: both lanes synced within 12h with 0 hits; partial_lane_unavailable: one lane synced within 12h with 0 hits, other lane unsynced/stale (unsynced lane count and aggregate counts/booleans are null); upstream_unavailable: neither lane synced within 12h (all counts/booleans null); cache_empty: lane rows absent (all counts/booleans null)."
          },
          "pumpSyncedInWindow": { "type": "boolean", "description": "True iff fast_pump lane has valid ok_at_sec within the rolling 12h window." },
          "fomoSyncedInWindow": { "type": "boolean", "description": "True iff slow_fomo lane has valid ok_at_sec within the rolling 12h window." },
          "recordedCount": { "type": ["integer", "null"], "description": "Number of substantive post records in synced lanes (post count, NOT unique people count). Null when no hits and at least one lane is unsynced." },
          "distinctTraderCount": { "type": ["integer", "null"], "description": "Deduplicated count of unique traders across substantive post records." },
          "distinctHoldingTraderCount": { "type": ["integer", "null"], "description": "Deduplicated count of unique traders whose latest known state in the 12h window is holding." },
          "fomoCount": { "type": ["integer", "null"], "description": "Substantive FOMO post count; strictly null when fomoSyncedInWindow is false." },
          "pumpCount": { "type": ["integer", "null"], "description": "Substantive pump.fun post count; strictly null when pumpSyncedInWindow is false." },
          "holdingCount": { "type": ["integer", "null"] },
          "exitedCount": { "type": ["integer", "null"] },
          "unavailableStatusCount": { "type": ["integer", "null"] },
          "consensusHolding": { "type": ["boolean", "null"], "description": "True iff distinctHoldingTraderCount >= 2 (same trader posting multiple holding notes is false; null if one lane is unsynced and <2 holding traders are observed)." },
          "allExitedWarning": { "type": ["boolean", "null"] },
          "singleHoldingValueUsd": { "type": ["number", "null"] },
          "singleCostBasisUsd": { "type": ["number", "null"] },
          "fastPumpSyncedAtEpochSec": { "type": ["integer", "null"] },
          "fastPumpSyncedAtAsia": { "type": ["string", "null"] },
          "slowFomoSyncedAtEpochSec": { "type": ["integer", "null"] },
          "slowFomoSyncedAtAsia": { "type": ["string", "null"] },
          "highlights": {
            "type": "array",
            "maxItems": 3,
            "items": { "$ref": "#/components/schemas/OffenseTraderHighlight" },
            "description": "Included on verified .ai (agent_id) requests only; omitted on anonymous trial. Excerpts are third-party user-submitted raw commentary (de-branded) for technical reference only and do not constitute investment advice."
          }
        }
      },
      "OffenseTraderHighlight": {
        "type": "object",
        "required": ["source", "positionState", "postedAtAsia", "excerpt"],
        "properties": {
          "source": { "type": "string", "enum": ["fomo", "pump"] },
          "positionState": { "type": "string", "enum": ["holding", "exited", "unavailable"] },
          "postedAtAsia": { "type": ["string", "null"], "description": "MM-DD HH:MM Asia time" },
          "excerpt": {
            "type": "string",
            "maxLength": 120,
            "description": "De-branded <=120-char excerpt of third-party user-submitted commentary (informational/technical reference only, not investment advice)."
          }
        }
      }
    }
  }
}
