Quick Start
Get your API key and start making requests
2. Base URL
https://api.promptshield.com/v13. Authentication
Authorization: Bearer YOUR_API_KEYAPI Endpoints
POST /scans
Create a new security scan
Request Body
{
"name": "My AI App Security Scan",
"endpoint": "https://api.openai.com/v1/chat/completions",
"apiKey": "sk-...",
"model": "gpt-4",
"testTypes": ["prompt_injection", "data_leakage", "output_validation"],
"options": {
"maxTests": 50,
"timeout": 300,
"customPrompts": []
}
}Response
{
"id": "scan_123456789",
"status": "queued",
"createdAt": "2025-01-27T10:00:00Z",
"estimatedDuration": "2-3 minutes",
"webhookUrl": "https://api.promptshield.com/v1/scans/scan_123456789"
}GET /scans/{id}
Get scan status and results
Response
{
"id": "scan_123456789",
"status": "completed",
"progress": 100,
"results": {
"securityScore": 85,
"grade": "B+",
"vulnerabilities": {
"high": 0,
"medium": 2,
"low": 3,
"info": 5
},
"testsRun": 47,
"duration": "2m 34s"
},
"createdAt": "2025-01-27T10:00:00Z",
"completedAt": "2025-01-27T10:02:34Z"
}Code Examples
Create a Scan
curl -X POST https://api.promptshield.com/v1/scans \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My AI App Security Scan",
"endpoint": "https://api.openai.com/v1/chat/completions",
"apiKey": "sk-...",
"model": "gpt-4"
}'Rate Limits
API usage limits and best practices
Free Plan
- • 5 scans per month
- • 100 API calls per hour
- • Basic support
Pro Plan
- • Unlimited scans
- • 1000 API calls per hour
- • Priority support
Rate Limit Headers
X-RateLimit-Limit - Requests per hourX-RateLimit-Remaining - Requests remainingX-RateLimit-Reset - Reset timestampNeed Help?
Our team is here to help you integrate PromptShield successfully.