# postman2api **Repository Path**: mefaso/postman2api ## Basic Information - **Project Name**: postman2api - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: my - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-11 - **Last Updated**: 2026-08-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README > ⚠️ **EDUCATIONAL PURPOSE ONLY** — This project is provided **as-is** for research and educational purposes. The author is **not responsible** for any misuse, ToS violations, or consequences resulting from the use of this software. Use at your own risk. # postman2api Standalone Postman AI proxy — converts Postman's agent chat API into an OpenAI + Anthropic-compatible endpoint with multi-account pooling, round-robin load balancing, and Camoufox browser-automated login. ## Quick Start ```bash bun install cd dashboard && bun install && bun run build && cd .. cp .env.example .env bun src/db/migrate.ts bun start ``` - **Dashboard**: http://localhost:1930 - **API key**: set via `API_KEY` in `.env` - **OpenAI**: `http://localhost:1930/v1/chat/completions` - **Anthropic**: `http://localhost:1930/v1/messages` ## Login ```bash python3 -m venv scripts/auth/.venv source scripts/auth/.venv/bin/activate pip install -r scripts/auth/requirements.txt python3 scripts/auth/postman_login.py --email you@gmail.com --password pass ``` Or via dashboard: **Logs** panel → enter credentials → click **Login**. ## API Usage ```bash # OpenAI curl http://localhost:1930/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"claude-sonnet-4-5","messages":[{"role":"user","content":"Hello!"}],"stream":true}' # Anthropic curl http://localhost:1930/v1/messages \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"claude-sonnet-4-20250514","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}' ``` ## Models `claude-opus-4-8`, `claude-opus-4-7`, `claude-opus-4-6`, `claude-opus-4-5`, `claude-sonnet-4-6`, `claude-sonnet-4-5`, `claude-haiku-4-5`, `gpt-5.5`, `gpt-5.4`, `gpt-5.2`, `auto` Antropik `/v1/messages` accepts official Claude model IDs and normalizes them automatically. ## Long-context strategy (`SEEDING_MODE`) Upstream Postman embeds first-turn history in a single `seedingMessages` field. That field has two hard constraints (verified by probing): 1. It only accepts **exactly one `(user, assistant)` pair** — multiple entries, even when the total stays under the limit, are rejected with a `Forbidden` response. 2. Its **total length is capped at ~10000 chars** (measured: 10010 passes / 10060 rejected). So a first-turn history longer than ~9500 chars cannot be sent in one request. `SEEDING_MODE` controls how it is handled: | Mode | Behavior | Cost | Trade-off | |------|----------|------|-----------| | `multiturn` (default) | Splits the history into ~9500-char chunks and feeds each as a separate upstream round (greedily packing whole messages, never cutting a message mid-flight), then sends the real question on the same conversation. | `N+1` quota calls | Keeps the **entire** history visible to the model. Higher latency for huge contexts. | | `truncate` | Keeps only the tail (~most recent 9500 chars) in a single call, and prepends a note that earlier history was omitted. | 1 call | Drops the oldest context. | Set it in `.env`: ``` SEEDING_MODE=multiturn # or truncate ``` Additional behavior notes: - **Chunking rule** (`multiturn`): messages are packed greedily per chunk — a chunk is closed only when the next whole message would exceed the cap, so messages are never split. When a single message itself is larger than the cap (rare), only that message is truncated and annotated. - **Retry**: each feed round retries on transient failures (network / timeout / 5xx), up to 2 retries with exponential backoff (500ms, 1s). Auth (401/403), quota, and business rejections (`Forbidden`, consent) are **not** retried. Consecutive transient failures on multiple rounds abort feeding and fall back to truncation. - **Fallback**: if the very first feed round fails, feeding is abandoned and the request falls back to `truncate`-style behavior (tail kept + note) so the request doesn't die. - **Boundary**: when the context fits within ~9500 chars, `multiturn` sends it as a normal single request (no extra calls), identical to `truncate` except without the omission note. ## Features - OpenAI `/v1/chat/completions` + Anthropic `/v1/messages` protocol - SSE streaming with thinking/reasoning tokens - Multi-account pool with round-robin - Auto-switch on quota exhaustion - WebSocket real-time dashboard - Camoufox browser-automated Google OAuth login - Postman signup onboarding automation (fill form, start trial) - SQLite request logging ## Architecture ``` Client → Hono API → Account Pool (round-robin) → Postman Provider → Postman API ↕ Dashboard (React) ← WebSocket ``` Bun + TypeScript + Hono + Drizzle/SQLite + React/Vite. Python + Camoufox for browser auth. --- > ⚠️ **EDUCATIONAL PURPOSE ONLY** — This project is provided **as-is** for research and educational purposes. The author is **not responsible** for any misuse, ToS violations, or consequences resulting from the use of this software. Use at your own risk.