Nanonets uses standard HTTPs response codes to indicate the success or failure of an API request. Understanding these codes can help you identify the nature of the response and take appropriate actions:

Success Responses (2xx)

  • 200 OK: The request has succeeded. The client can read the result of the request in the body and the headers of the response.
  • 206 Request partially successful: The request has been accepted for processing, but the processing is not complete. This status code is often used to indicate that the request is being processed. It specifically denotes that one or more of the URLs provided in the request may be incorrect or did not respond as expected.

Error Responses (4xx) & (5xx)

Error TypeError CodeHTTP Status CodeDescriptionSuggested Action
Client Error Responses (4xx)400400 Bad RequestThe request was unacceptable, often due to missing a required parameter.Double-check the request parameters to ensure all required fields are included.Example: Check if file urls are missing or path entered is valid.
Client Error Responses (4xx)401401 UnauthorizedThe API key was missing or invalid.Ensure that your API key is correct and has the necessary permissions for the request.
Client Error Responses (4xx)402402 Exhausted Free API CallsYou have exhausted your free API calls please change your plan.Consider contacting Sales team to upgrade the rate-limits to allows more requests.
Reach out to us at [email protected] .
Client Error Responses (4xx)403403 ForbiddenThe request was legal, but the server is refusing to respond to it.Check if the API key has restrictions that prevent access to the requested resources.
Client Error Responses (4xx)404404 Not FoundThe requested resource could not be found but may be available in the future.Verify the URL and the resource identifier. Model does not exists. Check if you have entered correct model id with valid API key.
Client Error Responses (4xx)429429 Too Many RequestsYou have hit the rate limit for requests.Reduce the number of requests, implement retry strategies, and consider distributing requests over time.
Server Error Responses (5xx)500500 Internal Server ErrorWe had a problem with our server. Try again later.If the issue persists, contact support with the time of the request and error details. Please check status.nanonets.com
Server Error Responses (5xx)503503 Service UnavailableThe server is overloaded or down for maintenance.Wait a few minutes, then retry the request. Please check status.nanonets.com

When an error occurs, the API will return a response in the following format to help diagnose the problem:

Key Components:

  • message: A brief summary of the error type.
  • code: The HTTP status code associated with the error, providing a quick indication of what went wrong.
  • errors: An array of error objects, each including:
    • reason: A short statement identifying the cause of the error.
    • message: A detailed explanation of the issue and a direct link to the relevant section of the documentation for guidance on how to resolve it.
{
    "message": "brief_summary",
    "code": error_code,
    "errors": [
        {
            "reason": "error_cause",
            "message": "detailed_explanation"
        }
    ]
}