Errors
Error formats and troubleshooting
The forms of errors
The errors should be sent to error.message, along with the reasons and solutions. The details related to error.code should be included in the following values. The text can be changed, so please separate it in the code using code and status values.
{
"error": {
"message": "Insufficient credits. Add credits or reduce max_tokens.",
"type": "insufficient_credits",
"code": "insufficient_credits",
"param": null
}
}/messages is returned in a form similar to that of Anthropic.
{
"type": "error",
"error": { "type": "billing_error", "message": "Insufficient credits. Add credits or reduce max_tokens." }
}Conversation text is limited to about 400 KB. Before running security rules, we sum the UTF-16 lengths of the text to inspect. The initial thresholds are 400,072 code units for conversations and 400,000 for embeddings. Text outside the normal conversation limit, such as an output schema, is scanned separately if the request passes the endpoint’s size check. Image and file data have separate limits.
An error that can be corrected and sent again.
408,429,503can be sent again after a short while. Please continue to send them, gradually increasing the spacing between them.- For
400,401,402,403,404,413and422, update the request or account before retrying.
Error code
| Status | code | Please try doing this. |
|---|---|---|
| 400 | invalid_json | Please check the JSON format. |
| 400 | invalid_request | The values may be incorrect or the format may be different. Please check the values listed in the text. |
| 400 | model_required | Please write down the model or models. |
| 400 | wrong_endpoint | Please send the data to the /chat/completions for the dialogue model. For the embedding model, send it to /embeddings. And for the video model, send it to /videos. |
| 400 | tools_not_supported | Please switch to a model that can receive tool calls. |
| 400 | tools_need_no_reasoning | Please set the “reasoning_effort” to 0, or send it as “none”. |
| 400 | forced_tool_not_supported | Please send tool_choice automatically. |
| 400 | response_format_not_supported | Please use a format that matches the model’s requirements, or let me know using prompts. |
| 400 | n_not_supported | Please remove “n” from it. |
| 400 | max_tokens_too_large | Please reduce max_tokens to below the maximum output length of the model. |
| 400 | images_not_supported | Change it to a model that can read images. |
| 400 | image_fetch_failed | Please check the image URL or send it as a data URL. |
| 400 | too_many_images | Please reduce the number of images. |
| 400 | too_many_inputs | The embedding model has exceeded the number of messages it can handle at once. Please send the messages in such a way that the number of messages is divided by the number of messages specified in the text. |
| 400 | plugin_not_supported | Please remove the plugin that isn’t being received. |
| 400 | transforms_not_supported | Please remove “transforms” before sending it. |
| 400 | data_policy_not_supported | Please remove the conditions related to data collection and ZDR before sending the request. |
| 400 | content_filter | It has violated the safety standards set by the supplier. Please send the content in a different way. |
| 400 | provider_rejected | The supplier did not receive the requested amount. Please check the reasons listed in the document. |
| 400 | stateless_only | Please send the entire conversation as input, instead of just the previous_response_id. |
| 400 | unsupported_input | Please send only the text, images, and function tools. |
| 400 | model_not_supported_for_tool | Please switch to the model listed in the text. |
| 401 | missing_api_key | Please include “Bearer” and “Key” in the authorization header. |
| 401 | invalid_api_key | Please check the keys again in the console. |
| 402 | insufficient_credits | Please charge it or reduce the max_tokens. |
| 402 | key_limit_reached | Please increase the limits set for Kie. |
| 401 | key_expired | Change the expiration date in the console, or create a new key. |
| 403 | key_paused | Please restart the console. |
| 403 | wrong_key_type | When invoking the model, use the standard keys. For managing keys, please use the key management API. |
| 403 | management_key_readonly | The administrative keys should be changed in the console. |
| 400 | key_limit_exceeded | Please delete those unused keys. You can create up to 50 keys. |
| 404 | key_not_found | Please check your key ID. |
| 403 | ip_not_allowed | Please call from the IP addresses allowed by Kie, or change the address in the console settings. |
| 403 | model_not_allowed | You can call the model that Kier has allowed, or modify the model in the console. |
| 404 | model_not_found | Please check the name in the model list. |
| 404 | no_endpoints | Please check the conditions regarding the provider. |
| 404 | no_eligible_model | Please check the models that are allowed for automatic selection. |
| 404 | generation_not_found | Please check the request ID. |
| 413 | request_too_large | Please reduce the total size of the request to less than 20MB. |
| 403 | prompt_injection_detected | Review new input and tool results for phrases that match your organization’s injection blocking rules. |
| 403 | prompt_pii_detected | Remove values that match your organization’s personal data rules from the input and resend the request. |
| 403 | prompt_api_key_detected | Remove the key or token copied into the input text and resend the request. |
| 503 | prompt_scan_busy | Large security scans are busy. Retry after the delay in Retry-After. |
| 422 | prompt_scan_failed | The security check could not finish. The request stopped before reaching a model. Shorten or split your input. |
| 413 | input_too_long | Please reduce the size of the text to less than 400KB, and also reduce the number of images. |
| 429 | rate_limited | Please send the message again after the time indicated in the “Retry-After” field. |
| 408 | timeout | Please divide the requests or reduce the length of the output. |
| 503 | provider_unavailable | Please send it again later, or write down other models along with it. |
| 503 | stream_interrupted | While I was getting the answer, the connection was cut off. Please send it again. |
| 503 | provider_busy | If other models are listed in the models section, they will be automatically skipped. |
| 500 | internal_error | It’s a problem from our side. Please let us know the request ID along with this issue. |