Mycotoxins constitute a group of toxic small-molecule secondary metabolites formed by fungi under specific temperature and humidity conditions. The toxicity of ochratoxin A (OTA) is second only to aflatoxin B1 (AFB1), which has nephrotoxicity, hepatotoxicity, immunotoxicity and other toxicological effects on humans and animals, seriously endangering the health of human and animal bodies. Thus, developing a rapid, uncomplicated, and sensitive OTA detection method is pivotal for ensuring food safety. This study introduces a novel approach for OTA detection in agricultural products using a 3D DNA nanotweezers molecular machine. The aptamer binds to the target OTA upon present, prompting the DNA nanotweezers to transition from an "open" to "closed" state. The proximity of the two arms of the DNA nanotweezers influences the strength of the Raman signal. This innovative detection method combines nucleic acid aptamer technology with Surface-enhanced Raman sensing (SERS). The resulting linear regression equation is Y=5323.5+610.09X, and the correlation coefficient (R2) is 0.9964, underlining the method's efficacy in OTA quantification.