Back to Home

API Reference

Complete API documentation for PromptShield integration

Quick Start
Get your API key and start making requests

1. Get your API key

Sign up for an account and generate your API key from the dashboard.

Get API Key

2. Base URL

https://api.promptshield.com/v1

3. Authentication

Authorization: Bearer YOUR_API_KEY

API Endpoints

POST /scans
Create a new security scan
POST

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
GET

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 hour
X-RateLimit-Remaining - Requests remaining
X-RateLimit-Reset - Reset timestamp

Need Help?

Our team is here to help you integrate PromptShield successfully.