Skip to content

Commit 5bcc8f0

Browse files
committed
sync: v1.3.6
1 parent fad844c commit 5bcc8f0

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ The proxy reads accounts from `accounts.json` in the config directory:
327327
| `ZEROGRAVITY_SYSTEM_MODE` | `stealth` | `stealth` = keep backend prompt, inject user system prompt as override; `minimal` = replace 20KB prompt with minimal identity + user prompt |
328328
| `ZEROGRAVITY_SENSITIVE_WORDS` | built-in list | Comma-separated client names to obfuscate in requests (zero-width spaces), or `none` to disable |
329329
| `ZEROGRAVITY_MODEL_ALIASES` || Map custom model names to built-in models, e.g. `gpt-4o:gemini-3-flash,gpt-4:opus-4.6`. Also configurable via `zg alias` or `aliases.json` |
330+
| `ZEROGRAVITY_API_BODY_LIMIT_MB` | `32` (clamped `1..100`) | Max request body size in MiB for API routes (`/v1/*`) | `64` |
330331

331332
**System prompt mode:** When your client sends a system prompt (e.g. via OpenAI `system` role), ZeroGravity injects it into the request. In `stealth` mode, the backend's identity is stripped and your prompt takes over. In `minimal` mode, the entire 20KB backend prompt is replaced — saves tokens but may trigger rate limiting on Pro models.
332333

docs/api.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ curl -X DELETE http://localhost:8741/v1/accounts \
116116
-d '{"email": "user@gmail.com"}'
117117
```
118118

119+
### Set Active Account (Runtime)
120+
121+
Switches the active account immediately without restarting the proxy process manually.
122+
123+
```bash
124+
curl -X POST http://localhost:8741/v1/accounts/set_active \
125+
-H "Content-Type: application/json" \
126+
-d '{"email": "user@gmail.com"}'
127+
```
128+
119129
### Account Rotation
120130

121131
When running with 2+ accounts, the proxy **automatically rotates** to the next account when:
@@ -128,7 +138,7 @@ The rotation:
128138
- Waits a short cooldown (5–10s with jitter)
129139
- Refreshes the next account's access token via OAuth
130140
- Restarts the backend to get a clean session
131-
- Clears all rate limiter state
141+
- Resets cooldown windows while preserving exhaustion counters
132142

133143
Use `--quota-cap 0.2` (default) or set `ZEROGRAVITY_QUOTA_CAP=0.2` to rotate proactively when any model exceeds 80% usage. When all accounts are exhausted, the proxy parks and waits for quota to reset. Set to `0` to disable proactive rotation.
134144

@@ -218,6 +228,7 @@ curl http://localhost:8741/v1beta/models/gemini-3-flash:generateContent \
218228
| `GET/POST` | `/v1/search` | Web Search via Google grounding (WIP) |
219229
| `POST` | `/v1/token` | Set OAuth token at runtime |
220230
| `POST` | `/v1/accounts` | Add account (email + refresh_token) |
231+
| `POST` | `/v1/accounts/set_active` | Set active account at runtime |
221232
| `GET` | `/v1/accounts` | List stored accounts |
222233
| `DELETE` | `/v1/accounts` | Remove account by email |
223234
| `GET` | `/v1/usage` | Proxy token usage |

docs/docker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ docker run -d --name zerogravity \
7979
| `ZEROGRAVITY_MACHINE_ID_PATH` | Auto-detected | Path to Antigravity's machine ID file | `/path/to/machineid` |
8080
| `ZEROGRAVITY_CLIENT_VERSION` | Auto-detected | Override the client version string | `1.15.8` |
8181
| `ZEROGRAVITY_MAX_RETRY_DELAY` | Internal default | Max retry delay in seconds on rate limit errors | `120` |
82+
| `ZEROGRAVITY_API_BODY_LIMIT_MB` | `32` (clamped `1..100`) | Max request body size in MiB for API routes (`/v1/*`) | `64` |
8283
| `SSL_CERT_FILE` | System default | Custom CA certificate bundle path | `/etc/ssl/certs/ca.pem` |
8384
| `RUST_LOG` | `info` | Log level | `debug` |
8485

0 commit comments

Comments
 (0)