API versioning, security, authentication, rate limiting, monitoring, error handling, and documentation strategies for production APIs. Use when planning API infrastructure, implementing security concerns, or designing monitoring strategies.
Implements production API architecture including versioning, security, rate limiting, monitoring, and error handling.
npx claudepluginhub karchtho/my-claude-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Master architectural concerns that apply across all API types for production-ready systems.
Clear and easy to route: /api/v1/users, /api/v2/users
Clean URLs: Accept: application/vnd.api+json; version=2
Easy to test: GET /api/users?version=2
Bearer Token (JWT):
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
401 Unauthorized - Missing/invalid token
403 Forbidden - Valid token, insufficient permissions
API Keys:
X-API-Key: your-api-key-here
class RateLimiter:
def __init__(self, calls: int, period: int):
self.calls = calls
self.period = period
self.cache = {}
def check(self, key: str) -> bool:
now = datetime.now()
if key not in self.cache:
self.cache[key] = []
self.cache[key] = [
ts for ts in self.cache[key]
if now - ts < timedelta(seconds=self.period)
]
if len(self.cache[key]) >= self.calls:
return False
self.cache[key].append(now)
return True
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 742
X-RateLimit-Reset: 1640000000
429 Too Many Requests
Retry-After: 3600
@app.get("/health")
async def health_check():
return {"status": "healthy", "version": "1.0.0"}
@app.get("/health/detailed")
async def detailed_health():
return {
"status": "healthy",
"checks": {
"database": await check_database(),
"cache": await check_cache()
}
}
Cache-Control: public, max-age=3600 # Client caching
Cache-Control: no-cache, no-store # No caching
ETag: "hash"
If-None-Match: "hash"
→ 304 Not Modified
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": [{"field": "email", "message": "Invalid"}],
"timestamp": "2025-10-16T12:00:00Z",
"path": "/api/users"
}
}
app = FastAPI(
title="My API",
docs_url="/docs",
redoc_url="/redoc"
)
@app.get("/api/users/{user_id}", tags=["Users"])
async def get_user(user_id: str):
"""Retrieve user by ID."""
pass
@deprecated for backward compatibility