Errors

Learn how to handle errors and troubleshoot issues with the Phonix AI Synthesis API.

Mistakes happen—most commonly due to incorrect input data, network problems, or server issues. This guide explains what to do when things go wrong and how to resolve common errors.

You can determine if your request was successful by checking the status code in the API response. For unsuccessful responses, use the error type and message provided to debug before contacting support.

Note: The majority of reported issues (over 99%) stem from user errors. Please double-check your code and configurations before reaching out to Phonix AI support.


Status Codes

Here are common status codes you might encounter while using the Phonix AI Synthesis API:

  • 200 - OK: Request successful.

  • 400 - Bad Request: Invalid input or malformed request.

  • 401 - Unauthorized: API key is missing or invalid.

  • 403 - Forbidden: Access to the resource is denied.

  • 404 - Not Found: The requested resource does not exist.

  • 429 - Too Many Requests: Rate limit exceeded.

  • 500 - Internal Server Error: A server error occurred.

  • 503 - Service Unavailable: The server is temporarily unavailable.


Error Types

When a request fails, the API responds with an error type and message to help identify the issue. Below are common error types and their resolutions:

  • API_KEY_REQUIRED: Include your API key in the x-api-key header.

  • USER_NOT_FOUND: Verify your account registration and API key validity.

  • API_KEY_NOT_FOUND: Ensure the correct API key is used.

  • NOT_ENOUGH_CREDIT: Check your account balance and add credits if needed.

  • TEXT_TOO_LONG: Limit text input to 10,000 characters.

  • MAXIMUM_FILE_SIZE_EXCEED: Upload files within the allowed size limit.

  • FILE_TYPE_NOT_ALLOWED: Use supported file types only.

  • PDF_MORE_THAN_400_PAGES: Limit PDFs to fewer than 400 pages.

  • PLAN_MAX_FILE_SIZE_EXCEED: Upgrade your plan to process larger files.

  • PREMIUM_PLAN_REQUIRED: Upgrade to a premium plan for this action.

  • VOICE_NOT_FOUND: Verify the voice ID in your request.

  • VOICE_NOT_ACTIVE: Activate the voice in your account settings.

  • FORBIDDEN: Confirm you have the necessary permissions.

  • SYSTEM_ERROR: Retry later or contact support if the issue persists.

Example error response:

jsonCopy code{
  "detail": {
    "error_code": "API_KEY_NOT_FOUND",
    "message": "API key is not found"
  }
}

Troubleshooting

Follow these steps to resolve common errors:

  1. Check the error message: Read the message for clues about the issue.

  2. Review the error type: Use the error type to pinpoint the problem.

  3. Verify input data: Ensure parameters are correct and properly formatted.

  4. Check network connection: Confirm your internet connection is stable.

  5. Server status: Verify that the Phonix AI Synthesis API is operational.

  6. Contact support: If the issue persists, provide detailed error information to the support team for assistance.

By carefully following these steps, you can resolve most issues and ensure a smooth experience with the Phonix AI Synthesis API.

Last updated