Skip to main content

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

Cause: The X-App-Key header is missing or the key is incorrect/inactive.Solution:
  • Verify your API key is correct and active in the Dashboard.
  • Ensure the key is passed via X-App-Key header or Authorization: Bearer <key>.
  • If using an SDK, check that api_key / apiKey is set or the PMTINSP_API_KEY environment variable is defined.
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.
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_text field with a non-empty string value.
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.
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 / baseUrl is 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.