{
  "openapi": "3.1.0",
  "info": {
    "title": "Glacier21 API",
    "version": "1.0.0",
    "summary": "Off-chain wallet intelligence for fraud, compliance, and investigations.",
    "description": "Programmatic access to Glacier21's wallet attribution, identity, and risk signals.\nAuthenticated with JWT Bearer tokens issued by https://app-api.glacier21.com/auth/login.",
    "contact": {
      "name": "Glacier21 Support",
      "email": "ren@glacier21.com",
      "url": "https://glacier21.com"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://glacier21.com/legal/terms"
    }
  },
  "servers": [
    {
      "url": "https://app-api.glacier21.com",
      "description": "Production"
    },
    {
      "url": "http://localhost:8000",
      "description": "Local development"
    }
  ],
  "paths": {
    "/auth/register": {
      "post": {
        "operationId": "register_account",
        "summary": "Register a new Glacier21 account",
        "description": "Self-serve signup for autonomous agents. Creates a brand-new account with the supplied email and password. Returns `{access_token, token_type}` — extract `access_token` and pass it as `Authorization: Bearer <token>` on every subsequent authenticated tool call. The token is valid for 24 hours. IMPORTANT: the trial 10 wallet lookups unlock only after the email is verified. Verify by hitting `POST /auth/verify` with the `token` from the welcome email; agents that can't read email should hand off to the human at this step.",
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "operationId": "login",
        "summary": "Sign in and get a Bearer token",
        "description": "Exchange an email and password for a 24-hour Bearer JWT. Returns `{access_token, token_type}`. Pass `access_token` in the `Authorization: Bearer <token>` header on every authenticated tool call.",
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/auth/verify": {
      "post": {
        "operationId": "verify_email",
        "summary": "Verify the account's email with a token",
        "description": "Confirm the email address on a freshly-registered account using the verification token from the welcome email. Required before wallet search and AWS-backed API key issuance unlock. Body: `{token}`.",
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "logout",
        "summary": "Discard the current Bearer token",
        "description": "Acknowledges that the agent will drop the bearer token on its end. JWTs are stateless, so there's no server session to delete; this exists so the OAuth `revocation_endpoint` advertised in `/.well-known/oauth-authorization-server` resolves to a real URL.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid Bearer token."
          }
        }
      }
    },
    "/wallet/search": {
      "post": {
        "operationId": "search_wallet",
        "summary": "Search a wallet address",
        "description": "Look up identity, social handles, owned assets, sanctions exposure, and other off-chain signals for any blockchain wallet address.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid Bearer token."
          }
        },
        "x-payment-info": {
          "intent": "charge",
          "method": [
            "tempo",
            "stripe",
            "x402"
          ],
          "amount": 0.05,
          "currency": "USD"
        },
        "x-x402-payment": {
          "endpoint": "https://dashboard.glacier21.com/api/x402/subscribe",
          "network": [
            "base",
            "ethereum"
          ],
          "accepts": [
            "USDC"
          ],
          "amount": 0.05
        }
      }
    },
    "/usage/stats": {
      "get": {
        "operationId": "get_usage_stats",
        "summary": "Get current usage and quota",
        "description": "Returns requests made this period, monthly limit (including referral bonuses), and billing-period dates.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid Bearer token."
          }
        }
      }
    },
    "/api-keys/": {
      "get": {
        "operationId": "list_api_keys",
        "summary": "List API keys",
        "description": "Return every API key on the account with active/revoked status and usage timestamps.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid Bearer token."
          }
        }
      },
      "post": {
        "operationId": "create_api_key",
        "summary": "Create an API key",
        "description": "Mint a new AWS-API-Gateway-backed key. The full key value is returned exactly once.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid Bearer token."
          }
        }
      }
    },
    "/api-keys/{id}": {
      "delete": {
        "operationId": "revoke_api_key",
        "summary": "Revoke an API key",
        "description": "Disable an API key in AWS API Gateway and mark it inactive on the account.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid Bearer token."
          }
        }
      }
    },
    "/plans": {
      "get": {
        "operationId": "list_plans",
        "summary": "List subscription plans",
        "description": "Returns the public catalog of plans (Free, Frost, Iceberg, Avalanche) with pricing and request quotas.",
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/billing/create-checkout-session": {
      "post": {
        "operationId": "subscribe_to_plan",
        "summary": "Subscribe to a paid plan",
        "description": "Creates a Stripe Checkout session for the chosen plan and returns a hosted checkout URL the agent can complete with a card-on-file or x402 / MPP payment. Self-serve tiers: Frost ($499/mo, 10K lookups/mo) and Iceberg ($2,499/mo, 300K lookups/mo). Avalanche is enterprise-only; call list_plans for the contact path.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid Bearer token."
          }
        },
        "x-payment-info": {
          "intent": "session",
          "method": [
            "tempo",
            "stripe",
            "x402"
          ],
          "amount": 499,
          "currency": "USD",
          "interval": "month"
        },
        "x-x402-payment": {
          "endpoint": "https://dashboard.glacier21.com/api/x402/subscribe",
          "network": [
            "base",
            "ethereum"
          ],
          "accepts": [
            "USDC"
          ],
          "amount": 499
        }
      }
    },
    "/billing/subscription": {
      "get": {
        "operationId": "get_subscription",
        "summary": "Get current subscription",
        "description": "Returns the active Stripe subscription, plan tier, status, and renewal date.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid Bearer token."
          }
        }
      }
    },
    "/billing/cancel": {
      "post": {
        "operationId": "cancel_subscription",
        "summary": "Cancel subscription",
        "description": "Cancels the subscription at period end. Access remains until the current period closes.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid Bearer token."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT obtained from POST /auth/login (issuer: https://app-api.glacier21.com). Include as Authorization: Bearer <token>."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "AWS-API-Gateway-issued key for direct API consumption. Mint via POST /api-keys/."
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-mpp": {
    "version": "1.0",
    "payment_methods": [
      "stripe",
      "x402"
    ],
    "currency": "USD"
  },
  "x-scopes": [
    {
      "name": "read:account",
      "description": "Read profile, plan, and verification status."
    },
    {
      "name": "read:usage",
      "description": "Read usage stats, history, and daily breakdowns."
    },
    {
      "name": "write:keys",
      "description": "Create, revoke, reactivate, and delete API keys."
    },
    {
      "name": "search:wallet",
      "description": "Run wallet searches against the on-platform endpoint."
    },
    {
      "name": "write:billing",
      "description": "Create checkout sessions, manage subscription, cancel."
    },
    {
      "name": "read:referrals",
      "description": "Read referral code, stats, and referred-user list."
    }
  ],
  "x-discovery": {
    "api_catalog": "https://dashboard.glacier21.com/.well-known/api-catalog",
    "oauth_authorization_server": "https://dashboard.glacier21.com/.well-known/oauth-authorization-server",
    "mcp_server_card": "https://dashboard.glacier21.com/.well-known/mcp/server-card.json",
    "agent_skills": "https://dashboard.glacier21.com/.well-known/agent-skills/index.json",
    "acp": "https://dashboard.glacier21.com/.well-known/acp.json",
    "llms_txt": "https://dashboard.glacier21.com/llms.txt"
  }
}