{
  "openapi": "3.1.0",
  "info": {
    "title": "RattlerAI",
    "version": "1.0.0",
    "x-guidance": "RattlerAI \u2014 autonomous Solidity smart contract security auditor. POST /audit with contract source or GitHub URL. Returns structured report in Code4rena format. $2.00/audit via x402 USDC on Base. | Also from LoneStarOracle: TokenScope (token.lonestaroracle.xyz) for token due diligence | ChainScout (chainscout.lonestaroracle.xyz) for on-chain intelligence | Full catalog: lonestaroracle.xyz",
    "contact": {
      "email": "jay@lonestaroracle.xyz"
    },
    "description": "Deep AI plus Slither security audit for a Solidity smart contract. POST /audit."
  },
  "externalDocs": {
    "url": "https://docs.lonestaroracle.xyz",
    "description": "LoneStarOracle API & integration docs"
  },
  "paths": {
    "/fix": {
      "post": {
        "summary": "Fix",
        "description": "Generate a patch fix for a specific bug reported in a GitHub issue.\nFetches the contract, runs Slither, and outputs a patch-format fix ready for a PR.",
        "operationId": "fix_fix_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FixRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "summary": "Root",
        "operationId": "root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/preview": {
      "get": {
        "summary": "Preview",
        "operationId": "preview_preview_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Health",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/audit": {
      "post": {
        "summary": "Smart Contract Security Audit",
        "description": "Deep AI plus Slither security audit for a Solidity smart contract. POST /audit.",
        "operationId": "audit_audit_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "x-payment-info": {
          "authMode": "payment",
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "2.000000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "inputSchema": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "description": "Solidity contract source code"
              },
              "github_url": {
                "type": "string",
                "description": "GitHub URL to .sol file or repo"
              },
              "contract_name": {
                "type": "string",
                "description": "Contract name (optional)"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "description": "Security audit report"
          }
        },
        "tags": [
          "audit",
          "security",
          "smart-contract",
          "solidity",
          "slither",
          "defi"
        ]
      }
    },
    "/targets": {
      "get": {
        "summary": "Targets",
        "description": "Free \u2014 finds Immunefi programs with accessible GitHub repos.\nUse launched_after=YYYY-MM-DD to filter for newer programs (e.g. 2025-01-01).\nNewer programs are less battle-tested and more likely to have undiscovered bugs.",
        "operationId": "targets_targets_get",
        "parameters": [
          {
            "name": "min_reward",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50000,
              "title": "Min Reward"
            }
          },
          {
            "name": "max_reward",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 2000000,
              "title": "Max Reward"
            }
          },
          {
            "name": "launched_after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "",
              "title": "Launched After"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/contests": {
      "get": {
        "summary": "Contests",
        "description": "Free \u2014 lists active Code4rena audit contests available for RattlerAI to hunt.",
        "operationId": "contests_contests_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/immunefi": {
      "get": {
        "summary": "Immunefi",
        "description": "Free \u2014 lists active Immunefi bug bounty programs. Use min_reward to filter.",
        "operationId": "immunefi_immunefi_get",
        "parameters": [
          {
            "name": "min_reward",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100000,
              "title": "Min Reward"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/demo": {
      "get": {
        "summary": "Get Demo Rattler",
        "operationId": "get_demo_rattler_demo_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuditRequest": {
        "properties": {
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "github_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Github Url"
          },
          "contract_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Name",
            "default": "Contract"
          }
        },
        "type": "object",
        "title": "AuditRequest"
      },
      "FixRequest": {
        "properties": {
          "issue_url": {
            "type": "string",
            "title": "Issue Url"
          },
          "repo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repo Url"
          },
          "contract_file": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract File"
          }
        },
        "type": "object",
        "required": [
          "issue_url"
        ],
        "title": "FixRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}