Overview
All Repolyze API endpoints return consistent error responses in JSON format. This page documents all possible error scenarios, status codes, and error response formats.Error Response Format
All errors follow this base structure:Enhanced Error Response (Daily Rate Limit)
Daily rate limit errors include additional fields:HTTP Status Codes
| Code | Status | Description | Endpoints |
|---|---|---|---|
400 | Bad Request | Invalid request parameters or format | /api/analyze, /api/branches |
404 | Not Found | Repository or resource not found | /api/analyze, /api/branches |
413 | Payload Too Large | Request body exceeds size limit | /api/analyze |
429 | Too Many Requests | Rate limit exceeded | All endpoints |
500 | Internal Server Error | Unexpected server error | All endpoints |
503 | Service Unavailable | Server not properly configured | /api/analyze |
Error Details by Endpoint
POST /api/analyze
400 Bad Request
Invalid JSON:404 Not Found
Repository not found:413 Payload Too Large
429 Too Many Requests - Burst Limit
- Limit: 10 requests per minute per IP
- Window: 60 seconds rolling
- Retry: Wait 60 seconds before retrying
429 Too Many Requests - Daily Limit (Anonymous)
- Limit: 1 analysis per day
- Reset: 24 hours from first request
- Solution: Sign in to increase limit to 3/day
429 Too Many Requests - Daily Limit (Free)
- Limit: 3 analyses per day
- Reset: 24 hours from first request
- Solution: Upgrade to Pro for 44 analyses/day
429 Too Many Requests - Daily Limit (Pro)
- Limit: 44 analyses per day
- Reset: 24 hours from first request
500 Internal Server Error
Generic error:503 Service Unavailable
POST /api/branches
400 Bad Request
Missing URL:404 Not Found
429 Too Many Requests
500 Internal Server Error
Streaming Errors
When using the/api/analyze streaming endpoint, errors can occur mid-stream:
Stream Error Event
| Error Message | Cause | Solution |
|---|---|---|
"Repository not found" | Invalid repo URL or private repo | Verify URL and ensure repo is public |
"Branch not found" | Invalid branch name | Use /api/branches to get valid branches |
"GitHub API rate limit exceeded" | Too many GitHub API calls | Wait for rate limit reset |
"AI analysis failed" | OpenRouter API error | Retry the request |
"Model timeout" | AI model took too long | Retry with smaller repository |
Error Handling Best Practices
TypeScript Error Handler
React Error Boundary
Retry with Exponential Backoff
User-Friendly Error Messages
Validation Helpers
URL Validation
Branch Validation
Related Documentation
- API Overview - General API information and rate limits
- POST /api/analyze - Analyze endpoint documentation
- POST /api/branches - Branches endpoint documentation
- Analysis Response Types - Response type definitions