{"_id":"@aistack/claude-code-proxy","_rev":"3-f2b49e1464cf484de3683fff6eed3799","name":"@aistack/claude-code-proxy","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@aistack/claude-code-proxy","version":"0.1.0","keywords":["anthropic","claude","proxy","litellm","openai","gemini","ai","llm","api","cli"],"author":{"name":"AI Stack HQ"},"license":"MIT","_id":"@aistack/claude-code-proxy@0.1.0","maintainers":[{"name":"aistackteam","email":"aistack.run@gmail.com"}],"homepage":"https://github.com/aistackhq/claude-code-proxy#readme","bugs":{"url":"https://github.com/aistackhq/claude-code-proxy/issues"},"os":["darwin","linux","win32"],"bin":{"ccproxy":"bin/ccproxy.js"},"cpu":["x64","arm64"],"dist":{"shasum":"7c16020975a0b7d8dc66b5e31384fc5668f5bb26","tarball":"https://registry.npmjs.org/@aistack/claude-code-proxy/-/claude-code-proxy-0.1.0.tgz","fileCount":10,"integrity":"sha512-IPdhuPZ0vj149cAgFy+8/4711NbfRGxPl+yvbv6xl9obUgj+BQ2Eh/jjQAZeauTpjC7qZSwUU8RwKmSTW0mcDw==","signatures":[{"sig":"MEQCH10es1IxZCUEfS9NJ/6UfHX1FX7eEkP+KKEkDhFrtRoCIQClaGDesDBBFQ932sJ4S5KpG5Qy7O8Y+d3YPdTLLeHMpQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47796061},"main":"bin/ccproxy.js","engines":{"node":">=14.0.0"},"gitHead":"1aaf3b267e2caa1f2322175d421fb7b1d0912b55","scripts":{"test":"echo \"Tests are run in Go environment\" && exit 0","build":"node scripts/build-all.js","prepare":"node scripts/prepare-npm.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"aistackteam","email":"aistack.run@gmail.com"},"repository":{"url":"git+https://github.com/aistackhq/claude-code-proxy.git","type":"git"},"_npmVersion":"10.9.2","description":"A high-performance proxy server that translates Anthropic Claude API requests to LiteLLM format for multi-provider LLM access","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/claude-code-proxy_0.1.0_1752740788661_0.5400684482741767","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aistack/claude-code-proxy","version":"0.1.1","keywords":["anthropic","claude","proxy","litellm","openai","gemini","ai","llm","api","cli"],"author":{"name":"AI Stack HQ"},"license":"MIT","_id":"@aistack/claude-code-proxy@0.1.1","maintainers":[{"name":"aistackteam","email":"aistack.run@gmail.com"}],"homepage":"https://github.com/aistackhq/claude-code-proxy#readme","bugs":{"url":"https://github.com/aistackhq/claude-code-proxy/issues"},"os":["darwin","linux","win32"],"bin":{"ccproxy":"bin/ccproxy.js"},"cpu":["x64","arm64"],"dist":{"shasum":"f9f955666839385009dc2fa89cd7964970282660","tarball":"https://registry.npmjs.org/@aistack/claude-code-proxy/-/claude-code-proxy-0.1.1.tgz","fileCount":10,"integrity":"sha512-z/K8D0EUXVhRLudgD9ETEVbHHtqIatXCwmfuFq0DcZIlU8HeiejXCirJmZCqyY2XXhvreA888QBcmbmU1u6xzg==","signatures":[{"sig":"MEUCIFfGYHazwo8TVEpX9xiH/cYBIbMtvddMd1znQ7QaerukAiEAi/4Yi4OPJ5OuKzaXpLsq6GlRll3tKUuYydXfBG1tfBs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47797458},"main":"bin/ccproxy.js","engines":{"node":">=14.0.0"},"gitHead":"1aaf3b267e2caa1f2322175d421fb7b1d0912b55","scripts":{"test":"echo \"Tests are run in Go environment\" && exit 0","build":"node scripts/build-all.js","prepare":"node scripts/prepare-npm.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"aistackteam","email":"aistack.run@gmail.com"},"repository":{"url":"git+https://github.com/aistackhq/claude-code-proxy.git","type":"git"},"_npmVersion":"10.9.2","description":"A high-performance proxy server that translates Anthropic Claude API requests to LiteLLM format for multi-provider LLM access","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/claude-code-proxy_0.1.1_1752743069304_0.8870212462711478","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aistack/claude-code-proxy","version":"0.1.2","description":"A high-performance proxy server that translates Anthropic Claude API requests to LiteLLM format for multi-provider LLM access","main":"bin/ccproxy.js","bin":{"ccproxy":"bin/ccproxy.js"},"scripts":{"build":"node scripts/build-all.js","prepare":"node scripts/prepare-npm.js","prepublishOnly":"npm run build","test":"echo \"Tests are run in Go environment\" && exit 0"},"repository":{"type":"git","url":"git+https://github.com/aistackhq/claude-code-proxy.git"},"keywords":["anthropic","claude","proxy","litellm","openai","gemini","ai","llm","api","cli"],"author":{"name":"AI Stack HQ"},"license":"MIT","bugs":{"url":"https://github.com/aistackhq/claude-code-proxy/issues"},"homepage":"https://github.com/aistackhq/claude-code-proxy#readme","engines":{"node":">=14.0.0"},"os":["darwin","linux","win32"],"cpu":["x64","arm64"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_id":"@aistack/claude-code-proxy@0.1.2","gitHead":"135e3efe752c90372e731a8bc700fa185006f0c5","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-BX53I5yS5ZDSOuoEGM+U9mboko6Vb64XHoaBNexoPSx4GkOkN7cuuaCI+xH6w3k4eWSS8WaAM/sq4jtLB/e1YQ==","shasum":"4a2bdfe471d40f5123fdeb06d0597a7a4f1be6aa","tarball":"https://registry.npmjs.org/@aistack/claude-code-proxy/-/claude-code-proxy-0.1.2.tgz","fileCount":10,"unpackedSize":47922514,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICR4niH7YgsiZGtKRuXsAYxdcWco/9J6vQ3G7LoHAHVYAiAHpiTgXBsr/FEU9vrKsfDNYyBosBBEqKWlkMhMOKXc4Q=="}]},"_npmUser":{"name":"aistackteam","email":"aistack.run@gmail.com"},"directories":{},"maintainers":[{"name":"aistackteam","email":"aistack.run@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/claude-code-proxy_0.1.2_1752925221919_0.12457171612806683"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-17T08:26:28.517Z","modified":"2025-07-19T11:40:22.533Z","0.1.0":"2025-07-17T08:26:29.133Z","0.1.1":"2025-07-17T09:04:29.770Z","0.1.2":"2025-07-19T11:40:22.320Z"},"bugs":{"url":"https://github.com/aistackhq/claude-code-proxy/issues"},"author":{"name":"AI Stack HQ"},"license":"MIT","homepage":"https://github.com/aistackhq/claude-code-proxy#readme","keywords":["anthropic","claude","proxy","litellm","openai","gemini","ai","llm","api","cli"],"repository":{"type":"git","url":"git+https://github.com/aistackhq/claude-code-proxy.git"},"description":"A high-performance proxy server that translates Anthropic Claude API requests to LiteLLM format for multi-provider LLM access","maintainers":[{"name":"aistackteam","email":"aistack.run@gmail.com"}],"readme":"# @aistack/claude-code-proxy\n\nA high-performance proxy server that translates Anthropic Claude API requests to LiteLLM format, enabling seamless integration with multiple LLM providers including OpenAI, Google Gemini, OpenRouter, and Anthropic.\n\n## Features\n\n- 🚀 **Multi-Provider Support**: Seamlessly switch between OpenAI, Gemini, OpenRouter, and Anthropic models\n- 🔄 **Automatic Format Translation**: Converts Anthropic API format to LiteLLM format and back\n- 🎯 **Smart Model Mapping**: Intelligently maps Claude models to equivalent models from other providers\n- 📡 **Streaming Support**: Full support for Server-Sent Events (SSE) streaming responses\n- 🛡️ **Production Ready**: Comprehensive error handling, logging, and graceful shutdown\n- ⚡ **High Performance**: Built with Go for optimal performance and low resource usage\n- 🔧 **Configurable**: Flexible configuration via environment variables\n\n## Installation\n\nInstall globally using npm:\n\n```bash\nnpm install -g @aistack/claude-code-proxy\n```\n\n## Quick Start\n\n1. **Initialize configuration**:\n\n```bash\nccproxy init\n```\n\nThis will prompt you to create a configuration file at either:\n- User level: `$HOME/.ccproxy/settings.json`\n- Project level: `./.ccproxy/settings.json`\n\n2. **Edit the configuration file**:\n\n```json\n{\n  \"server\": {\n    \"port\": 8082,\n    \"host\": \"0.0.0.0\"\n  },\n  \"providers\": {\n    \"openai\": {\n      \"apiKey\": \"sk-...\",\n      \"baseURL\": \"https://api.openai.com/v1\",\n      \"responseStyle\": \"openai\"\n    },\n    \"anthropic\": {\n      \"apiKey\": \"sk-ant-...\",\n      \"baseURL\": \"https://api.anthropic.com\",\n      \"responseStyle\": \"anthropic\"\n    },\n    \"gemini\": {\n      \"apiKey\": \"...\",\n      \"baseURL\": \"https://generativelanguage.googleapis.com\",\n      \"responseStyle\": \"openai\"\n    },\n    \"openrouter\": {\n      \"apiKey\": \"sk-or-v1-...\",\n      \"baseURL\": \"https://openrouter.ai/api/v1\",\n      \"responseStyle\": \"openai\"\n    }\n  },\n  \"models\": {\n    \"bigModel\": \"gpt-4@openai\",\n    \"smallModel\": \"gpt-4-mini@openai\"\n  },\n  \"logging\": {\n    \"level\": \"info\",\n    \"format\": \"json\"\n  }\n}\n```\n\n3. **Start the proxy**:\n\n```bash\n# Start proxy server and launch claude CLI (default behavior)\nccproxy\n\n# Or start only the proxy server\nccproxy server\n```\n\nThe server will start on `http://localhost:8082` (or your configured port).\n\n## Commands\n\n### Available Commands\n\n- **`ccproxy`** (default) - Start proxy server (if needed) and launch claude CLI\n- **`ccproxy server`** - Start only the proxy server\n- **`ccproxy init`** - Initialize configuration file interactively\n  - `--scope user` - Create user-level configuration\n  - `--scope project` - Create project-level configuration\n- **`ccproxy help`** - Show help message\n- **`ccproxy version`** - Show version information\n\n### Global Options\n\n- **`--debug`** - Enable debug logging (applies to all commands)\n- **`--port`** - Override server port (server command only)\n\n### Examples\n\n```bash\n# Start server and launch claude CLI (default behavior)\nccproxy\n\n# Start with debug logging enabled\nccproxy --debug\n\n# Start only the proxy server\nccproxy server\n\n# Start server on custom port\nccproxy server --port 8080\n\n# Start server with debug logging\nccproxy server --debug\n\n# Initialize configuration interactively\nccproxy init\n\n# Create user-level configuration\nccproxy init --scope user\n\n# Create project-level configuration\nccproxy init --scope project\n```\n\n## Usage\n\n## Configuration\n\n### Configuration Files\n\nThe proxy loads configuration from multiple sources in priority order:\n\n1. **Command Line Arguments** (highest priority)\n   - `--port`: Override server port\n2. **JSON Configuration Files**:\n   - `/etc/ccproxy/managed-settings.json` (managed/system-wide)\n   - `$CWD/.ccproxy/settings.json` (project-level)\n   - `$HOME/.ccproxy/settings.json` (user-level)\n\n### Model Format\n\nModels are specified in the format `modelname@provider`:\n- `gpt-4@openai`\n- `claude-3-opus@anthropic`\n- `gemini-pro@gemini`\n- `gpt-4@openrouter`\n\n### Response Styles\n\nProviders can have different response styles:\n- `\"responseStyle\": \"anthropic\"` - Native Anthropic format (no transformation)\n- `\"responseStyle\": \"openai\"` - OpenAI format (requires transformation)\n\nThis allows the proxy to skip unnecessary transformations for providers that natively support Anthropic's API format.\n\n## Model Mapping\n\nThe proxy automatically maps Claude models to configured models:\n\n| Claude Model | Mapped To | Description |\n|--------------|-----------|-------------|\n| claude-*-haiku-* | `smallModel` | Maps to the configured small model |\n| claude-*-sonnet-* | `bigModel` | Maps to the configured big model |\n| Other models | As specified | Uses the model@provider format |\n\n## Configuration Options\n\n### JSON Configuration\n\n| Field | Description | Default |\n|-------|-------------|---------|\n| `server.port` | Server port | `8082` |\n| `server.host` | Server host | `0.0.0.0` |\n| `providers.<name>.apiKey` | Provider API key | - |\n| `providers.<name>.baseURL` | Provider base URL | - |\n| `providers.<name>.responseStyle` | Response format style | `openai` |\n| `models.bigModel` | Model for large requests | `gpt-4@openai` |\n| `models.smallModel` | Model for small requests | `gpt-4-mini@openai` |\n| `logging.level` | Log level | `info` |\n| `logging.format` | Log format | `json` |\n\n\n## Default Behavior\n\nWhen you run `ccproxy` without arguments, it will:\n1. Check if the proxy server is already running\n2. Start the server if it's not running\n3. Launch the claude CLI with ANTHROPIC_BASE_URL set to the proxy\n\nThis means you can use `ccproxy` as a drop-in replacement for the `claude` command while automatically getting multi-provider support.\n\n### Adding Custom Providers\n\nYou can add custom providers with native Anthropic support:\n\n```json\n{\n  \"providers\": {\n    \"custom-llm\": {\n      \"baseURL\": \"https://your-llm-api.com\",\n      \"apiKey\": \"your-api-key\",\n      \"responseStyle\": \"anthropic\"\n    }\n  }\n}\n```\n\nThen use it with: `custom-model@custom-llm`\n\n## Platform Support\n\nThe CLI is available for the following platforms:\n\n- macOS (Intel & Apple Silicon)\n- Linux (x64 & ARM64)\n- Windows (x64)\n\n## Troubleshooting\n\n### Binary Not Found\n\nIf you see \"Binary not found\" error, it means your platform is not supported. Please [open an issue](https://github.com/aistackhq/claude-code-proxy/issues) with your platform details.\n\n### Permission Denied\n\nOn Unix systems, if you get a permission error:\n\n```bash\nsudo npm install -g @aistack/claude-code-proxy\n```\n\n### API Key Issues\n\nEnsure your API keys are correctly set in your `settings.json` file and that they have the necessary permissions.\n\n## Development\n\nFor development or contributing, visit the [GitHub repository](https://github.com/aistackhq/claude-code-proxy).\n\n## License\n\nMIT License - see the [LICENSE](https://github.com/aistackhq/claude-code-proxy/blob/main/LICENSE) file for details.\n\n## Support\n\n- 📚 [Documentation](https://github.com/aistackhq/claude-code-proxy)\n- 🐛 [Issue Tracker](https://github.com/aistackhq/claude-code-proxy/issues)\n- 💬 [Discussions](https://github.com/aistackhq/claude-code-proxy/discussions)\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/aistackhq/claude-code-proxy/blob/main/CHANGELOG.md) for release history.","readmeFilename":"README.npm.md"}