Skip to main content

Error Response Format

When the Klyra API encounters an error, it returns a JSON response with an error object containing the following properties:
  • code: A machine-readable identifier for the error
  • message: A human-readable explanation of what went wrong
  • type: The category of error
  • param: When applicable, the specific parameter that caused the error
  • request_id: A unique identifier for the request, useful when contacting support

Authentication Errors

Request Errors

Rate Limit Errors

Server Errors

Content-Specific Errors

Handling Errors

Here’s an example of how to handle errors in your code:

Best Practices

  1. Always implement error handling in your integration with the Klyra API
  2. Use exponential backoff when encountering rate limiting errors
  3. Log the request_id for troubleshooting and support
  4. Validate content before sending it to the API
  5. Handle authentication errors by prompting for a new API key
If you encounter persistent errors, contact our support team with the request_id and details about your implementation.