`th3ist` is a zero-dependency, standalone Go proxy gateway that exposes an OpenAI-compatible HTTP interface (`/v1/chat/completions` and `/v1/models`) backed by the `t3.chat` API.
## Features
- **Standard OpenAI interface**: Serves `/v1/chat/completions` and `/v1/models` (with `/chat/completions` and `/models` aliases).
- **Dual-engine architecture**:
- **Browser bridge (`-auto-capture`)**: Routes upstream requests directly through a private, stealth headless Chromium session over CDP. This ensures a 100% genuine Chrome TLS handshake (JA3/JA4), completely bypassing Vercel Security Checkpoints and WAF blocks.
- **Direct HTTP client**: Fallback mode for high-throughput environments where valid Vercel clearance cookies and tokens are supplied directly.
- **Private & anti-fingerprinting stealth**:
- **100% isolated session**: Launches in `--incognito` mode with a temporary ephemeral user profile and `--disable-extensions`, completely segregated from any existing Chromium/Chrome windows, history, extensions, or sessions.
- **Zero port collisions**: Binds to a dynamically allocated ephemeral loopback port for CDP commands.
- **Stealth & anti-detection**:
- Disables Blink automation features (`--disable-blink-features=AutomationControlled`).
- Masks `navigator.webdriver` to `undefined` via `Page.addScriptToEvaluateOnNewDocument`.
- Normalizes `window.chrome`, `navigator.languages`, and `navigator.plugins`.
- Sets desktop viewport (`--window-size=1920,1080`) and custom User-Agent.
- Strips telemetry, domain reliability, crash reporting, and sync.
- **Dynamic token ingestion API**: Provides `GET /v1/token` and `POST /v1/token` to inspect or hot-reload single-use hCaptcha tokens and cookies on the fly without restarting the server.
- **Fast fail & clear error propagation**: Non-transient errors (such as `captcha_failed` or `invalid_params`) return immediately (<300ms) without wasting time in exponential backoff retry loops.
- **Streaming & non-streaming**: Full support for Server-Sent Events (`stream: true`) and standard JSON responses (`stream: false`).
- **Reasoning content separation**: Parses `<think>...</think>` tags and upstream reasoning chunks into `reasoning_content` deltas / message fields.
- **Function / tool calling translation**: Injects tool schemas into system instructions, maps multi-turn tool calling history, and parses model tool invocations into standard OpenAI `tool_calls`.
- **Zero external dependencies**: Implemented using pure Go standard library.
On tiling window managers (e.g., i3, bspwm, sway, dwm, awesome, hyprland, xmonad), any window created on the main `$DISPLAY` may be caught and tiled into the current workspace.
To prevent any windows from appearing on your desktop:
`th3ist` will automatically allocate an isolated virtual display (e.g. `:99`), launch `Xvfb`, attach Chromium to it, and cleanly terminate `Xvfb` on exit.
2. **Option B: Manual virtual X server (`Xvfb`, `Xephyr`, or `Xnest`)**: