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+
37The 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
131143When 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 \
162174curl 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
181193Returns ` 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
185207Protect 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 |
0 commit comments