Show HN: OCP v3.4 – Share your Claude Pro/Max subscription over LAN ($0 extra)

hackernews | | 📦 오픈소스
#anthropic #api #claude #command r #hn #lan #openai
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

OCP v3.4는 기존 Claude Pro/Max 구독을 추가 요금($0) 없이 로컬 호스트의 OpenAI 호환 API로 변환해주는 프록시 도구입니다. 사용자는 3456 포트를 통해 Cline, Aider 등 다양한 IDE 및 도구를 연결할 수 있으며, 로컬 네트워크(LAN) 설정을 통해 가족이나 팀원 간에 하나의 구독을 공유하는 것도 가능합니다. 관리자 키 기반의 다중 인증 시스템을 지원하여 사용자별 API 키 발급 및 사용량 추적, 권한 취소 등을 세밀하게 관리할 수 있습니다.

본문

Status: Stable (v3.4.0) — Feature-complete. Bug fixes only. Already paying for Claude Pro/Max? Use your subscription as an OpenAI-compatible API — $0 extra cost. OCP turns your Claude Pro/Max subscription into a standard OpenAI-compatible API on localhost. Any tool that speaks the OpenAI protocol can use it — no separate API key, no extra billing. Cline ──┐ OpenCode ───┤ Aider ───┼──→ OCP :3456 ──→ Claude CLI ──→ Your subscription Continue.dev ───┤ OpenClaw ───┘ One proxy. Multiple IDEs. All models. $0 API cost. Any tool that accepts OPENAI_BASE_URL works with OCP: | Tool | Configuration | |---|---| | Cline | Settings → OPENAI_BASE_URL=http://127.0.0.1:3456/v1 | | OpenCode | OPENAI_BASE_URL=http://127.0.0.1:3456/v1 | | Aider | aider --openai-api-base http://127.0.0.1:3456/v1 | | Continue.dev | config.json → apiBase: "http://127.0.0.1:3456/v1" | | OpenClaw | setup.mjs auto-configures | | Any OpenAI client | Set base URL to http://127.0.0.1:3456/v1 | git clone https://github.com/dtzp555-max/ocp.git cd ocp node setup.mjs The setup script will: - Verify Claude CLI is installed and authenticated - Start the proxy on port 3456 - Install auto-start (launchd on macOS, systemd on Linux) Then point your IDE to the proxy: export OPENAI_BASE_URL=http://127.0.0.1:3456/v1 curl http://127.0.0.1:3456/v1/models # Returns: claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4 OCP can serve your entire household from a single machine. One Claude Pro/Max subscription, shared across all devices on your network. Wife's laptop ──┐ Son's iPad ───┼──→ OCP :3456 (your Mac) ──→ Claude subscription Your Pi server ───┤ Your desktop ──┘ Quick start (temporary, until restart): export CLAUDE_BIND=0.0.0.0 export CLAUDE_AUTH_MODE=multi # per-user keys export OCP_ADMIN_KEY=your-secret-admin-key ocp restart Permanent (survives reboot): node setup.mjs --bind 0.0.0.0 --auth-mode multi Then set your admin key in the launchd/systemd environment, or save it to a file: echo "your-secret-admin-key" > ~/.ocp/admin-key chmod 600 ~/.ocp/admin-key # Set admin key for CLI (or save to ~/.ocp/admin-key) export OCP_ADMIN_KEY=your-secret-admin-key # Create a key for each person/device ocp keys add wife-laptop # ✓ Key created for "wife-laptop" # API Key: ocp_xDYzOB9ZKYzn... # Copy this key now — you won't see it again. ocp keys add son-ipad ocp keys add pi-server Run ocp lan to see your IP and ready-to-share instructions: $ ocp lan OCP LAN Setup ───────────────────────────────────── Your IP: 192.168.1.100 Port: 3456 For IDE users, set: OPENAI_BASE_URL=http://192.168.1.100:3456/v1 OPENAI_API_KEY= Dashboard: http://192.168.1.100:3456/dashboard Status: ✓ LAN-accessible Give each family member their key and these two settings: export OPENAI_BASE_URL=http://192.168.1.100:3456/v1 export OPENAI_API_KEY=ocp_ # Per-key usage stats ocp usage --by-key # Key Reqs OK Err Avg Time # wife-laptop 5 5 0 8.0s # son-ipad 3 3 0 6.2s # Manage keys ocp keys # List all keys ocp keys revoke son-ipad # Revoke a key Web Dashboard: Open http://:3456/dashboard in any browser for real-time monitoring — per-key usage, request history, plan utilization, and system health. No login needed. | Mode | Env | Use Case | |---|---|---| none | CLAUDE_AUTH_MODE=none | Trusted home network, no auth needed | shared | CLAUDE_AUTH_MODE=shared + PROXY_API_KEY=xxx | Everyone shares one key | multi | CLAUDE_AUTH_MODE=multi + OCP_ADMIN_KEY=xxx | Per-person keys with usage tracking (recommended) | - All users share your Claude Pro/Max rate limits (5h session + 7d weekly) ocp usage shows how much quota remains- Keys are stored in ~/.ocp/ocp.db (SQLite, zero external dependencies) - Admin key is required for key management API endpoints - The dashboard ( /dashboard ) and health check (/health ) are always public Check your subscription usage from the terminal: $ ocp usage Plan Usage Limits ───────────────────────────────────── Current session 21% used Resets in 3h 12m (Tue, Mar 28, 10:00 PM) Weekly (all models) 45% used Resets in 4d 2h (Tue, Mar 31, 12:00 AM) Extra usage off Model Stats Model Req OK Er AvgT MaxT AvgP MaxP ────────────────────────────────────────────────────── opus 5 5 0 32s 87s 42K 43K sonnet 18 18 0 20s 45s 36K 56K Total 23 Proxy: up 6h 32m | 23 reqs | 0 err | 0 timeout ocp usage Plan usage limits & model stats ocp usage --by-key Per-key usage breakdown (LAN mode) ocp status Quick overview ocp health Proxy diagnostics ocp keys List all API keys (multi mode) ocp keys add Create a new API key ocp keys revoke Revoke an API key ocp lan Show LAN connection info & IP ocp settings View tunable settings ocp settings Update a setting at runtime ocp logs [N] [level] Recent logs (default: 20, error) ocp models Available models ocp sessions Active sessions ocp clear Clear all sessions ocp restart Restart proxy ocp restart gateway Restart gateway ocp update Update to latest version ocp update --check Check for updates without applying ocp --help Command reference # Symlink to PATH (recommended) sudo ln -sf $(pwd)/ocp /usr/local/bin/ocp # Verify ocp --help Cloud/Linux servers: If ocp: command not found , the binary isn't in PATH. Full path:~/.openclaw/projects/ocp/ocp # Check if a new version is available ocp update --check # Pull latest, sync plugin, restart proxy — one command ocp update $ ocp settings maxPromptChars 200000 ✓ maxPromptChars = 200000 $ ocp settings maxConcurrent 4 ✓ maxConcurrent = 4 Your IDE → OCP (localhost:3456) → claude -p CLI → Anthropic (via subscription) OCP translates OpenAI-compatible /v1/chat/completions requests into claude -p CLI calls. Anthropic sees normal Claude Code usage — no API billing, no separate key needed. | Model ID | Notes | |---|---| claude-opus-4-6 | Most capable, slower | claude-sonnet-4-6 | Good balance of speed/quality | claude-haiku-4 | Fastest, lightweight | | Endpoint | Method | Description | |---|---|---| /v1/models | GET | List available models | /v1/chat/completions | POST | Chat completion (streaming + non-streaming) | /health | GET | Comprehensive health check | /usage | GET | Plan usage limits + per-model stats | /status | GET | Combined overview (usage + health) | /settings | GET/PATCH | View or update settings at runtime | /logs | GET | Recent log entries (?n=20&level=error ) | /sessions | GET/DELETE | List or clear active sessions | /dashboard | GET | Web dashboard (always public) | /api/keys | GET/POST | List or create API keys (admin only) | /api/keys/:id | DELETE | Revoke an API key (admin only) | /api/usage | GET | Per-key usage stats (?since=&until=&hours=&limit= ) | OCP was originally built for OpenClaw and includes deep integration: setup.mjs auto-configures theclaude-local provider inopenclaw.json - Gateway plugin registers /ocp as a native slash command in Telegram/Discord - Multi-agent — 8 concurrent requests sharing one subscription - No conflicts — uses neutral service names ( dev.ocp.proxy /ocp-proxy ) that don't trigger OpenClaw's gateway-like service detection cp -r ocp-plugin/ ~/.openclaw/extensions/ocp/ Add to ~/.openclaw/openclaw.json : { "plugins": { "allow": ["ocp"], "entries": { "ocp": { "enabled": true } } } } Restart: openclaw gateway restart After installing the gateway plugin, use /ocp slash commands in your chat: /ocp status — Quick overview /ocp usage — Plan usage limits & model stats /ocp models — Available models /ocp health — Proxy diagnostics /ocp keys — List all API keys (multi mode) /ocp keys add — Create a new key /ocp keys revoke — Revoke a key Note: Terminal CLI uses ocp , Telegram/Discord uses/ocp . Symptom: Claude returns errors or stops responding after about 60 seconds, especially during tool use (Bash, Read, etc.). Cause: OpenClaw's gateway has a default idleTimeoutSeconds of 60 seconds. When Claude calls tools, the token stream pauses while the tool executes — if that takes longer than 60s, the gateway kills the connection. Fix: setup.mjs (v3.2.1+) sets this automatically. If you installed an older version, add this to ~/.openclaw/openclaw.json : { "agents": { "defaults": { "llm": { "idleTimeoutSeconds": 0 } } } } Then restart: openclaw gateway restart Usually caused by stuck sessions from previous timeout errors. Fix: # Clear all sessions ocp clear # Restart both services ocp restart openclaw gateway restart If that doesn't help, manually clear the session store: # Find and reset stuck Telegram sessions cat ~/.openclaw/agents/main/sessions/sessions.json # Remove entries with "telegram" channel, then restart gateway If you installed OCP before v3.1.0, the auto-start service used names that OpenClaw's gateway detected as conflicting (ai.openclaw.proxy on macOS, openclaw-proxy on Linux). Running node setup.mjs or ocp update will automatically migrate to the new neutral names. | Variable | Default | Description | |---|---|---| CLAUDE_PROXY_PORT | 3456 | Listen port | CLAUDE_BIND | 127.0.0.1 | Bind address (0.0.0.0 for LAN access) | CLAUDE_AUTH_MODE | none | Auth mode: none , shared , or multi | OCP_ADMIN_KEY | (unset) | Admin key for key management (multi mode) | CLAUDE_BIN | (auto-detect) | Path to claude binary | CLAUDE_TIMEOUT | 600000 | Request timeout (ms, default: 10 min) | CLAUDE_MAX_CONCURRENT | 8 | Max concurrent claude processes | CLAUDE_MAX_PROMPT_CHARS | 150000 | Prompt truncation limit (chars) | CLAUDE_SESSION_TTL | 3600000 | Session expiry (ms, default: 1 hour) | CLAUDE_ALLOWED_TOOLS | Bash,Read,...,Agent | Comma-separated tools to pre-approve | CLAUDE_SKIP_PERMISSIONS | false | Bypass all permission checks | PROXY_API_KEY | (unset) | Bearer token for shared-mode authentication | - Localhost by default — binds to 127.0.0.1 ; setCLAUDE_BIND=0.0.0.0 to enable LAN access - 3-tier auth — none (trusted network),shared (single key),multi (per-user keys with usage tracking) - Timing-safe key comparison — prevents timing attacks on API keys and admin keys - Admin-only key management — creating, listing, and revoking keys requires the admin key - Public endpoints — /health and/dashboard are always accessible without auth - No API keys needed — authentication goes through Claude CLI's OAuth session - Keys stored locally — ~/.ocp/ocp.db (SQLite), never sent to external services - Auto-start — launchd (macOS) / systemd (Linux) MIT

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →