A Node.js unofficial library for interacting with the Claude.ai API.
npm install claude-no-api
-
You can get cookie from the browser's developer tools network tab ( see for any claude.ai requests check out cookie ,copy whole value ) or storage tab ( You can find cookie of claude.ai ,there will be four values )
-
(Checkout below image for the format of cookie ,It is Better to Use from network tab to grab cookie easily )
const Claude = require('claude-no-api');
const client = new Claude('session_cookie');
client.listAllConversations()
.then(conversations => {
// use conversations
})
.catch(err => {
console.error(err);
});
client.sendMessage('Hello', 'conversation_id')
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
The Claude class provides the following methods:
getOrganizationId()
- Returns the organization UUID for the given cookiegetContentType()
- Get content type for a file based on extensionlistAllConversations()
- Get all conversations for the organizationsendMessage(prompt, conversationId, attachment)
- Send a message to a conversationdeleteConversation(conversationId)
- Delete a conversationchatConversationHistory(conversationId)
- Get message history for a conversationgenerateUuid()
- Generate a random UUIDcreateNewChat()
- Create a new conversationresetAll()
- Delete all conversationsuploadAttachment(filePath)
- Upload an attachmentrenameChat(title, conversationId)
- Rename a conversation
All methods return promises.
Pull requests are welcome! Feel free to open issues for any bugs or desired features.
MIT