Authentication
All API requests require an API key passed as a Bearer token in the Authorization header. Generate keys from Dashboard → Settings → API Keys.
Authorization: Bearer as_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Rate Limits
Rate limit headers included in all responses: X-RateLimit-Remaining, X-RateLimit-Reset
Endpoints
/audit/scanCoreSubmit a Solidity contract for analysis. Returns findings in JSON.
/audit/results/:idRetrieve results for a completed audit by ID.
/audit/historyGet paginated list of all audits for the authenticated user.
/audit/deepEnterpriseSubmit for Deep Audit with Claude Opus extended thinking. Returns PoCs and patched code.
/user/limitsCheck remaining audits, rate limits, and plan details.
/payment/plansGet available subscription plans and their features.
Live Examples
Request
curl -X POST https://api.auditsmart.org/v1/audit/scan \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract Vulnerable {\n mapping(address => uint256) public balances;\n\n function withdraw() external {\n uint256 amount = balances[msg.sender];\n (bool ok,) = msg.sender.call{value: amount}(\"\");\n balances[msg.sender] = 0; // ❌ state updated after call\n }\n}",
"options": {
"deepScan": false,
"includeFixCode": true
}
}'Response
{
"auditId": "audit_7f8a3b2c",
"status": "completed",
"contractHash": "sha256:a1b2c3d4...",
"duration": "48s",
"summary": {
"critical": 1,
"high": 0,
"medium": 1,
"low": 2,
"info": 3
},
"findings": [
{
"id": "REENTRANCY-001",
"severity": "CRITICAL",
"category": "Reentrancy",
"title": "Reentrancy vulnerability in withdraw()",
"description": "State update occurs after external call. Allows recursive withdrawal.",
"line": 10,
"agent": "ReentrancyAgent",
"fix": {
"code": "function withdraw() external {\n uint256 amount = balances[msg.sender];\n balances[msg.sender] = 0; // ✅ state first\n (bool ok,) = msg.sender.call{value: amount}(\"\");\n}",
"pattern": "Checks-Effects-Interactions"
}
}
],
"reportUrl": "https://auditsmart.org/r/audit_7f8a3b2c",
"pdfUrl": "https://auditsmart.org/r/audit_7f8a3b2c.pdf"
}Error Codes
400401403404429500Need help with the API?
Check out our community Discord for help, or open a support ticket if you're on a paid plan.