API - Error Code 400 or 401 (API Key)

  • Updated

Most commonly occur if not properly passing API key or if exceeding the character input limit.

Character Input Limits for Each Plan

  • Non signed in accounts: 333
  • Free: 2,500
  • All paid plans: 5,000

If you get 400: max_character_limit_exceeded when sending more than 333 characters, but less than 2,500 with a free account or less than 5,000 with a paid subscription, you have not sent your API key properly. If you had attempted to set your API key but still receive 400 or 401, double check that you have used "xi-api-key" exactly with no typos when setting your API key. The API will still work normally with no API key temporarily to allow users to try out the API. However, this can cause confusion since users see it working at first but then start getting unexpected errors. Example 400 response detail:

"detail": {
    "status": "max_character_limit_exceeded",
    "message": "This request's text has 627 characters and exceeds the character limit of 333 characters for non signed in accounts."}

Example 401 Unauthorized response detail:

"detail": {
     "status": "quota_exceeded",
     "message": "Thanks for trying out our speech synthesis! You have reached the limit of available requests on the landing page. You can continue, for free, by signing-up to the platform."}