Rate Limits and Error Codes
This document outlines the rate limits for Kid Smart AI APIs and provides information on potential error responses you may encounter.
Rate Limits
Kid Smart AI implements the following rate limits to ensure fair usage and system stability:
- Request rate: 10 requests per second
- Burst: 10 requests
- Monthly quota: 10000 requests per month
If you need higher limits, please contact us at it@kidsmart.ai to discuss your requirements.
Exceeding Rate Limits
If you exceed these limits, you will receive an HTTP 429 Too Many Requests status code. We recommend implementing exponential backoff in your applications to handle rate limiting gracefully.
Error Codes
Below are the possible error responses you may encounter when using Kid Smart AI APIs:
Status Code | Error Type | Description |
---|---|---|
400 | Bad Request | The request was invalid or cannot be served. The exact error should be explained in the error payload. |
401 | Unauthorized | The request requires authentication. |
403 | Forbidden | The server understood the request but refuses to authorize it. |
404 | Not Found | The requested resource could not be found. |
413 | Payload Too Large | The request is larger than the server is willing or able to process. |
415 | Unsupported Media Type | The media format of the requested data is not supported by the server. |
429 | Too Many Requests | The user has sent too many requests in a given amount of time. |
500 | Internal Server Error | The server encountered an unexpected condition that prevented it from fulfilling the request. |
504 | Gateway Timeout | The server was acting as a gateway or proxy and did not receive a timely response from the upstream server. |
Detailed Error Responses
In addition to standard HTTP status codes, our API may return more specific error types:
Error Type | Status Code | Description |
---|---|---|
Access Denied | 403 | The request was denied due to insufficient permissions. |
API Configuration Error | 500 | There is an issue with the API configuration. Please contact support. |
Authorizer Failure | 500 | The request could not be authorized. Check your authentication credentials. |
Expired Token | 403 | The authentication token has expired. Please refresh your token. |
Invalid API Key | 403 | The provided API key is not valid. Check your API key in the dashboard. |
Invalid Signature | 403 | The request signature is invalid. Ensure you're signing requests correctly. |
Missing Authentication Token | 403 | The request is missing an authentication token. |
Quota Exceeded | 429 | You have exceeded your monthly request quota. |
WAF Filtered | 403 | The request was blocked by our Web Application Firewall. |
Handling Errors
When an error occurs, the response body will contain more information about the error. Here's an example error response:
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "API rate limit exceeded",
"details": "Request rate of 10 per second exceeded"
}
}```
We recommend implementing proper error handling in your applications to gracefully manage these scenarios.
## Best Practices
1. Implement exponential backoff for rate limit errors (429 status code).
2. Use a unique `user_token` for each user to ensure we can employ industry leading data privacy and protection.
3. Monitor your API usage through our [dashboard](https://dashboard.kidsmart.ai) to avoid hitting limits unexpectedly.
For any questions about error handling or to report unexpected errors, please contact our support team at it@kidsmart.ai.