The examples on this page use the latest model
kimi-k3 by default. K3 configures reasoning effort with the top-level reasoning_effort request field (supports "low" / "high" / "max", default "max"). To use another model such as kimi-k2.6 or kimi-k2.5, just replace the model field — parameter configurations differ across models. See the Model Parameter Reference.- python
- node.js
- Upload the file to the Kimi server using the
/v1/filesinterface or thefiles.createAPI in the SDK; - Retrieve the file content using the
/v1/files/{file_id}interface or thefiles.contentAPI in the SDK. The retrieved content is already formatted in a way that our recommended model can easily understand; - Place the extracted (and formatted) file content (not the file
id) in the messages list as a system prompt; - Start asking questions about the file content;
id.
Q&A on Multiple Files
If you want to ask questions based on multiple files, it’s quite simple. Just place each file in a separate system prompt. Here’s how you can do it in code:- python
- node.js
Best Practices for File Management
In general, the file upload and extraction features are designed to convert files of various formats into a format that our recommended model can easily understand. After completing the file upload and extraction steps, the extracted content can be stored locally. In the next file-based Q&A request, there is no need to upload and extract the files again. Since we have limited the number of files a single user can upload (up to 1000 files per user), we suggest that you regularly clean up the uploaded files after the extraction process is complete. You can periodically run the following code to clean up the uploaded files:- python
- node.js
files.list API and then delete each file using the files.delete API. Regularly performing this operation ensures that file storage space is released, allowing subsequent file uploads and extractions to be successful.