OpenAI-compatible API proxy that translates requests into Claude Code CLI invocations. Connect any OpenAI-compatible client and let Claude Code do the heavy lifting, or step in and guide it when you need precise control.
npm install -g @erdinccurebal/ccp
Everything you need to bridge OpenAI clients with Claude Code
Drop-in replacement for OpenAI endpoints. Works with Cursor, Continue, Open WebUI, Cline, Windsurf, and any OpenAI-compatible client.
Real-time streaming responses via Server-Sent Events. Get instant feedback as Claude Code processes your requests.
Full-featured command-line interface for configuration, server management, and service control. One command to get started.
Install as a system service with autostart. Supports macOS (launchd) and Linux (systemd) out of the box.
Multi-turn session management with optional file persistence. Conversations resume seamlessly across requests and restarts.
Claude CLI errors are captured and returned as readable messages. No more empty responses or cryptic failures.
Up and running in under a minute
# Install globally
npm install -g @erdinccurebal/ccp
# Configure your API key
ccp config set API_KEY my-secret-key
# Start the server
ccp start
# Send a streaming request
curl http://localhost:8888/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'
# Or run as a background service
ccp service install
ccp service start
Complete command reference
| Command | Description |
|---|---|
| ccp start | Start the proxy server |
| ccp config set <KEY> <VALUE> | Set a config value |
| ccp config get <KEY> | Get a config value |
| ccp config list | List all config values |
| ccp config reset <KEY> | Reset a config value to default |
| ccp config path | Show config file path |
| ccp config help | Show available config keys and values |
| ccp service install | Install as system service (autostart) |
| ccp service uninstall | Remove system service |
| ccp service start | Start the background service |
| ccp service stop | Stop the background service |
| ccp service restart | Restart the background service |
| ccp service status | Check service status |
| ccp version | Show version |
| ccp help | Show help |
All settings via ccp config set or environment variables
| Key | Default | Description |
|---|---|---|
| API_KEY | CCP_API_KEY | API key for authenticating requests |
| PORT | 8888 | Server port |
| HOST | 127.0.0.1 | Server bind address |
| CORS_ORIGIN | * | Allowed CORS origin |
| CLAUDE_PATH | claude | Path to Claude CLI binary |
| CLAUDE_WORKING_DIR | (cwd) | Default working directory for Claude |
| CLAUDE_PERMISSION_MODE | default | Permission mode (default, plan, bypassPermissions) |
| CLAUDE_MAX_TURNS | 25 | Max agentic turns per request |
| CLAUDE_TIMEOUT_MS | 300000 | Timeout per invocation (5 min) |
| SESSION_TTL_MS | 3600000 | Session time-to-live (1 hour) |
| SESSION_FILE | (empty) | Path to session persistence file |
| DEFAULT_MODEL | claude-sonnet-4-5-20250929 | Default model |
| LOG_LEVEL | info | Log level (error, warn, info, debug) |
| LOG_FILE | (empty) | Log file path (also logs to console) |
| LOG_MAX_SIZE | 10mb | Max log file size before rotation |
| LOG_MAX_FILES | 5 | Number of rotated log backups |
OpenAI-compatible REST API
Health check endpoint. Returns {"status": "ok"}.
List available models. Requires Authorization: Bearer <API_KEY>.
Model aliases: sonnet, opus, haiku
OpenAI-compatible chat completions. Supports both streaming and non-streaming responses.
Includes token usage, request tracing via X-Request-Id, and multi-turn session management.