Errors

Error Handling and Status Codes

Detailed guide on the error codes and messages returned by the Aipify API.

Error Messages:

  • Unauthorized (401): Indicates an invalid or missing authorization token in the request header. "API endpoint not provided" (400): The request is missing the required api parameter specifying the endpoint name.
  • API endpoint not found (404): The requested API endpoint does not exist or is not accessible to the user.
  • Daily quota exceeded (429): The user has reached their daily quota for API calls.
  • Unexpected response from OpenAI (500): An unexpected error occurred during communication with the OpenAI API.

Additional Notes:

Each error message is accompanied by a corresponding HTTP status code that provides further context about the nature of the error. Refer to the standard HTTP status code definitions for detailed information on each code and its implications. Example:

If you attempt to access an API endpoint without providing a valid authorization token, you will receive a response with the following details:

{
  "data": "Unauthorized",
  "status": 401
}

This response indicates that the request was unauthorized (status code 401) due to a missing or invalid token.

By understanding these error messages and status codes, you can effectively troubleshoot issues and ensure successful interactions with the Aipify API.


Copyright © 2024