HN 표시: Claudebox – 개인 API로 Claude 구독

hackernews | | 📰 뉴스
#ai 딜 #anthropic #api #claude #cli #docker #openai #클로드박스
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

'Claudebox'는 기존 Claude CLI 자격 증명을 사용하여 별도의 API 키나 비용 없이 Docker 컨테이너 내에서 Claude를 실행할 수 있는 오픈 소스 도구입니다. 이 도구는 터미널에서 직접 프롬프트를 실행하거나 Docker Compose 스택의 서비스로 통합하여 파일 편집, 코드 분석 등의 작업을 안전하게 수행합니다. 또한 --openai 옵션을 통해 표준 OpenAI 호환 엔드포인트를 제공하여, 다양한 클라이언트와의 연동을 지원하는 것이 주요 특징입니다.

본문

Claude in a box - Use it however you want: Run Claude from your terminal as a CLI, or drop it into an existing Docker Compose stack as a service. - No API key, no extra billing: claudebox uses your existing Claude subscription and authenticates with your current Claude credentials, so personal use feels seamless. - Real agent, strong isolation: Claude gets its full toolset inside the container—file editing, shell access, code analysis, and more; without access to your host machine or the open internet beyond Anthropic’s APIs. - Docker — Install Docker Desktop - Claude CLI — installed and authenticated ( curl -fsSL https://claude.ai/install.sh | bash , then runclaude once to log in) claudebox uses your Claude subscription. It reads local credentials (Keychain on macOS, ~/.claude/.credentials.json on Linux) to authenticate inside the container. Credentials are resolved in order: CLAUDE_CODE_OAUTH_TOKEN env var, then platform credential store. For: running prompts and agentic tasks in a sandboxed container from your terminal. curl -fsSL https://raw.githubusercontent.com/ArmanJR/claudebox/main/install.sh | bash claudebox prompt "explain how DNS works" # run a single prompt claudebox prompt --json "explain DNS" # full JSON output claudebox prompt --verbose "explain DNS" # container logs + output claudebox server # start the HTTP API server claudebox server --openai # start with OpenAI-compatible API claudebox stop # stop the server claudebox logs # view server logs claudebox status # check if server is running claudebox version # show CLI version claudebox update # update the CLI Works on macOS and Linux. Handles authentication automatically and refreshes expired tokens before launching the container. | Variable | Default | Purpose | |---|---|---| CLAUDEBOX_PORT | 3000 | Host port | CLAUDEBOX_IMAGE | ghcr.io/armanjr/claudebox:latest | Docker image | CLAUDEBOX_NAME | claudebox | Container name | CLAUDE_CODE_OAUTH_TOKEN | — | Skip auto-detection, use this token directly | CLAUDEBOX_API_KEY | — | API key for /v1/* endpoints (used with --openai ) | For: adding Claude as an agent alongside other services in your Docker Compose stack. First, extract your OAuth token (re-run when it expires): curl -fsSL https://raw.githubusercontent.com/ArmanJR/claudebox/main/setup-auth.sh | bash services: claudebox: image: ghcr.io/armanjr/claudebox:latest cap_add: - NET_ADMIN ports: - "3000:3000" env_file: - path: .env.claude required: true Then docker compose up -d . Other services in the same network reach Claude at http://claudebox:3000 . Send a prompt to Claude and get a JSON response. { "prompt": "your prompt here", "options": { "model": "sonnet", "maxTurns": 10, "maxBudgetUsd": 1.0, "systemPrompt": "you are a helpful assistant", "appendSystemPrompt": "additional instructions", "allowedTools": ["Read", "Edit", "Bash"], "cwd": "/workspace" } } All fields in options are optional. Response: Claude Code's JSON output (includes result , session_id , usage , total_cost_usd , etc.) Returns {"status": "ok", "activeRequests": 0} . | Variable | Default | Purpose | |---|---|---| PORT | 3000 | Server listen port | MAX_CONCURRENT | 4 | Max parallel Claude processes | OPENAI_COMPAT | — | Set to 1 to enable /v1/* routes (set automatically by --openai ) | CLAUDEBOX_API_KEY | — | If set, all /v1/* requests require Authorization: Bearer | Start the server with --openai (CLI) or set OPENAI_COMPAT=1 (Docker) to expose /v1/chat/completions and /v1/models . This lets you use claudebox with any OpenAI-compatible client. # CLI claudebox server --openai # Docker Compose — add to environment OPENAI_COMPAT=1 Accepts the standard OpenAI chat completions request format and translates it to Claude Code invocations. curl http://localhost:3000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "sonnet", "messages": [ {"role": "system", "content": "You are a helpful assistant"}, {"role": "user", "content": "Explain DNS in one sentence"} ] }' Returns a standard OpenAI-shaped response: { "id": "chatcmpl-...", "object": "chat.completion", "model": "sonnet", "choices": [{ "index": 0, "message": {"role": "assistant", "content": "..."}, "finish_reason": "stop" }], "usage": {"prompt_tokens": 100, "completion_tokens": 50, "total_tokens": 150} } Supported features: | Feature | How it maps | |---|---| messages[role=system] | Concatenated into --system-prompt | | Multi-turn conversation | Serialized into structured prompt with history | model | Passed through to Claude (sonnet , opus , haiku , or full model IDs) | response_format (json_schema / json_object ) | Injected into prompt + validated; retries once on failure | Base64 images (data:image/...;base64,... ) | Decoded to temp files, read by Claude's Read tool | Not supported: streaming, function calling / tools, external image URLs, temperature / top_p , n > 1 . Lists available Claude models. If CLAUDEBOX_API_KEY is set, all /v1/* requests must include Authorization: Bearer . The existing /prompt

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

공유

관련 저널 읽기

전체 보기 →