npm i @jacksontian/kimi # for scriptingimport Kimi from '@jacksontian/kimi';
const client = new Kimi({
// Do not hard code it here, read it from configuration or enviroment variables
apiKey: 'The API key for moonshot AI'
});
const response = await client.models();-
Chat
chat()models()estimateTokenCount()
-
Files
putFile()putFileStream()files()getFile()getFileContent()deleteFile()
-
Others
getBalance()
The detail of parameters can be found at https://platform.moonshot.cn/docs/api-reference or test/kimi.test.js.
The MIT license.