{
  "protocolVersion": "0.3.0",
  "name": "CAI",
  "description": "CAI.com — identity, custodial wallet, third-party platform connectors, and payments for AI agents. Primary integration: HTTPS Edge API + optional MCP (@cailab/mcp). See skill.md for policies, scopes, and gap_id honesty.",
  "url": "https://cai.com",
  "version": "1.0.19",
  "preferredTransport": "HTTP+JSON",
  "defaultInputModes": [
    "text/plain"
  ],
  "defaultOutputModes": [
    "text/plain"
  ],
  "capabilities": {
    "extensions": [],
    "streaming": false,
    "pushNotifications": false,
    "stateTransitionHistory": false
  },
  "securitySchemes": {
    "bearerAuth": {
      "type": "http",
      "scheme": "bearer",
      "description": "CAI User API key or OAuth access token sent as Authorization: Bearer to https://api.cai.com/functions/v1/*"
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "metadata": {
    "skill_version": "1.0.19",
    "agent_card_url": "https://cai.com/.well-known/agent.json",
    "skill_url": "https://cai.com/skill.md",
    "developers_url": "https://cai.com/developers.html",
    "tools_manifest_url": "https://cai.com/specs/cai-tools.manifest.json",
    "capabilities_url": "https://cai.com/capabilities.html",
    "llms_txt_url": "https://cai.com/llms.txt",
    "openapi_index_url": "https://cai.com/openapi.json",
    "sitemap_url": "https://cai.com/sitemap.xml",
    "mcp_package": "@cailab/mcp",
    "mcp_repository_path": "packages/cai-mcp",
    "gap_registry": "https://cai.com/capabilities.html",
    "partial_live_upgrade_cards_url": "https://cai.com/specs/partial-live-upgrade-cards.json",
    "documentation": [
      "https://cai.com/skill.md",
      "https://cai.com/.well-known/agent.json",
      "https://cai.com/specs/cai-tools.manifest.json",
      "https://cai.com/specs/openapi-3.1.json",
      "https://cai.com/openapi.json",
      "https://cai.com/developers.html",
      "https://cai.com/llms.txt"
    ],
    "api_key_auth": "CAI User API key (cai_...) or OAuth access token as Authorization: Bearer on https://api.cai.com/functions/v1/*",
    "skill_md_authoritative": true,
    "well_known_skill_md_url": "https://cai.com/.well-known/skill.md"
  },
  "skills": [
    {
      "id": "cai-identity-registration",
      "name": "CAI identity and registration",
      "description": "Register @cai.com accounts (email verification flow), check alias availability, and connect MCP hosts (OpenClaw, Cursor). Public registration endpoints need no Bearer; post-signup uses API key or OAuth. Does not read third-party site mailboxes for API-key-only agents.",
      "tags": [
        "identity",
        "registration",
        "signup",
        "cai.com",
        "openclaw",
        "mcp",
        "註冊",
        "信箱"
      ],
      "examples": [
        "Help me register a @cai.com address",
        "How do I connect OpenClaw to my CAI account?",
        "Check if my desired @cai.com address is available"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-hosted-login",
      "name": "Hosted login to cai.com",
      "description": "Mint one-time hosted login URLs via POST /create-hosted-action with action_type login. Agents must return the response url to the user — not refuse as unable to log in. API base is https://api.cai.com/functions/v1, not cai.com root.",
      "tags": [
        "login",
        "sign-in",
        "hosted-action",
        "cai.com",
        "登入",
        "登錄"
      ],
      "examples": [
        "Please help me log in to my cai.com account",
        "Generate a login link for my CAI account",
        "I need to sign in to cai.com"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-wallet-balances",
      "name": "Custodial wallet addresses and balances",
      "description": "List custodial deposit addresses and multi-chain token balances for the authenticated user. Pure balance questions must not route to platform registration tools.",
      "tags": [
        "wallet",
        "balance",
        "address",
        "custodial",
        "餘額",
        "錢包"
      ],
      "examples": [
        "What is my account balance?",
        "Show my ETH balance",
        "What is my ETH wallet address?"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-agent-payment-workflow",
      "name": "Check CAI First — agent payment execution",
      "description": "When an external agent (OpenClaw, Hermes, Codex, etc.) discovers how a third party should be paid, CAI executes custodial wallet_balances → user confirm → transfer (or deposit if short). External agent discovers payee; CAI does not auto-bill arbitrary sites. Requires pay or full API key scope for transfer.",
      "tags": [
        "payment",
        "agent",
        "openclaw",
        "hermes",
        "codex",
        "check-cai-first",
        "wallet",
        "transfer",
        "agent-wallet",
        "付款",
        "代理"
      ],
      "examples": [
        "My OpenClaw agent found how OpenRouter wants to be paid. Use my CAI wallet to pay after I confirm.",
        "My agent found OpenRouter's payment address. Use my CAI wallet to send 50 USDC on Polygon after I confirm.",
        "Check my CAI balance first, then pay the seller after I say yes"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-wallet-transfer-swap",
      "name": "Transfers and token exchange",
      "description": "Custodial transfers to addresses or @cai.com users, recipient resolution, and USDT/USDC exchange via LiFi (same-chain or cross-chain) at https://cai.com/exchange using token_bridge_quote/execute — not token_exchange (503). Requires pay-scoped API key or OAuth. Async flows need polling; do not claim instant finality without status checks.",
      "tags": [
        "transfer",
        "send",
        "swap",
        "exchange",
        "payment",
        "轉帳",
        "兌換"
      ],
      "examples": [
        "Send 50 USDT to 0x1234...abcd on Ethereum",
        "Exchange 100 USDT to USDC on Ethereum",
        "Send 20 DAI to a @cai.com address on Arbitrum"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-wallet-activity-status",
      "name": "Activity history and transfer status",
      "description": "Unified custodial activity via GET /wallet-activity-list before suggesting block explorers. Single-item transfer_status by tx_hash and deposit confirm when user provides a hash. Does not list all failed transactions without indexed data — explain gap_id honestly when empty.",
      "tags": [
        "transactions",
        "history",
        "activity",
        "status",
        "tx-hash",
        "交易",
        "紀錄"
      ],
      "examples": [
        "Show my last 10 transactions",
        "Show my transaction history on Ethereum",
        "I sent USDT to my CAI wallet — do you see it pending on-chain?"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-deposit-onramp-bridge",
      "name": "Deposits, on-ramp, and bridges",
      "description": "Card/fiat on-ramp URLs, USDT/USDC exchange (https://cai.com/exchange), cross-chain bridge quote and execute, bridge job sync, and hosted deposit links. Some paths are partial_live per gap_id in skill.md — poll job status; do not fabricate completion.",
      "tags": [
        "deposit",
        "onramp",
        "bridge",
        "exchange",
        "moonpay",
        "lifi",
        "入金",
        "兌換"
      ],
      "examples": [
        "Deposit $500 to my CAI account with a credit card",
        "Exchange USDT to USDC on Polygon",
        "Bridge 200 USDT from BNB Smart Chain to Polygon",
        "The bridge from Ethereum to BSC is done — I already received the funds"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-platform-connect",
      "name": "Third-party platform connect and register",
      "description": "Discovery via platforms_supported_list, programmatic one-click register when catalog supports it (F-16), and platform profile/balance via connectors. Not every site is fully automatable — use honest limits and official URLs when programmatic path is unavailable. Arbitrary URL catalog admin tools are not end-user APIs.",
      "tags": [
        "platform",
        "polymarket",
        "one-click",
        "register",
        "connector",
        "一鍵註冊",
        "平台"
      ],
      "examples": [
        "What platforms can I link with one click?",
        "Help me register on Polymarket with one click",
        "Show my balance on the Polymarket account I linked"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-defi-platform-automation",
      "name": "DeFi E-mode — perp trio agent trading",
      "description": "Hosted enrollment (platform_automation_enroll + user /act on cai.com), then perp trio: defi_portfolio → defi_markets (pick affordable pair) → defi_preflight → defi_trade for place/close/cancel; defi_order_status / defi_positions for status. Balances expose available_for_new_trade_usd and margin_locked_usd. Perp: gtrade (ARB/Polygon), ostium, hyperliquid. Polymarket: polymarket_place_order. Legacy per-platform tools deprecated. Requires platform or full API key scope. partial_live per gap_id.",
      "tags": [
        "defi",
        "polymarket",
        "gtrade",
        "ostium",
        "hyperliquid",
        "perps",
        "automation",
        "e-mode",
        "defi_markets",
        "defi_preflight",
        "defi_trade",
        "defi_portfolio",
        "平台",
        "交易"
      ],
      "examples": [
        "Enable my agent to trade on Polymarket with my CAI wallet",
        "Place a small gTrade long on an affordable market using defi_markets, defi_preflight, and defi_trade after I enrolled",
        "Check my open DeFi orders on Hyperliquid after my last trade",
        "Show my CAI DeFi portfolio and which platforms are ready to trade"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-vault-credentials",
      "name": "Platform and site credential vault",
      "description": "List, save, and revoke encrypted platform or site credentials server-side. Never echo vault payloads or secrets in chat. Listing shows metadata only.",
      "tags": [
        "vault",
        "credentials",
        "unlink",
        "platform",
        "site",
        "憑證"
      ],
      "examples": [
        "Show me a list of my linked external platforms without exposing any API keys or secrets",
        "Unlink my connected AI platform account"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-mail-otp",
      "name": "CAI mail and registration OTP",
      "description": "Read @cai.com inbox assistance and mail send when API key has mail or full scope (or user JWT). Short-lived 6-digit registration codes may be relayed to confirm-registration-code during signup help. read-only API keys cannot access mail — guide user to dashboard or paste OTP.",
      "tags": [
        "mail",
        "otp",
        "email",
        "verification",
        "cai.com",
        "信箱"
      ],
      "examples": [
        "What is my @cai.com email address?",
        "How do I sign up for @cai.com with email verification?"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-x402-agent-payment",
      "name": "x402 payer — HTTP 402 machine payments",
      "description": "When an agent hits HTTP 402 or a paid API resource, use x402_payment_prepare then x402_payment_execute from CAI custodial wallet. Active payment mandate may skip per-payment chat confirm. Honor GAP_X402_V1 partial_live.",
      "tags": [
        "x402",
        "402",
        "payment",
        "agent",
        "api",
        "micropayment",
        "machine-payment",
        "付款"
      ],
      "examples": [
        "My agent got HTTP 402 from this API — pay with my CAI wallet and retry",
        "Prepare an x402 payment for 0.10 USDC on Base to the address in the 402 challenge"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    },
    {
      "id": "cai-payment-mandates",
      "name": "AP2-like payment mandates",
      "description": "Create delegated spending limits (merchant domain, max per payment, daily cap, TTL) so agents can pay x402 APIs without confirming every time. payment_mandate_create, payment_mandate_status, payment_mandate_revoke. GAP_PAYMENT_MANDATE_V1 partial_live.",
      "tags": [
        "mandate",
        "ap2",
        "delegation",
        "agent",
        "spending-limit",
        "委派",
        "授權"
      ],
      "examples": [
        "Let my OpenClaw agent pay up to $5 per day to api.example.com from my CAI wallet",
        "Show my active payment mandates and revoke the old one"
      ],
      "security": [
        {
          "bearerAuth": []
        }
      ]
    }
  ],
  "supportedInterfaces": [
    {
      "url": "https://api.cai.com/functions/v1",
      "protocolBinding": "HTTP+JSON",
      "protocolVersion": "1.0.0",
      "description": "REST Edge Functions (Supabase); full tool contract in skill.md — not an A2A JSON-RPC task endpoint."
    }
  ]
}
