Unofficial Node.js client untuk DeepSeek Chat β reverse-engineered dari web API-nya langsung. Mendukung login, multi-turn conversation, upload file, dan thinking mode.
β οΈ Disclaimer: Library ini menggunakan internal API DeepSeek yang tidak resmi. Bisa berubah sewaktu-waktu tanpa pemberitahuan. Gunakan dengan bijak dan sesuai ToS DeepSeek.
- π Login & logout dengan email/password
- π¬ Single chat (
quickChat) dan multi-turn conversation per session - π§ DeepSeek Thinking mode (R1-style)
- π Web search toggle
- π Upload file & kirim ke chat
- π Proof-of-Work (PoW) otomatis via WASM
- π‘οΈ AWS WAF bypass otomatis (NetworkBandwidth / HashcashScrypt / SHA256)
- πͺ Cookie & token management otomatis
- π Proxy support (HTTP/HTTPS)
git clone https://github.com/XBotzLauncher/deepseek.git
cd deepseek
npm installDependencies:
form-dataβ untuk upload fileaxios+axios-cookiejar-support+tough-cookieβ untuk WAF solverhttps-proxy-agentβ untuk proxy support (opsional)sha3_wasm.wasmβ sudah include di repo (digunakan untuk PoW solving)webgl.jsonβ sudah include di repo (GPU pool untuk WAF fingerprint)
const { DeepSeekClient } = require('./deepseek');
const client = new DeepSeekClient();
await client.login('email@example.com', 'password');
const reply = await client.quickChat('Halo! Siapa kamu?');
console.log(reply.content);
await client.logout();const client = new DeepSeekClient({ proxy: 'http://user:pass@host:port' });
await client.login('email@example.com', 'password');
const reply = await client.quickChat('Halo!');
console.log(reply.content);const client = new DeepSeekClient();
await client.login('email@example.com', 'password');
const sessionId = await client.createSession();
const r1 = await client.chat(sessionId, 'Nama gw Budi');
console.log(r1.content);
const r2 = await client.chat(sessionId, 'Tadi nama gw siapa?');
console.log(r2.content); // "Nama kamu Budi"
await client.logout();const client = new DeepSeekClient();
await client.login('email@example.com', 'password');
const sessionId = await client.createSession();
const fileId = await client.uploadFile('./foto.jpg', 'foto.jpg', 'image/jpeg');
await client.waitForFile(fileId); // tunggu sampai file diproses
const reply = await client.chat(sessionId, 'Ini gambar apa?', { fileIds: [fileId] });
console.log(reply.content);const client = new DeepSeekClient();
client.setToken('token-lo-di-sini');
const reply = await client.quickChat('Halo!');
console.log(reply.content);Buat instance client baru.
| Param | Type | Default | Keterangan |
|---|---|---|---|
opts.proxy |
string |
null |
URL proxy HTTP/HTTPS (opsional) |
Login ke DeepSeek. Secara otomatis menyelesaikan AWS WAF challenge sebelum request login dikirim.
| Param | Type | Keterangan |
|---|---|---|
email |
string |
Email akun DeepSeek |
password |
string |
Password akun |
Returns: { ok: true, token: string }
Set token autentikasi secara manual, tanpa perlu login.
| Param | Type | Keterangan |
|---|---|---|
token |
string |
Bearer token dari DeepSeek |
Logout, hapus token, dan reset status WAF.
Buat sesi chat baru.
Returns: string β sessionId
Kirim pesan dalam sesi tertentu (mendukung multi-turn).
| Param | Type | Default | Keterangan |
|---|---|---|---|
sessionId |
string |
β | ID sesi dari createSession() |
message |
string |
β | Pesan yang dikirim |
opts.thinking |
boolean |
false |
Aktifkan thinking mode |
opts.search |
boolean |
true |
Aktifkan web search |
opts.fileIds |
string[] |
[] |
ID file yang sudah diupload |
Returns: { content: string, message_id: string }
Shortcut: buat sesi baru + langsung chat dalam satu langkah.
Returns: { content: string, message_id: string }
Upload file ke DeepSeek.
| Param | Type | Keterangan |
|---|---|---|
filePathOrBuffer |
string | Buffer |
Path file atau Buffer |
filename |
string |
Nama file |
mimeType |
string |
MIME type (default: application/octet-stream) |
Returns: string β fileId
Polling sampai file selesai diproses server DeepSeek.
| Param | Type | Default | Keterangan |
|---|---|---|---|
fileId |
string |
β | ID file dari uploadFile() |
opts.maxAttempts |
number |
10 |
Maksimal percobaan |
opts.intervalMs |
number |
2000 |
Jeda antar percobaan (ms) |
Semua error dilempar sebagai instance DeepSeekError:
try {
await client.login('wrong@email.com', 'wrongpass');
} catch (err) {
console.log(err.name); // "DeepSeekError"
console.log(err.message); // pesan error
console.log(err.code); // kode error, e.g. "AUTH_NO_TOKEN"
console.log(err.data); // raw response dari server (jika ada)
}Kode error umum:
| Code | Keterangan |
|---|---|
AUTH_NO_TOKEN |
Login gagal, token tidak ditemukan |
WAF_FAILED |
AWS WAF challenge gagal diselesaikan |
SESSION_CREATE_FAILED |
Gagal membuat sesi chat |
POW_FAILED |
Gagal solve Proof-of-Work |
FILE_NOT_FOUND |
File ID tidak ditemukan |
FILE_TIMEOUT |
File tidak selesai diproses sebelum timeout |
TIMEOUT |
Request timeout (30 detik) |
STREAM_ERROR |
Error saat baca SSE stream |
HTTP_4xx / HTTP_5xx |
HTTP error dari server |
deepseek/
βββ deepseek.js # Core client library
βββ aws-waf-solver.js # AWS WAF challenge solver
βββ sha3_wasm.wasm # WASM binary untuk PoW (jangan dihapus)
βββ webgl.json # GPU pool untuk WAF browser fingerprint
βββ tes.js # Contoh penggunaan
βββ package.json
MIT