Terminal UI coding agent powered by DeepSeek Web API. A Claude Code alternative that works through a local proxy.
- Terminal UI — Full-screen chat interface with ANSI colors
- Markdown Rendering — Code blocks, bold, italic, inline code highlighting
- Tool Execution — Read/write files, patch code, list directories, run commands
- Permission System — Ask before executing tools or bypass for automation
- Model Switching — Switch between DeepSeek models on the fly (
/model) - Reasoning Display — View model's thinking process (Ctrl+O)
- Server Logs — Monitor proxy logs in real-time (Ctrl+J)
- Session Management — Clear chat with
/new
- Node.js v18+ installed
- FreeDeepseekAPI proxy running on
localhost:9655 - Chrome browser (for proxy authentication)
# Clone the repository
git clone https://github.com/ForgetMeAI/FreeDeepseekAPI.git
cd FreeDeepseekAPI
# Install dependencies
npm install
# Make nithcode globally available
npm linkOr manually copy nithcode.js and create a batch/shell script.
In one terminal:
cd FreeDeepseekAPI
node server.jsSelect option 3 (Start Server) in the menu.
If you haven't authenticated yet:
npm run deepseek:authThis will open Chrome and save cookies for API access.
In another terminal:
nithcodeOr with specific model:
nithcode --model deepseek-v4-pro| Command | Description |
|---|---|
/model |
Open model selection menu |
/new |
Clear conversation history |
Ctrl+C |
Exit |
Ctrl+O |
Toggle reasoning overlay (thinking models) |
Ctrl+J |
Toggle server logs |
Ctrl+L |
Clear screen |
- ask (default) — Confirm each tool execution
- bypassPermissions — Auto-approve all tools
Launch with bypass mode:
nithcode --permission-mode bypassPermissions| Variable | Default | Description |
|---|---|---|
NITHCODE_MODEL |
deepseek-chat |
Default model |
NITHCODE_BASE_URL |
http://localhost:9655/v1 |
API endpoint |
NITHCODE_API_KEY |
nithcode-local |
API key |
NITHCODE_PERMISSION_MODE |
ask |
Permission mode |
NITHCODE_MAX_TOKENS |
8192 |
Max tokens per request |
deepseek-chat— General chatdeepseek-v3— Latest V3 modeldeepseek-reasoner— Thinking/reasoning modeldeepseek-r1— R1 reasoning modeldeepseek-v4-pro— V4 Pro with reasoningdeepseek-chat-search— Chat with web searchdeepseek-expert— Expert mode
┌─────────────┐ HTTP ┌──────────────────┐ WebSocket ┌─────────────┐
│ nithcode │ ◄────────────► │ FreeDeepseekAPI │ ◄───────────────► │ DeepSeek │
│ (client) │ localhost │ (proxy) │ cookies/auth │ (web) │
└─────────────┘ :9655 └──────────────────┘ └─────────────┘
Make sure FreeDeepseekAPI server is started in another terminal:
node server.js
# Select 3 (Start Server)- Check proxy logs with
Ctrl+J - Verify cookies are valid:
npm run deepseek:auth - Try switching model:
/model
Port 9655 is occupied. Kill existing Node processes:
# Windows
taskkill /F /IM node.exe
# Linux/Mac
killall nodeMIT — see LICENSE
- Original proxy: ForgetMeAI/FreeDeepseekAPI
- Powered by DeepSeek
curl -X POST http://localhost:9655/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat-search",
"messages": [{"role": "user", "content": "Найди свежий факт про DeepSeek и ответь кратко."}],
"stream": false
}'curl -N -X POST http://localhost:9655/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat",
"messages": [{"role": "user", "content": "Напиши короткую шутку."}],
"stream": true
}'curl -X POST http://localhost:9655/v1/messages \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat",
"max_tokens": 512,
"messages": [{"role": "user", "content": "Ответь ровно OK"}],
"stream": false
}'Для Claude Code можно указывать backend напрямую:
export ANTHROPIC_BASE_URL="http://127.0.0.1:9655"
export ANTHROPIC_AUTH_TOKEN="dummy-key"
export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
claude --model deepseek-chatcurl -X POST http://localhost:9655/v1/responses \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat",
"input": "Ответь ровно OK",
"stream": false
}'FreeDeepseekAPI принимает:
- OpenAI
tools; - Anthropic
tools; - Responses API function tools.
Прокси просит DeepSeek вернуть строгий JSON tool call, но также умеет парсить fallback-форматы:
TOOL_CALL:- fenced JSON
<tool_call>...</tool_call>
GET /v1/models возвращает только aliases, которые сейчас проверены и работают через этот proxy.
| Alias | Web mode | Reasoning | Web search | Комментарий |
|---|---|---|---|---|
deepseek-chat |
Быстрый / default |
нет | нет | базовый chat |
deepseek-v3 |
Быстрый / default |
нет | нет | совместимый alias |
deepseek-default |
Быстрый / default |
нет | нет | совместимый alias |
deepseek-reasoner |
Быстрый / default |
да | нет | thinking_enabled=true |
deepseek-r1 |
Быстрый / default |
да | нет | R1-compatible alias |
deepseek-chat-search |
Быстрый / default |
нет | да | web search |
deepseek-default-search |
Быстрый / default |
нет | да | web search alias |
deepseek-reasoner-search |
Быстрый / default |
да | да | reasoning + search |
deepseek-r1-search |
Быстрый / default |
да | да | R1-compatible + search |
deepseek-expert |
Эксперт / expert |
нет | нет | Expert mode |
deepseek-v4-pro |
Эксперт / expert |
да | нет | Expert + reasoning |
Полный маппинг:
curl http://localhost:9655/v1/model-capabilitiesПо официальной странице DeepSeek V4 Preview deepseek-chat и deepseek-reasoner сейчас route'ятся в deepseek-v4-flash non-thinking/thinking. В самом chat.deepseek.com direct stream точное имя чекпойнта не отдаётся (model: ""), поэтому proxy фиксирует одновременно web-режим (default / Быстрый) и актуальную официальную маршрутизацию (DeepSeek-V4-Flash).
Текущий вывод DeepSeek Web remote config показывает такие web-режимы:
default/ UIБыстрый— работает; поддерживаетthinking_enabledиsearch_enabled.expert/ UIЭксперт— работает через актуальный web-контракт (x-client-version=2.0.0) и поддерживаетthinking_enabled. В/v1/modelsвыдаютсяdeepseek-expertбез reasoning иdeepseek-v4-proкак Expert + reasoning.vision/ UIРаспознавание— виден в remote config, но сейчас direct Web API возвращаетbackend_err_by_model(Vision is temporarily unavailable). Поэтомуdeepseek-visionскрыт из/v1/models.
Search для Expert по remote config недоступен, поэтому deepseek-expert-search остаётся unsupported.
| Method | Path | Назначение |
|---|---|---|
GET |
/ или /health |
статус proxy |
GET |
/v1/models |
список рабочих OpenAI-compatible aliases |
GET |
/v1/model-capabilities |
полный маппинг aliases, real model, capabilities |
POST |
/v1/chat/completions |
OpenAI-compatible Chat Completions |
POST |
/v1/messages |
Anthropic Messages API shim |
POST |
/v1/responses |
OpenAI Responses API shim |
GET |
/v1/sessions |
активные локальные agent sessions |
POST |
/reset-session?agent=<id> |
сбросить одну session |
POST |
/reset-session?agent=all |
сбросить все sessions |
Base URL для Open WebUI в Docker:
http://host.docker.internal:9655/v1
Для локального запуска без Docker:
http://localhost:9655/v1
API key можно указать любой: proxy сам ходит в DeepSeek Web через сохранённую browser-сессию.
npm run auth
npm startЕсли DeepSeek начал отвечать 401, 403 или просит новый PoW/session — повторите npm run auth и обновите сохранённую browser-сессию.
Локальные файлы авторизации не должны попадать в GitHub:
deepseek-auth.json.chrome-profile-deepseek/.env
Они уже добавлены в .gitignore.
Синтаксическая проверка проекта:
npm testLive smoke-тесты против запущенного локального proxy:
BASE_URL=http://127.0.0.1:9655 MODEL=deepseek-chat npm run test:liveFreeDeepseekAPI — экспериментальный web-chat proxy для локального использования и интеграций. Он зависит от текущего контракта DeepSeek Web Chat, поэтому при изменениях на стороне DeepSeek может потребоваться обновление auth/session logic или model mapping.
Если что-то перестало работать:
- обновите логин через
npm run auth; - проверьте
/v1/model-capabilities; - повторите запрос на свежей сессии;
- если проблема сохраняется — вероятно, DeepSeek изменил внутренний Web API.
ForgetMeAI · Telegram