Skip to content

Commit 7b3d808

Browse files
committed
sync: v1.3.10
1 parent 8746b28 commit 7b3d808

4 files changed

Lines changed: 41 additions & 8 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,13 @@ The proxy runs on `http://localhost:8741` by default.
245245
| `POST /v1/chat/completions` | OpenAI | Chat Completions (sync + streaming) |
246246
| `POST /v1/responses` | OpenAI | Responses API (sync + streaming) |
247247
| `POST /v1/messages` | Anthropic | Messages API (sync + streaming) |
248+
| `POST /v1/messages/count_tokens` | Anthropic | Token counting |
249+
| `GET /v1beta/models` | Gemini | List models (Gemini v1beta format) |
250+
| `GET /v1beta/models/{model}` | Gemini | Get model metadata (Gemini v1beta format) |
248251
| `POST /v1beta/models/{model}:{action}` | Gemini | Official Gemini v1beta (recommended — zero translation) |
249252
| `GET /v1/models` || List available models |
250253
| `GET /v1/images/*` || Serve generated images (see below) |
254+
| `GET /health` || Health check |
251255

252256
For the full endpoint list (accounts, token, usage, quota, search), see the [API Reference](docs/api.md).
253257

docs/api.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# API Reference
22

3+
- **Status**: Active
4+
- **Last validated**: 2026-02-28
5+
- **Related docs**: [`README.md`](README.md), [`docker.md`](docker.md), [`zg.md`](zg.md), [`../index.md`](../index.md)
6+
37
The proxy runs on `http://localhost:8741` by default.
48

59
## Protocol Endpoints
@@ -126,6 +130,14 @@ curl -X POST http://localhost:8741/v1/accounts/set_active \
126130
-d '{"email": "user@gmail.com"}'
127131
```
128132

133+
### Account Status
134+
135+
```bash
136+
curl http://localhost:8741/v1/accounts/status
137+
```
138+
139+
Returns per-account details including email, active flag, and quota usage breakdown.
140+
129141
### Account Rotation
130142

131143
When running with 2+ accounts, the proxy **automatically rotates** to the next account when:
@@ -162,7 +174,7 @@ curl -X POST http://localhost:8741/v1/token \
162174
curl http://localhost:8741/v1/usage
163175
```
164176

165-
Returns token counts for the current session.
177+
Returns token counts persisted by the proxy, including stats restored across restarts.
166178

167179
### Quota
168180

@@ -180,6 +192,16 @@ curl http://localhost:8741/health
180192

181193
Returns `200 OK` when the proxy is running.
182194

195+
### Raw Replay
196+
197+
```bash
198+
curl -X POST http://localhost:8741/v1/replay/raw \
199+
-H "Content-Type: application/json" \
200+
--data-binary @modified_request.json
201+
```
202+
203+
Send a pre-built payload (from a trace's `modified_request.json`) directly through the MITM tunnel, bypassing all request translation. Used for latency diagnostics.
204+
183205
## API Key Protection
184206

185207
Protect the proxy from unauthorized access by setting `ZEROGRAVITY_API_KEY`:
@@ -225,16 +247,20 @@ curl http://localhost:8741/v1beta/models/gemini-3-flash:generateContent \
225247
| `POST` | `/v1/messages` | Messages API (Anthropic compat) |
226248
| `POST` | `/v1/messages/count_tokens` | Anthropic token counting endpoint |
227249
| `POST` | `/v1beta/models/{model}:{action}` | Official Gemini v1beta routes |
250+
| `GET` | `/v1beta/models` | List models (Gemini v1beta format) |
251+
| `GET` | `/v1beta/models/{model}` | Get model info (Gemini v1beta format) |
228252
| `GET` | `/v1/models` | List available models |
229253
| `GET/POST` | `/v1/search` | Web Search via Google grounding (WIP) |
230254
| `POST` | `/v1/token` | Set OAuth token at runtime |
231255
| `POST` | `/v1/accounts` | Add account (email + refresh_token) |
232256
| `POST` | `/v1/accounts/set_active` | Set active account at runtime |
233257
| `GET` | `/v1/accounts` | List stored accounts |
234258
| `DELETE` | `/v1/accounts` | Remove account by email |
259+
| `GET` | `/v1/accounts/status` | Per-account status with quota usage |
235260
| `GET` | `/v1/usage` | Proxy token usage |
236261
| `GET` | `/v1/quota` | Quota and rate limits |
237262
| `GET` | `/v1/images/*` | Serve generated images |
263+
| `POST` | `/v1/replay/raw` | Send pre-built trace through MITM |
238264
| `GET` | `/health` | Health check |
239265
| `GET/POST` | `/` | Compatibility root (returns status) |
240266
| `POST` | `/api/event_logging/batch` | Compatibility event logging endpoint |

docs/docker.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Docker Guide
22

33
- **Status**: Active
4-
- **Last validated**: 2026-02-26
4+
- **Last validated**: 2026-02-28
55
- **Related docs**: [`README.md`](README.md), [`api.md`](api.md), [`zg.md`](zg.md), [`../index.md`](../index.md)
66

77
The proxy runs as a Docker container. The image bundles all required backend components — no Antigravity installation needed on the host.
@@ -123,6 +123,7 @@ docker run -d --name zerogravity \
123123
| `ZEROGRAVITY_SYSTEM_MODE` | `stealth` | `stealth` = keep backend prompt; `minimal` = replace entirely | `minimal` |
124124
| `ZEROGRAVITY_SENSITIVE_WORDS` | built-in | Comma-separated client names to obfuscate, or `none` to disable | `Cursor,Windsurf` |
125125
| `ZEROGRAVITY_MODEL_ALIASES` | — | Map custom model names to internal models | `gpt-4o:gemini-3-flash,gpt-4:opus-4.6` |
126+
| `ZEROGRAVITY_DISPATCH_HOOKS` | `false` | Enable dispatch timing diagnostics (1/true/on to enable) | `true` |
126127

127128
### Request Queue
128129

docs/zg.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `zg` CLI Reference
22

33
- **Status**: Active
4-
- **Last validated**: 2026-02-24
4+
- **Last validated**: 2026-02-28
55
- **Related docs**: [`README.md`](README.md), [`docker.md`](docker.md), [`api.md`](api.md), [`../index.md`](../index.md)
66

77
`zg` is a standalone CLI tool that works on **any OS** (Linux, macOS, Windows). The proxy itself runs on Linux/Docker only.
@@ -79,11 +79,12 @@ Supported subcommands are exactly: `ls`, `dir`, `errors`.
7979

8080
### Diagnostics
8181

82-
| Command | Description |
83-
| ------------------ | -------------------------------------------------- |
84-
| `zg report` | Generate bounded diagnostic snapshot for bug reports |
85-
| `zg report <id>` | Bundle a specific trace into a shareable `.tar.gz` |
86-
| `zg replay <file>` | Re-send a bundled trace to the local proxy |
82+
| Command | Description |
83+
| ------------------------ | -------------------------------------------------- |
84+
| `zg report` | Generate bounded diagnostic snapshot for bug reports |
85+
| `zg report <id>` | Bundle a specific trace into a shareable `.tar.gz` |
86+
| `zg replay <file>` | Re-send a bundled trace to the local proxy |
87+
| `zg replay --raw <file>` | Send modified request through MITM bypass (no translation) |
8788

8889
## Environment Overrides
8990

@@ -94,3 +95,4 @@ Supported subcommands are exactly: `ls`, `dir`, `errors`.
9495
| `ZEROGRAVITY_OS` | Runtime | Override reported OS label for metadata/header alignment (`Linux`, `macOS`, `Windows`). |
9596
| `ZEROGRAVITY_IDE_VERSION` | Runtime | Override reported IDE version (preferred over `ZEROGRAVITY_CLIENT_VERSION`). |
9697
| `ZEROGRAVITY_DEVICE_FINGERPRINT` | Runtime | Override reported device fingerprint (UUID format required). |
98+
| `ZEROGRAVITY_DISPATCH_HOOKS` | Runtime | Enable dispatch timing diagnostics (values: 1, true, on). |

0 commit comments

Comments
 (0)