{
  "openapi": "3.0.3",
  "info": {
    "title": "CrystoSIX Agent APIs: Base Token Guard and Domain Security Telemetry",
    "version": "1.0.0",
    "description": "Liquidity screen, buy and sell honeypot simulation, and ready-to-sign USDC swap calldata for Base ERC-20 tokens. Automated screen, not financial advice. Human view: https://crystosi.com/oracle/"
  },
  "servers": [
    {
      "url": "https://crystosi.com"
    }
  ],
  "paths": {
    "/api/v1/guard/preview": {
      "get": {
        "operationId": "guardPreview",
        "summary": "Free preview: verdict, reasons, liquidity depth, honeypot result (30 per hour)",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "description": "Base ERC-20 contract address"
          }
        ],
        "responses": {
          "200": {
            "description": "Preview report"
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Hourly preview limit reached"
          }
        }
      }
    },
    "/api/v1/web3/route": {
      "get": {
        "operationId": "web3Route",
        "summary": "Full token report with swap calldata, paid per call over x402 (USDC on Base). Same as /api/v1/guard",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "description": "Base ERC-20 contract address"
          },
          {
            "name": "amountUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100000,
              "default": 100
            },
            "description": "Swap size in USD (USDC in)"
          },
          {
            "name": "wallet",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "description": "Sender address. Required to receive swap calldata"
          }
        ],
        "responses": {
          "200": {
            "description": "Guard report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "402": {
            "description": "Payment required: x402 payment requirements in the body. Retry with an X-PAYMENT header"
          }
        }
      }
    },
    "/api/v1/telemetry/domain-audit": {
      "get": {
        "operationId": "domainAudit",
        "summary": "Domain email and security audit: SPF (with lookup count), DMARC, DKIM, MX provider, MTA-STS, TLS-RPT, BIMI, bulk-sender readiness, HTTP security headers, CAA, DNSSEC, with grades. Paid per call over x402",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Public hostname, like example.com"
          },
          {
            "name": "dkim",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated DKIM selectors to check in addition to the common ones"
          }
        ],
        "responses": {
          "200": {
            "description": "Audit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainAudit"
                }
              }
            }
          },
          "400": {
            "description": "Invalid domain"
          },
          "402": {
            "description": "Payment required (x402)"
          }
        }
      }
    },
    "/api/v1/syndicate/domain-audit": {
      "get": {
        "operationId": "domainAuditSyndicate",
        "summary": "Same domain email and security audit for marketplace proxies",
        "security": [
          {
            "syndicateKey": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dkim",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainAudit"
                }
              }
            }
          },
          "400": {
            "description": "Invalid domain; not charged"
          },
          "401": {
            "description": "Missing or wrong X-Syndicate-Key"
          }
        }
      }
    },
    "/api/v1/guard": {
      "get": {
        "operationId": "guardPaid",
        "summary": "Full report with swap calldata, paid per call over x402 (USDC on Base)",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "description": "Base ERC-20 contract address"
          },
          {
            "name": "amountUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100000,
              "default": 100
            },
            "description": "Swap size in USD (USDC in)"
          },
          {
            "name": "wallet",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "description": "Sender address. Required to receive swap calldata"
          }
        ],
        "responses": {
          "200": {
            "description": "Guard report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "402": {
            "description": "Payment required: x402 payment requirements in the body. Retry with an X-PAYMENT header"
          }
        }
      }
    },
    "/api/v1/syndicate/guard": {
      "get": {
        "operationId": "guardSyndicate",
        "summary": "Full report with swap calldata for marketplace proxies",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "description": "Base ERC-20 contract address"
          },
          {
            "name": "amountUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100000,
              "default": 100
            },
            "description": "Swap size in USD (USDC in)"
          },
          {
            "name": "wallet",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "description": "Sender address. Required to receive swap calldata"
          }
        ],
        "security": [
          {
            "syndicateKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Guard report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or wrong X-Syndicate-Key"
          }
        }
      }
    },
    "/api/v1/garden/harvest": {
      "get": {
        "operationId": "gardenHarvest",
        "summary": "Full Base Token Garden in one call: every trending (and recently trending) Base token with verdict, reasons, liquidity, honeypot and taxes, verdict history and changes since the last screen. Paid per call over x402 (USDC on Base)",
        "parameters": [
          {
            "name": "changed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only tokens whose verdict, liquidity (25%+) or taxes changed since the previous screen"
          },
          {
            "name": "verdict",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pass",
                "caution",
                "avoid"
              ]
            }
          },
          {
            "name": "trending",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only tokens trending now"
          }
        ],
        "responses": {
          "200": {
            "description": "Harvest"
          },
          "402": {
            "description": "Payment required (x402)"
          },
          "503": {
            "description": "Garden is stale; not charged"
          }
        }
      }
    },
    "/api/v1/execution/quote": {
      "get": {
        "operationId": "executionQuote",
        "summary": "Coinbase execution-cost quote: average fill, slippage, fee and all-in cost for market orders of up to 5 sizes, from the live order book. Paid per call over x402 (USDC on Base)",
        "parameters": [
          {
            "name": "product",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z0-9]{2,12}-[A-Z0-9]{2,12}$"
            },
            "description": "Coinbase product id, like BTC-USD"
          },
          {
            "name": "side",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "buy",
                "sell"
              ],
              "default": "buy"
            }
          },
          {
            "name": "usd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Up to 5 quote-currency sizes, comma-separated, like 1000,25000,250000"
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Or up to 5 base sizes, like 0.5,2"
          },
          {
            "name": "feeBps",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 500,
              "default": 60
            },
            "description": "Your taker fee in bps"
          }
        ],
        "responses": {
          "200": {
            "description": "Quote"
          },
          "400": {
            "description": "Invalid input"
          },
          "402": {
            "description": "Payment required (x402)"
          },
          "503": {
            "description": "Coinbase data unavailable; not charged"
          }
        }
      }
    },
    "/api/v1/execution/preview": {
      "get": {
        "operationId": "executionPreview",
        "summary": "Free one-size preview of the execution-cost quote (30 per hour)",
        "responses": {
          "200": {
            "description": "Preview"
          },
          "429": {
            "description": "Hourly limit reached"
          }
        }
      }
    },
    "/api/pollen/garden": {
      "get": {
        "operationId": "gardenSummary",
        "summary": "Free garden summary: trending Base tokens with verdict and depth, refreshed every 30 minutes",
        "responses": {
          "200": {
            "description": "Summary"
          }
        }
      }
    },
    "/api/v1/guard/status": {
      "get": {
        "operationId": "guardStatus",
        "summary": "Which lanes are open, prices and fee settings",
        "responses": {
          "200": {
            "description": "Lane status"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "syndicateKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Syndicate-Key"
      }
    },
    "schemas": {
      "DomainAudit": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "grade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D",
              "F"
            ],
            "description": "Overall: average of the web and email scores"
          },
          "score": {
            "type": "integer"
          },
          "latencyMs": {
            "type": "integer",
            "nullable": true
          },
          "web": {
            "type": "object",
            "properties": {
              "grade": {
                "type": "string"
              },
              "score": {
                "type": "integer"
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "email": {
            "type": "object",
            "properties": {
              "grade": {
                "type": "string"
              },
              "score": {
                "type": "integer"
              },
              "provider": {
                "type": "string",
                "nullable": true
              },
              "bulkSenderReady": {
                "type": "boolean",
                "description": "SPF or DKIM plus DMARC, as Gmail and Yahoo require of bulk senders"
              },
              "mx": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "priority": {
                      "type": "integer"
                    },
                    "host": {
                      "type": "string"
                    }
                  }
                }
              },
              "spf": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "record": {
                    "type": "string"
                  },
                  "all": {
                    "type": "string",
                    "nullable": true
                  },
                  "lookups": {
                    "type": "integer",
                    "description": "DNS-querying mechanisms, includes followed. Over 10 fails at receivers"
                  }
                }
              },
              "dmarc": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "policy": {
                    "type": "string"
                  },
                  "subdomainPolicy": {
                    "type": "string",
                    "nullable": true
                  },
                  "pct": {
                    "type": "integer"
                  },
                  "reports": {
                    "type": "boolean"
                  },
                  "record": {
                    "type": "string"
                  }
                }
              },
              "dkim": {
                "type": "object",
                "properties": {
                  "found": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "revoked": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "checked": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "mtaSts": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "mode": {
                    "type": "string",
                    "nullable": true
                  }
                }
              },
              "tlsRpt": {
                "type": "boolean"
              },
              "bimi": {
                "type": "boolean"
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "critical": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Failing checks, email first"
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pass",
                    "warn",
                    "fail"
                  ]
                },
                "detail": {
                  "type": "string"
                }
              }
            }
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GuardReport": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "lane": {
            "type": "string",
            "enum": [
              "preview",
              "x402",
              "syndicate"
            ]
          },
          "network": {
            "type": "string"
          },
          "chainId": {
            "type": "integer"
          },
          "token": {
            "type": "object",
            "properties": {
              "address": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "nullable": true
              },
              "symbol": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "verdict": {
            "type": "string",
            "enum": [
              "pass",
              "caution",
              "avoid"
            ]
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "liquidity": {
            "type": "object",
            "nullable": true,
            "properties": {
              "usd": {
                "type": "number"
              },
              "volume24hUsd": {
                "type": "number"
              },
              "dex": {
                "type": "string"
              },
              "pair": {
                "type": "string"
              },
              "pairUrl": {
                "type": "string"
              },
              "pairAgeDays": {
                "type": "integer",
                "nullable": true
              },
              "basePairs": {
                "type": "integer"
              },
              "depth": {
                "type": "string",
                "enum": [
                  "deep",
                  "moderate",
                  "thin",
                  "very-thin"
                ]
              },
              "source": {
                "type": "string",
                "enum": [
                  "DexScreener",
                  "GeckoTerminal"
                ]
              },
              "cachedAgeSecs": {
                "type": "integer",
                "description": "Present only when both sources refused and a reading up to 300 seconds old was reused."
              }
            }
          },
          "honeypot": {
            "type": "object",
            "properties": {
              "simulated": {
                "type": "boolean"
              },
              "isHoneypot": {
                "type": "boolean",
                "nullable": true
              },
              "buyTaxPct": {
                "type": "number",
                "nullable": true
              },
              "sellTaxPct": {
                "type": "number",
                "nullable": true
              },
              "risk": {
                "type": "string",
                "nullable": true
              },
              "flags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "source": {
                "type": "string"
              }
            }
          },
          "swap": {
            "type": "object",
            "properties": {
              "included": {
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              },
              "router": {
                "type": "string"
              },
              "tool": {
                "type": "string"
              },
              "toAmount": {
                "type": "string"
              },
              "toAmountMin": {
                "type": "string"
              },
              "approvalAddress": {
                "type": "string"
              },
              "integratorFee": {
                "type": "number"
              },
              "transactionRequest": {
                "type": "object"
              }
            }
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "disclaimer": {
            "type": "string"
          }
        }
      }
    }
  }
}