HTTP Status Codes
The Prompt Inspector API uses standard HTTP status codes to indicate the outcome of a request.Error Response Format
All error responses follow this structure:SDK Exceptions
Both SDKs provide a typed exception hierarchy so you can handle errors precisely.Exception Hierarchy
Python
Node.js / TypeScript
Common Errors & Solutions
413 Payload Too Large — Text exceeds maximum length
413 Payload Too Large — Text exceeds maximum length
Cause: The
input_text exceeds the maximum character limit for your subscription plan.Solution:- Truncate or split your input text before sending.
- Upgrade your plan at promptinspector.io for higher limits.
422 Unprocessable Entity — Invalid request body
422 Unprocessable Entity — Invalid request body
Cause: The request body is malformed or missing the required
input_text field.Solution:- Ensure the request body is valid JSON with
Content-Type: application/json. - Include the
input_textfield with a non-empty string value.
429 Too Many Requests — Rate limit exceeded
429 Too Many Requests — Rate limit exceeded
Cause: You have exceeded the per-minute rate limit or monthly request quota for your plan.Solution:
- Implement exponential backoff and retry logic.
- Check your current usage in the Dashboard.
- Upgrade your plan for higher rate limits and quotas.
Connection / Timeout errors
Connection / Timeout errors
Cause: Network issues or the API server is temporarily unreachable.Solution:
- Check your network connectivity.
- Increase the timeout setting in your SDK client.
- Implement retry logic with exponential backoff.
- Verify the
base_url/baseUrlis correct (default:https://promptinspector.io).
Retry Strategy
For production applications, we recommend implementing a retry strategy with exponential backoff:For persistent issues, contact us at [email protected] or open an issue on GitHub.

