CodeGuardian AI API Reference
Complete REST API Documentation
Base URL
Production Ready
Enterprise-grade API with 99.9% uptime SLA
High Performance
Sub-second response times with global CDN
Unlimited Scale
Process files of any size with adaptive processing
Authentication
API Key Authentication
CodeGuardian AI uses API keys for authentication. Include your API key in the Authorization header using the Bearer token format.
Request Header
Authorization: Bearer YOUR_API_KEY
cURL Example
curl -H "Authorization: Bearer sk-proj-abc123..." \
https://api.codeguardian.lovelogicai.com/v1/scan
Getting Your API Key
Generate API keys from your dashboard at CodeGuardian AI Platform. Store keys securely and rotate them regularly.
File Processing APIs
/v1/scan
Upload and analyze files up to 500MB using our basic scanning agents. Supports common archive formats and returns comprehensive security findings.
Request Parameters
File to analyze (multipart/form-data). Max size: 500MB
Comma-separated list: security,dependency,secrets,sbom
Output format: json, sarif, cyclonedx (default: json)
Webhook URL for async result delivery
Example Request
curl -X POST https://api.codeguardian.lovelogicai.com/v1/scan \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "file=@./codebase.tar.gz" \
-F "engines=security,dependency,secrets" \
-F "format=sarif" \
-F "webhook=https://your-webhook.com/results"
Response Example
{
"scan_id": "scan_abc123def456",
"status": "processing",
"created_at": "2025-01-16T10:30:00Z",
"estimated_completion": "2025-01-16T10:32:30Z",
"agents": ["security", "dependency", "secrets"],
"webhook_url": "https://your-webhook.com/results"
}
/v1/scan/unlimited
PREMIUMProcess files of unlimited size and any type using our revolutionary Universal Processor. Supports streaming upload, resume capability, and all 7 specialized processing engines.
Advanced Parameters
Chunk size for streaming upload (default: 64MB)
Enable upload resume capability (default: true)
Processing strategy: adaptive, performance, memory_optimized
JavaScript SDK Example
import { CodeGuardianAPI } from '@lovelogicai/codeguardian';
const client = new CodeGuardianAPI({
apiKey: 'YOUR_API_KEY'
});
const result = await client.scan.unlimited({
file: fileBlob,
engines: 'all',
chunkSize: '128MB',
enableResume: true,
onProgress: (progress) => {
console.log(`Upload: ${progress.percent}%`);
}
});
Scan Management
/v1/scan/{scan_id}/status
Get real-time status updates for a running scan, including progress, active agents, and ETA.
Response Fields
Example Response
{
"scan_id": "scan_abc123def456",
"status": "processing",
"progress": 65,
"active_agents": [
"Security Auditor",
"Dependency Agent"
],
"completed_agents": [
"Manager Agent",
"Secrets Hunter"
],
"eta": "2025-01-16T10:31:45Z",
"files_processed": 42,
"total_files": 65,
"current_phase": "vulnerability_scanning"
}
/v1/scan/{scan_id}/results
Retrieve comprehensive scan results including all findings, SARIF export, and SBOM data.
{
"scan_id": "scan_abc123def456",
"status": "completed",
"completed_at": "2025-01-16T10:32:15Z",
"summary": {
"total_vulnerabilities": 12,
"critical": 2,
"high": 4,
"medium": 5,
"low": 1,
"secrets_found": 3,
"dependencies_analyzed": 156,
"vulnerable_dependencies": 8
},
"findings": [
{
"id": "SEC-001",
"severity": "HIGH",
"type": "SQL Injection",
"file": "src/auth/login.py",
"line": 42,
"description": "Unsanitized user input in database query",
"cwe": "CWE-89",
"agent": "Security Auditor"
}
],
"agents": {
"security_auditor": {
"files_scanned": 47,
"vulnerabilities_found": 12,
"processing_time": "23.4s"
}
}
}
Agent Management
/v1/agents
List all available agents with their current status, capabilities, and performance metrics.
{
"agents": [
{
"name": "Manager Agent",
"status": "active",
"role": "orchestrator",
"capabilities": ["task_delegation", "state_management"],
"performance": {
"tasks_completed": 1247,
"avg_processing_time": "0.3s",
"success_rate": "99.8%"
}
},
{
"name": "Security Auditor",
"status": "active",
"role": "security_analysis",
"tools": ["semgrep", "codeql", "pattern_matching"],
"performance": {
"files_scanned": 15420,
"vulnerabilities_found": 892,
"false_positive_rate": "12%"
}
}
]
}
Rate Limiting
CodeGuardian AI implements intelligent rate limiting based on your plan tier and resource usage. Rate limit headers are included in all API responses.