Get ShieldGuard protecting your APIs in minutes. Follow our step-by-step guide to integrate, configure, and monitor your security rules.
1. Install ShieldGuard
# Option A: Clone and run
git clone https://github.com/yourorg/shieldguard.git
cd shieldguard
# Option B: Install via pip
pip install shieldguard
2. Run database migrations
python manage.py migrate
3. Create your account
Navigate to /accounts/signup/ and register your account.
4. Get your API key
Click "New Project" in your dashboard to generate your first API key. You'll need this key to protect your endpoints.
Pass your API key in the X-Arcjet-Key header to authenticate requests.
import requests
headers = {"X-Arcjet-Key": "your_api_key_here"}
response = requests.get(
"https://yourshieldguard.com/api/protected/",
headers=headers
)
print(response.json())
Add ShieldGuard middleware to your Django settings for automatic request protection.
# Add to your Django project settings.py
MIDDLEWARE = [
# ... other middleware
'shieldguard.middleware.ProtectMiddleware',
]
Use a custom middleware to validate API keys on every request.
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse
@app.middleware("http")
async def shieldguard_middleware(request, call_next):
api_key = request.headers.get("X-Arcjet-Key")
if not api_key:
return JSONResponse(
{"error": "Missing API key"}, status_code=401
)
return await call_next(request)
Total API hits received by your projects in the last 24 hours. Tracks all incoming traffic regardless of outcome.
Requests blocked by your security rules. Includes rate-limited, banned IPs, and flagged bot traffic.
Detected automated requests from crawlers, scrapers, and bots. Break down includes known user agents and behavioral detection.
Plan limit tracking for the current billing cycle. Shows requests used vs. your plan's monthly allowance.
.env, .git, wp-admin, etc.) to prevent reconnaissance.Track and monitor your AI API spending across all models and providers.
# Log AI request costs in your application
engine.log_ai_cost(
model="gpt-4",
tokens_in=1500,
tokens_out=300,
cost_usd=0.0065
)
View detailed cost breakdown by model at /aitrack/costs/<slug>/
Set spending thresholds and get notified at /aitrack/budget-alert/
All endpoints require authentication via the X-Arcjet-Key header.
/api/projects/
List your projects
/api/projects/create/
Create a new project
/api/projects/<slug>/rules/create/
Add a security rule
/api/projects/<slug>/rules/
List all rules
Ready to protect your API?
Get Started for Free →