Errors with status code 4xx
Error class overview
These are so-called client errors which indicate that the request is incorrect or cannot be processed by the server.
400 Bad Request — The request is malformed (e.g., syntax errors or invalid parameters).
401 Unauthorized — Authentication is required.
403 Forbidden — Access is denied, even if authentication was successful.
404 Not Found — The requested resource was not found.
429 Too Many Requests — The client has exceeded the request limit.
The most frequently received messages
The most frequently received messages in this class are shown below. We will gradually expand this list.
400
"Body validation error!"
Your request was not processed due to incorrectly filled parameters. Check the API schema for the selected model. Development environments usually provide more detailed hints about which parameter or at least which line caused the issue. Look for the hints "Expected" and "Received" — this is the easiest way to identify which parameters were incorrect.
400
"Query validation error!"
An alternative version of the previous message, but for Query section of your code.
400
"Unsupported value: 'messages[0].role' does not support 'system' with this model."
The provided value is not supported by the selected model. Check the API schema for a list of supported values for this text model.
403
"You have exhausted the available [plan.rule:api_token] resource limit. Update your payment method to continue using the service. For more information please visit https://aimlapi.com/app/billing"
You have reached the daily call limit for your current plan.
Example #1: Body validation error
Below is an example of an error a user encountered after mixing up the prompt
and model
parameters—attempting to pass video generation instructions into the parameter meant for specifying the model ID to be used for generation.
Last updated
Was this helpful?