๐Ÿ›ก CodeGuard API

Automated security scanning for code and pull requests. Detect vulnerabilities before they ship.

Base URL: https://neuronx.jagatab.uk

Authentication

Pass your API key in the X-Api-Key header:

curl -H "X-Api-Key: nx-YOUR_KEY" https://neuronx.jagatab.uk/v1/scan ...

โ†’ Get a free API key (POST)

Pricing

TierScans/DayPriceBest For
Free50$0Testing & hobbyists
Pro1,000$9/moIndividual developers
TeamUnlimited$49/moTeams & CI/CD pipelines

Endpoints

POST /v1/scan

Scan code or a unified diff for security vulnerabilities.

curl -X POST https://neuronx.jagatab.uk/v1/scan \
      -H "X-Api-Key: nx-YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "code": "import subprocess\nsubprocess.run(user_input, shell=True)",
        "filename": "app.py",
        "severity_threshold": "warning"
      }'

Request body:

FieldTypeDefaultDescription
codestring""Raw source code to scan
diffstring""Unified diff (alternative to code)
filenamestring"code.py"Filename for language detection
severity_thresholdstring"warning"Minimum severity: info/warning/error
max_issuesint20Max issues returned (1-100)
include_fix_suggestionsbooltrueInclude AI fix suggestions

Example response:

{
      "status": "error",
      "summary": {"total_issues": 2, "errors": 1, "warnings": 1},
      "issues": [
        {
          "severity": "error",
          "line": 2,
          "message": "Command injection via shell=True with unsanitized input",
          "owasp": "A03:2021 Injection",
          "fix_suggestion": "Use shlex.split() and shell=False"
        }
      ],
      "scan_time_ms": 142.3,
      "usage": {"used_today": 1, "limit": 50, "tier": "free"}
    }

GET /v1/usage

Check your current usage and remaining quota.

curl -H "X-Api-Key: nx-YOUR_KEY" https://neuronx.jagatab.uk/v1/usage

POST /v1/keys/create

Create a free-tier API key (no credit card required).

curl -X POST https://neuronx.jagatab.uk/v1/keys/create \
      -H "Content-Type: application/json" \
      -d '{"name": "My Project", "email": "[email protected]"}'

Error Codes

HTTPErrorMeaning
401missing_api_key / invalid_api_keyKey missing or wrong
429rate_limit_exceededDaily quota exhausted โ€” resets midnight UTC
400โ€”Bad request (provide code or diff)

GitHub Action

Auto-scan pull requests on every push:

# .github/workflows/codeguard.yml
name: CodeGuard Security Scan
on: [pull_request]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with: {fetch-depth: 0}
      - name: Run CodeGuard
        run: |
          DIFF=$(git diff origin/${{ github.base_ref }}...HEAD)
          curl -sf -X POST https://neuronx.jagatab.uk/v1/scan \
            -H "X-Api-Key: ${{ secrets.CODEGUARD_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d "$(jq -n --arg d "$DIFF" '{"diff":$d,"severity_threshold":"error"}')" | tee result.json
          if [ "$(jq -r .status result.json)" = "error" ]; then exit 1; fi

SDKs

# Python
pip install codeguard-sdk

from codeguard import CodeGuard
cg = CodeGuard("nx-YOUR_KEY")
result = cg.scan(code=open("app.py").read(), filename="app.py")
print(result.summary)

CodeGuard is powered by NeuronX AI Security Engine. Documentation ยท Support