import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const aiChat = await client.aiChats.retrieve('aich_xxxxxxxxxxxxx');
console.log(aiChat.id);{
"id": "aich_xxxxxxxxxxxxx",
"title": "Weekly Revenue Analysis",
"notification_preference": "all",
"message_count": 42,
"blended_token_usage": "123.45",
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"last_message_at": "2023-12-01T05:00:00.401Z",
"user": {
"id": "user_xxxxxxxxxxxxx"
}
}Retrieves the details of an existing AI chat.
import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const aiChat = await client.aiChats.retrieve('aich_xxxxxxxxxxxxx');
console.log(aiChat.id);{
"id": "aich_xxxxxxxxxxxxx",
"title": "Weekly Revenue Analysis",
"notification_preference": "all",
"message_count": 42,
"blended_token_usage": "123.45",
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"last_message_at": "2023-12-01T05:00:00.401Z",
"user": {
"id": "user_xxxxxxxxxxxxx"
}
}A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
The unique identifier of the AI chat to retrieve.
"aich_xxxxxxxxxxxxx"
A successful response
An AI-powered chat conversation belonging to a user, with optional scheduled automation.
The unique identifier for the ai chat.
"aich_xxxxxxxxxxxxx"
A short descriptive title for this AI chat conversation. Null if no title has been set.
"Weekly Revenue Analysis"
The notification preference for this AI chat. all delivers AI chat notifications and badges, while none mutes them.
all, none The total number of messages exchanged in this conversation.
42
The total number of tokens consumed across all messages in this conversation.
"123.45"
The datetime the ai chat was created.
"2023-12-01T05:00:00.401Z"
The datetime the ai chat was last updated.
"2023-12-01T05:00:00.401Z"
The timestamp of the most recent message in this conversation. Null if no messages have been sent yet.
"2023-12-01T05:00:00.401Z"
The user who owns this AI chat conversation.
Show child attributes
Was this page helpful?