API Error Codes

You may encounter the following error codes when calling the Kimi API. Use the code and description to troubleshoot the issue.

Error Code Reference

Error codeMeaningWhat to do
400Invalid request parameters (Bad Request)Check whether the request body is correctly formatted and whether parameter names and types meet the documentation requirements. Common causes include malformed JSON, missing required parameters, or parameter values outside the allowed range.
401Authentication failed (Unauthorized)Check whether your API Key is correct, expired, or disabled. Make sure the request header uses the correct format: Authorization: Bearer <your-api-key>.
403Insufficient permissions/Insufficient Balance (Forbidden)Your account balance may have been used up. Please top up in the console. Your account may also be restricted; contact support for help.
404Resource not found (Not Found)Check whether the requested URL path and model name are correct. Make sure the endpoint is https://klmi.io/v1/....
429Rate limit exceeded (Too Many Requests)You have exceeded the current rate limit. Reduce your request frequency, implement exponential backoff retries, or contact support to request a higher rate limit.
500Internal Server Error (Internal Server Error)A temporary server-side error occurred. Please try again later. If the issue persists, contact [email protected] and include the request_id.

General Troubleshooting Tips

  1. Check the full error message: The JSON response returned by the API usually includes the error.message field with a more detailed error description.
  2. Check the request_id: The request_id returned for each request can help support quickly locate the issue.
  3. Refer to the official documentation: Make sure your integration matches the documentation at platform.kimi.com.
  4. Use a retry mechanism: For 429 and 500 errors, we recommend implementing automatic retries with an exponential backoff strategy.
Kimi API Error Code Reference - Kimi Help Center