Freebuff2API is an OpenAI-compatible proxy server for Freebuff. It translates standard OpenAI API requests into Freebuff's backend format, allowing you to use Freebuff's free models with any OpenAI-compatible client, SDK, or CLI tool.
- OpenAI Compatible API โ Standard OpenAI endpoints; works with any compatible client out of the box.
- Stealth Request Handling โ Dynamic, randomized client fingerprints that mimic official Freebuff SDK behavior.
- Multi-Token Rotation โ Cycle through multiple auth tokens with automatic periodic rotation.
- HTTP Proxy Support โ Route all outbound traffic through a configurable upstream proxy.
Freebuff2API requires one or more Freebuff auth tokens. The easiest way is to install the Freebuff CLI:
npm i -g freebuffRun freebuff in your terminal โ on first launch it will guide you through login.
After logging in, your token is saved to a local credentials file:
| OS | Credentials Path |
|---|---|
| Windows | C:\Users\<username>\.config\manicode\credentials.json |
| Linux / macOS | ~/.config/manicode/credentials.json |
The file looks like:
{
"default": {
"id": "user_10293847",
"name": "Zhang San",
"email": "zhangsan@example.com",
"authToken": "fa82b5c1-e39d-4c7a-961f-d2b3c4e5f6a7",
...
}
}Only the authToken value is needed โ copy it as your AUTH_TOKENS.
Tip: Log in with multiple accounts and configure all their tokens for higher throughput.
Configuration is managed via a JSON file and/or environment variables. The JSON keys and environment variable names are identical. By default the app looks for config.json in the working directory; use -config to specify another path.
{
"LISTEN_ADDR": ":8080",
"UPSTREAM_BASE_URL": "https://codebuff.com",
"AUTH_TOKENS": ["eyJhb..."],
"ROTATION_INTERVAL": "6h",
"REQUEST_TIMEOUT": "15m",
"API_KEYS": [],
"HTTP_PROXY": ""
}| Key / Env Var | Description |
|---|---|
LISTEN_ADDR |
Proxy listen address (default :8080) |
UPSTREAM_BASE_URL |
Freebuff backend URL (default https://codebuff.com) |
AUTH_TOKENS |
Freebuff auth tokens (JSON array or comma-separated env var) |
ROTATION_INTERVAL |
Run rotation interval (default 6h) |
REQUEST_TIMEOUT |
Upstream request timeout (default 15m) |
API_KEYS |
Client API keys for proxy auth (empty = open access) |
HTTP_PROXY |
HTTP proxy for outbound requests |
Environment variables override JSON values when both are set.
Pre-built multi-arch images are available on GHCR:
docker run -d --name Freebuff2API \
-p 8080:8080 \
-e AUTH_TOKENS="token1,token2" \
ghcr.io/quorinex/freebuff2api:latestBuild from source:
docker build -t Freebuff2API .
docker run -d -p 8080:8080 -e AUTH_TOKENS="token1,token2" Freebuff2APIRequirements: Go 1.23+
git clone https://github.com/Quorinex/Freebuff2API.git
cd Freebuff2API
go build -o Freebuff2API .
./Freebuff2API -config config.jsonThis project has no official affiliation with OpenAI, Codebuff, or Freebuff. All related trademarks and copyrights belong to their respective owners.
All contents within this repository are provided solely for communication, experimentation, and learning, and do not constitute production-ready services or professional advice. This project is provided on an "As-Is" basis, and users must use it at their own risk. The author assumes no liability for any direct or indirect damages resulting from the use, modification, or distribution of this project, nor provides any warranties of any kind, express or implied.
MIT