API Documentation

Integrate Sentinel into your workflow with our REST API.

01 Quick Start

Solidity Example

bash
curl -X POST https://sentinel.sh/api/v1/audit \
  -H "Authorization: Bearer sk_sentinel_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "pragma solidity ^0.8.20; contract MyToken { ... }",
    "language": "solidity"
  }'

Rust/Solana Example

bash
curl -X POST https://sentinel.sh/api/v1/audit \
  -H "Authorization: Bearer sk_sentinel_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "use anchor_lang::prelude::*; #[program] pub mod my_program { ... }",
    "language": "rust"
  }'

Cairo/StarkNet Example

bash
curl -X POST https://sentinel.sh/api/v1/audit \
  -H "Authorization: Bearer sk_sentinel_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "#[starknet::contract] mod MyContract { ... }",
    "language": "cairo"
  }'

Tact/TON Example

bash
curl -X POST https://sentinel.sh/api/v1/audit \
  -H "Authorization: Bearer sk_sentinel_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "contract MyWallet { receive() { ... } }",
    "language": "tact"
  }'

Supported Languages

"solidity"Ethereum, Base, Arbitrum, all EVM chains
"rust"Solana Anchor programs, native Solana, CosmWasm
"vyper"Pythonic smart contracts for Ethereum
"move"Sui, Aptos, and other Move-based blockchains
"cairo"StarkNet smart contracts and Layer 2 applications
"tact"TON blockchain contracts, including FunC compatibility

Note: The language parameter is optional. If not provided, Sentinel will auto-detect the language from the code patterns.

02 Response Format

response.json
{
  "language": "solidity",
  "score": 72,
  "grade": "B-",
  "findings": [
    {
      "id": "F-1",
      "severity": "critical",
      "title": "Reentrancy Vulnerability",
      "description": "State changes after external call...",
      "line": 15,
      "recommendation": "Apply checks-effects-interactions...",
      "category": "Reentrancy"
    }
  ],
  "summary": "1 critical vulnerability detected...",
  "gasOptimizations": 3,
  "linesAnalyzed": 42,
  "timeMs": 127
}

Response Fields

language
string
Detected or specified language (solidity | rust | vyper | move | cairo | tact)
score
number
Security score (0-100)
grade
string
Letter grade (A+ to F)
findings
Finding[]
Array of vulnerability findings
findings[].severity
string
critical | high | medium | low | info
findings[].title
string
Vulnerability name
findings[].line
number?
Line number in source code
findings[].recommendation
string
How to fix the issue
summary
string
Human-readable audit summary
gasOptimizations
number
Number of optimization opportunities
linesAnalyzed
number
Lines of code scanned
timeMs
number
Analysis time in milliseconds

03 CI/CD Integration

Automatically audit contracts on every push. Fail the build if the score drops below your threshold.

.github/workflows/sentinel.yml
# .github/workflows/sentinel.yml
name: Sentinel Audit
on: [push, pull_request]

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Sentinel Audit
        run: |
          for file in contracts/*.sol; do
            echo "Auditing $file..."
            RESULT=$(curl -s -X POST https://sentinel.sh/api/v1/audit \
              -H "Authorization: Bearer ${{ secrets.SENTINEL_API_KEY }}" \
              -H "Content-Type: application/json" \
              -d "{\"code\": \"$(cat $file | jq -Rsa .)\"}")
            
            SCORE=$(echo $RESULT | jq '.score')
            echo "$file: Score $SCORE"
            
            if [ "$SCORE" -lt 60 ]; then
              echo "FAIL: $file failed audit (score: $SCORE)"
              exit 1
            fi
          done
          echo "PASS: All contracts passed"

04 Rate Limits

Plan
Web Scans
API Calls
Explorer (Free)
3/day
Pro ($49/mo)
Unlimited
1,000/month
Enterprise ($199/mo)
Unlimited
Unlimited

05 Error Codes

400Invalid request (missing code, too large)
401Invalid or missing API key
429Rate limit exceeded
500Internal analysis error