ccproxy enables developers to build custom mods for Claude Code, allowing them to hook any request, modify responses, and route intelligently. It benefits operations teams by streamlining AI model interactions and integrating with workflows like Claude Code, OpenAI, and OpenRouter.
git clone https://github.com/starbaser/ccproxy.gitccproxy is a proxy tool that intercepts Claude Code requests and routes them to different LLM providers based on defined rules. It works by sitting between Claude Code and the API, evaluating each request against criteria like token count, model type, or tool usage, then dynamically rewriting requests to the most suitable model. The tool uses a hook-based pipeline system where rules are evaluated in order and matched requests are labeled, then routed through LiteLLM's model alias feature to their destination provider. This allows teams to optimize costs and capabilities by keeping standard coding tasks on Claude while directing high-context requests to Gemini's 2M token window or web searches to Perplexity, all while Claude Code remains unaware of the routing happening behind the scenes.
["Install ccproxy in your development environment: `npm install -g ccproxy` or `pip install ccproxy`","Configure the proxy to target your specific AI service (e.g., OpenAI, Claude Code) by setting the `TARGET_SERVICE` environment variable or config file","Write a custom mod script (JavaScript/Python) that defines your interception logic using ccproxy's hook system. Example: `ccproxy.modifyResponse(condition, transformation)`","Run your application with the proxy active: `ccproxy --config=my-mods.json --target=openai`","Test your modifications by making sample requests and verifying the intercepted/modified responses in the proxy logs. Use `ccproxy --debug` for verbose output"]
Route high-context requests to Gemini's 2M token window while keeping standard tasks on Claude
Direct web search requests to Perplexity while using Claude for other coding tasks
Optimize LLM provider usage based on token count thresholds and request characteristics
Integrate multiple LLM providers with Claude Code without modifying application code
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/starbaser/ccproxyCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use ccproxy to intercept and modify API requests/responses for [TARGET_SERVICE] when interacting with [AI_MODEL]. Specifically, [ACTION]: [MODIFY_REQUEST/LOG_RESPONSE/INJECT_DATA]. Include [CONDITIONS] for when this should trigger. Example: 'Use ccproxy to log all API responses from OpenAI when the request contains the string "summarize" and inject a timestamp into the response metadata.'
```json
{
"intercepted_request": {
"method": "POST",
"url": "https://api.openai.com/v1/chat/completions",
"headers": {
"Authorization": "Bearer sk-...",
"Content-Type": "application/json"
},
"body": {
"model": "gpt-4",
"messages": [{"role": "user", "content": "Summarize the Q3 financial report for Acme Corp"}],
"max_tokens": 500
}
},
"modified_response": {
"original_content": "Acme Corp's Q3 revenue grew 15% YoY to $2.4B, driven by strong SaaS sales...",
"modified_content": "[2024-05-15 14:32:17 UTC] Acme Corp's Q3 revenue grew 15% YoY to $2.4B, driven by strong SaaS sales...",
"metadata": {
"processing_time": "125ms",
"proxy_action": "timestamp_injection",
"user_id": "user_12345"
}
}
}
```
**Workflow Impact:**
The proxy intercepted 3 requests during this session, all containing the word 'summarize' in the prompt. The timestamp injection ensures traceability for audit purposes, while the metadata helps track latency and identify potential bottlenecks in the AI pipeline. This modification required zero changes to the original application code, demonstrating how ccproxy enables non-invasive customization of AI interactions.Single API for 100+ LLM providers
The Unified Interface For LLMs
Unlock data insights with interactive dashboards and collaborative analytics capabilities.
AI assistant built for thoughtful, nuanced conversation
Agents that listen, think and act for you.
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan