ComponentForge REST API documentation.
- Development:
http://localhost:8000 - Production:
https://api.componentforge.com
# Health check
GET /health
# API documentation (Swagger UI)
GET /docs
# Prometheus metrics
GET /metricsAll authenticated endpoints require a valid JWT token. See Authentication for details.
# Example authenticated request
curl -X POST http://localhost:8000/api/v1/generate/screenshot \
-H "Authorization: Bearer $TOKEN" \
-F "file=@screenshot.png"POST /api/v1/generate/screenshot- Generate from screenshotPOST /api/v1/generate/figma- Generate from Figma URL
POST /api/v1/patterns/search- Semantic search for patternsGET /api/v1/patterns/{id}- Get specific pattern
GET /api/v1/components/- List generated componentsGET /api/v1/components/{id}- Get component detailsPOST /api/v1/components/{id}/regenerate- Regenerate component
POST /api/v1/documents/upload- Upload design documentGET /api/v1/documents/{id}- Get document details
All responses follow this structure:
{
"status": "success" | "error",
"data": { ... },
"message": "Optional message",
"timestamp": "2025-10-08T14:00:00Z"
}Error responses include:
{
"status": "error",
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input parameters",
"details": { ... }
},
"timestamp": "2025-10-08T14:00:00Z"
}400- Bad Request (validation errors)401- Unauthorized (missing/invalid token)403- Forbidden (insufficient permissions)404- Not Found429- Rate Limit Exceeded500- Internal Server Error
- Authenticated users: 100 requests/minute
- Unauthenticated: 20 requests/minute
Rate limit headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1633024800
For interactive API documentation with request/response examples, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc