Chat with AI using the wrtn.ai API
To install dependencies:
bun installimport { Client } from "./wrtn";
const client = new Client("token", "refresh token");
const chat = await client.newChat();
const response = await chat.sendMessage("안녕");
console.log(response);안녕하세요! 어떻게 도와드릴까요?
- Log in to wrtn.ai
- Open Developer Tools
- Press
Ctrl + Shift + Ito open the Developer Tools.
- Press
- Copy the Authorization Header Value
- In the network requests, find the
Authorizationheader value (e.g.,eyJhbGciOi...). - This value is your token.
- In the network requests, find the
- Copy the Refresh Token
- Go to the "Application" tab -> "Cookies" ->
https://wrtn.ai. - Copy the value of
refresh_token(e.g.,eyJhbGciOi...). - This value is your refresh token.
- Go to the "Application" tab -> "Cookies" ->