Skip to content
Docs ·Errors

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, 503 can be sent again after a short while. Please continue to send them, gradually increasing the spacing between them.
  • For 400, 401, 402, 403, 404, 413 and 422, update the request or account before retrying.

Error code

StatuscodePlease try doing this.
400invalid_jsonPlease check the JSON format.
400invalid_requestThe values may be incorrect or the format may be different. Please check the values listed in the text.
400model_requiredPlease write down the model or models.
400wrong_endpointPlease 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.
400tools_not_supportedPlease switch to a model that can receive tool calls.
400tools_need_no_reasoningPlease set the “reasoning_effort” to 0, or send it as “none”.
400forced_tool_not_supportedPlease send tool_choice automatically.
400response_format_not_supportedPlease use a format that matches the model’s requirements, or let me know using prompts.
400n_not_supportedPlease remove “n” from it.
400max_tokens_too_largePlease reduce max_tokens to below the maximum output length of the model.
400images_not_supportedChange it to a model that can read images.
400image_fetch_failedPlease check the image URL or send it as a data URL.
400too_many_imagesPlease reduce the number of images.
400too_many_inputsThe 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.
400plugin_not_supportedPlease remove the plugin that isn’t being received.
400transforms_not_supportedPlease remove “transforms” before sending it.
400data_policy_not_supportedPlease remove the conditions related to data collection and ZDR before sending the request.
400content_filterIt has violated the safety standards set by the supplier. Please send the content in a different way.
400provider_rejectedThe supplier did not receive the requested amount. Please check the reasons listed in the document.
400stateless_onlyPlease send the entire conversation as input, instead of just the previous_response_id.
400unsupported_inputPlease send only the text, images, and function tools.
400model_not_supported_for_toolPlease switch to the model listed in the text.
401missing_api_keyPlease include “Bearer” and “Key” in the authorization header.
401invalid_api_keyPlease check the keys again in the console.
402insufficient_creditsPlease charge it or reduce the max_tokens.
402key_limit_reachedPlease increase the limits set for Kie.
401key_expiredChange the expiration date in the console, or create a new key.
403key_pausedPlease restart the console.
403wrong_key_typeWhen invoking the model, use the standard keys. For managing keys, please use the key management API.
403management_key_readonlyThe administrative keys should be changed in the console.
400key_limit_exceededPlease delete those unused keys. You can create up to 50 keys.
404key_not_foundPlease check your key ID.
403ip_not_allowedPlease call from the IP addresses allowed by Kie, or change the address in the console settings.
403model_not_allowedYou can call the model that Kier has allowed, or modify the model in the console.
404model_not_foundPlease check the name in the model list.
404no_endpointsPlease check the conditions regarding the provider.
404no_eligible_modelPlease check the models that are allowed for automatic selection.
404generation_not_foundPlease check the request ID.
413request_too_largePlease reduce the total size of the request to less than 20MB.
403prompt_injection_detectedReview new input and tool results for phrases that match your organization’s injection blocking rules.
403prompt_pii_detectedRemove values that match your organization’s personal data rules from the input and resend the request.
403prompt_api_key_detectedRemove the key or token copied into the input text and resend the request.
503prompt_scan_busyLarge security scans are busy. Retry after the delay in Retry-After.
422prompt_scan_failedThe security check could not finish. The request stopped before reaching a model. Shorten or split your input.
413input_too_longPlease reduce the size of the text to less than 400KB, and also reduce the number of images.
429rate_limitedPlease send the message again after the time indicated in the “Retry-After” field.
408timeoutPlease divide the requests or reduce the length of the output.
503provider_unavailablePlease send it again later, or write down other models along with it.
503stream_interruptedWhile I was getting the answer, the connection was cut off. Please send it again.
503provider_busyIf other models are listed in the models section, they will be automatically skipped.
500internal_errorIt’s a problem from our side. Please let us know the request ID along with this issue.