HTTP Status Codes
The Electron Hub API uses standard HTTP status codes to indicate the success or failure of requests.Common Error Codes
401 - Authentication Errors
Invalid API Key- Cause: The API key is incorrect, missing, or malformed
- Solution: Verify your API key from the Electron Hub Console
- Cause: Your API key has been revoked or expired
- Solution: Generate a new API key from your dashboard
429 - Rate Limit Errors
Request Rate Limit- Cause: Too many requests sent in a short time period
- Solution: Implement exponential backoff and respect rate limits
- Cause: Token usage has exceeded your plan limits
- Solution: Upgrade your plan or wait for the limit to reset
400 - Bad Request Errors
Invalid Model- Cause: The specified model is not available or misspelled
- Solution: Check the models documentation for available models
- Cause: Request parameters are missing or invalid
- Solution: Verify all required parameters are provided with correct types
- Cause: Input content violates usage policies
- Solution: Review and modify your content to comply with policies
402 - Payment Required
Insufficient Credits- Cause: Your account has insufficient credits or balance
- Solution: Purchase additional credits or upgrade your plan
- Cause: Attempting to use a premium model without subscription
- Solution: Upgrade to a plan that includes premium model access
500 - Server Errors
Internal Server Error- Cause: Unexpected error on our servers
- Solution: Retry with exponential backoff; contact support if persistent
503 - Service Unavailable
Model Temporarily Unavailable- Cause: The requested model is temporarily offline
- Solution: Try again later or use an alternative model
Error Response Format
All errors return a consistent JSON envelope with a top-levelerror object:
message— human-readable description (always present).type— error category (e.g.invalid_request_error).param— the offending parameter, ornull.code— the HTTP status code, ornull.
/v1/messages endpoint instead returns Anthropic’s native error shape: {"type": "error", "error": {"type": "...", "message": "..."}}.
Best Practices
Implement Retry Logic
Handle Specific Error Types
Monitor Rate Limits
Check response headers for rate limit information:Getting Help
If you encounter persistent errors or need assistance:- Check our status page for service updates
- Join our Discord community for help
- Contact support at [email protected]
- Review our best practices guide for optimization tips
