codefree-proxy
codefree-proxy
OpenAI-compatible local proxy for SRD Cloud CodeFree.
Quick start
Run in the background:
npx codefree-proxy start --port 8788 --host 127.0.0.1Or install globally:
npm install -g codefree-proxy
codefree-proxy start --port 8788 --host 127.0.0.1Foreground mode is also available when you want logs printed in the current terminal:
npx codefree-proxy --port 8788 --host 127.0.0.1The server prints the local base URL and endpoints after it starts.
Server running at: http://127.0.0.1:8788
OpenAI Base URL: http://127.0.0.1:8788/v1
Chat endpoint: POST http://127.0.0.1:8788/v1/chat/completions
Models endpoint: GET http://127.0.0.1:8788/v1/models
Health check: GET http://127.0.0.1:8788/health
Stop command: codefree-proxy stop --port 8788
Use this OpenAI-compatible base URL in clients:
http://127.0.0.1:8788/v1
Use any API key value in OpenAI-compatible clients, or omit it if the client allows.
Login
The proxy first tries existing local credentials. If credentials are missing, run:
npx codefree-proxy loginThe login flow matches CodeFree-O: it opens SRD Cloud OAuth in a browser, waits for the local callback, fetches encryptedApiKey, decrypts it, and saves credentials locally.
Check current credential status:
npx codefree-proxy statusRemove saved credentials:
npx codefree-proxy logoutBackground mode
Start the server in the background:
npx codefree-proxy start
npx codefree-proxy start --port 8788 --host 127.0.0.1Background logs are written to:
~/.codefree-proxy/logs/proxy.log
The process id is written to:
~/.codefree-proxy/proxy.pid
Stop the server
Default port:
npx codefree-proxy stopCustom port:
npx codefree-proxy stop --port 8788Commands
codefree-proxy --port 8788 --host 127.0.0.1
codefree-proxy start
codefree-proxy start --port 8788 --host 127.0.0.1
codefree-proxy login
codefree-proxy logout
codefree-proxy status
codefree-proxy stop
codefree-proxy stop --port 8788Endpoints
POST /v1/chat/completionsGET /v1/modelsGET /healthGET /auth/statusPOST /auth/refresh
Models
GLM-5.1GLM-4.7Qwen3.5-122B-A10B
Unknown model names are mapped to GLM-5.1.
Credentials
Credentials are stored at:
- macOS/Linux:
~/.codefree-proxy/config.json - Windows:
%USERPROFILE%\.codefree-proxy\config.json
The proxy can also import CodeFree-O credentials from ~/.codefree-o/.local/share/codefree.json when available.