Overview
Even the best APIs return errors when something needs your attention—like a missing key or a typo in your request. Knowing how to interpret and handle these responses helps you build resilient, user-friendly applications. Why care? Proper error handling means less downtime, better user experience, and easier debugging.Most errors are easy to fix once you know what they mean. This page shows you how.
Example Error Response
Quick Start
How to catch and handle errors in your code:- Node.js
- Python
- cURL
Common Pitfalls
Missing API Key
Double-check your
Routeway_API_KEY
is set and included in every request.Rate Limits
Too many requests? You may hit a 429 error. Add retry logic and check your usage.
Wrong Endpoint
A 404 error usually means a typo in your URL or using the wrong HTTP method.
Model Support
Some models don’t support function calling. Check model capabilities before using advanced features.
Deep Dive: Error Types & Solutions
How to Read an Error
Every error response includes:message
: Human-readable explanationtype
: Error categorycode
: Numeric or string code
Error Code Reference
- 403 Forbidden
- 429 Too Many Requests
- 400 Bad Request
- 404 Not Found
- 500 Internal Server Error
- 422 Unprocessable Entity
- Set the
Routeway_API_KEY
environment variable. - Include it in your request headers.
- Generate a new key if needed.
Troubleshooting
1
Read the Error Message
The error message usually tells you exactly what’s wrong.
2
Check Your Request
Validate your API key, endpoint, and payload structure.
3
Consult the Reference
Look up the error code above for a solution.
4
Retry or Contact Support
If you’re stuck, contact support with your full request and error details.
Reference: All Error Codes
Code | Meaning | Typical Fix |
---|---|---|
400 | Bad Request | Check required fields, payload structure |
401 | Unauthorized | Set or refresh your API key |
403 | Forbidden | Slow down, contact support if blocked |
404 | Not Found | Check endpoint and resource existence |
422 | Unprocessable Entity | Last message must be from user |
429 | Too Many Requests | Reduce frequency, upgrade plan |
500 | Internal Server Error | Retry, contact support |