### Example Configuration File Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md This is an example configuration file. Copy it to config.json to set up your application. ```json { "port": 8000, "log_level": "INFO", "providers": { "openai": { "api_key": "YOUR_OPENAI_API_KEY", "base_url": "https://api.openai.com/v1" }, "anthropic": { "api_key": "YOUR_ANTHROPIC_API_KEY" }, "gemini": { "api_key": "YOUR_GEMINI_API_KEY" } }, "routes": [ { "path": "/v1/chat/completions", "provider": "openai", "converter": "anthropic_to_openai" }, { "path": "/v1/completions", "provider": "anthropic", "converter": "openai_to_anthropic" }, { "path": "/v1/gemini/chat", "provider": "gemini", "converter": "anthropic_to_gemini" } ] } ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Clone the UniClaudeProxy repository and install the required Python packages. ```bash git clone https://github.com/vibheksoni/UniClaudeProxy.git cd UniClaudeProxy pip install -r requirements.txt ``` -------------------------------- ### Start UniClaudeProxy on Linux/macOS Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Make the Run.sh script executable and then run it to start the proxy service on Linux or macOS. ```bash chmod +x Run.sh ./Run.sh ``` -------------------------------- ### Start UniClaudeProxy on Windows Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Execute the Run.bat script to start the proxy service on a Windows environment. ```bash Run.bat ``` -------------------------------- ### Create and Edit Configuration File Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Copy the example configuration file and edit it with your specific API keys and model mappings. ```bash cp config.example.json config.json ``` -------------------------------- ### Start UniClaudeProxy Directly Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Run the UniClaudeProxy service directly using uvicorn, specifying the host and port. ```bash python -m uvicorn app.main:app --host 127.0.0.1 --port 9223 ``` -------------------------------- ### Launch Claude Code with Profile Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Start Claude Code using the configured profile to direct its requests through the UniClaudeProxy. ```bash claude --profile cc-proxy ``` -------------------------------- ### ReAct XML Observation Example Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Demonstrates how tool call results are received in XML format when using the ReAct XML tool calling mechanism. ```xml total 42 drwxr-xr-x 5 user user 4096 Feb 9 12:00 . ... ``` -------------------------------- ### System Prompt Replacement Example Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Use `system_replacements` to modify system prompts for models that reject identity claims. Replacements are applied universally before provider dispatch. ```json "system_replacements": { "You are Claude Code, Anthropic's official CLI for Claude.": "You are an advanced AI coding assistant integrated into a CLI tool.", "Claude Code": "the coding assistant" } ``` -------------------------------- ### ReAct XML Tool Call Example Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Shows how models without native function calling can use XML to describe tool calls. This is used when 'use_react' is enabled in the model configuration. ```xml Bash {"command": "ls -la"} ``` -------------------------------- ### Configure Google Gemini Provider Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Configure UniClaudeProxy to connect to the Google Gemini API. This setup supports Gemini's advanced features like function calling. ```json { "provider_type": "gemini", "api_key": "your-gemini-key", "base_url": "https://generativelanguage.googleapis.com/v1beta", "headers": { "x-goog-api-key": "your-gemini-key" }, "models": { "gemini-2.5-pro-preview-06-05": { "name": "Gemini 2.5 Pro" } } } ``` -------------------------------- ### UniClaudeProxy Configuration File Structure Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md The main configuration file for UniClaudeProxy, defining server, model, and provider settings. ```json { "server": { "host": "127.0.0.1", "port": 9223, "local_only": true }, "models": { "": "/" }, "providers": { "": { "provider_type": "openai | gemini | claude", "api_key": "your-api-key", "base_url": "https://api.example.com", "headers": {}, "models": { "": { ... } } } } } ``` -------------------------------- ### Configure OpenAI-Compatible Provider Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Set up UniClaudeProxy to use an OpenAI-compatible API endpoint. This is useful for various services like DeepSeek, Ollama, vLLM, and cloud inference providers. ```json { "provider_type": "openai", "api_key": "your-key", "base_url": "https://api.deepseek.com", "models": { "deepseek-chat": { "name": "DeepSeek V3", "max_output_tokens": 8192 } } } ``` -------------------------------- ### Check Tool Calls in Debug Log Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Use this command to verify if tool calls are working correctly by searching for 'REACT STREAM' or 'tool_use=True' in the debug log and showing the last 10 lines. ```bash # Check tool calls working grep "REACT STREAM\|tool_use=True" debug.log | tail -10 ``` -------------------------------- ### UniClaudeProxy Request Flow Diagram Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Illustrates the request flow from Claude Code CLI through UniClaudeProxy to any LLM provider, including the conversion and streaming process. ```text Claude Code CLI --> UniClaudeProxy (localhost:9223) --> Any LLM Provider (Anthropic fmt) Route + Convert + Stream (OpenAI/Gemini/etc) ^ | +---- Anthropic SSE <----+ ``` -------------------------------- ### Enable Local-Only Mode Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Configure UniClaudeProxy to only accept connections from localhost for enhanced security. This setting is enabled by default. ```json { "server": { "host": "127.0.0.1", "port": 9223, "local_only": true } } ``` -------------------------------- ### Configure Anthropic Passthrough Provider Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Set up UniClaudeProxy to forward requests directly to an Anthropic-compatible API. This configuration bypasses any conversion, forwarding the raw request body. ```json { "provider_type": "claude", "api_key": "your-key", "base_url": "https://api.anthropic.com/v1", "headers": { "anthropic-version": "2023-06-01" }, "models": { "claude-sonnet-4-5-20250929": { "name": "Claude Sonnet 4.5" } } } ``` -------------------------------- ### UniClaudeProxy Architecture Diagram Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md This diagram illustrates the flow of requests from Claude Code CLI through UniClaudeProxy to various LLM providers, including Anthropic SSE. ```text Claude Code CLI --> UniClaudeProxy (localhost:9223) --> Any LLM Provider ^ | +---- Anthropic SSE <----+ ``` -------------------------------- ### Configure Claude Code Profile Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Set up a Claude Code profile in settings.json to route traffic through UniClaudeProxy. Ensure ANTHROPIC_BASE_URL is set to the proxy's address. ```json { "profiles": { "cc-proxy": { "env": { "ANTHROPIC_AUTH_TOKEN": "", "ANTHROPIC_BASE_URL": "http://127.0.0.1:9223", "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1", "API_TIMEOUT_MS": "3000000", "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "50000", "CLAUDE_BASH_NO_LOGIN": "1" }, "permissions": { "allow": [], "deny": [] } } } } ``` -------------------------------- ### Check Route Resolution in Debug Log Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Use this command to check how routes are being resolved by filtering the debug log for 'Request: model=' and showing the last 5 lines. ```bash # Check route resolution grep "Request: model=" debug.log | tail -5 ``` -------------------------------- ### Check for Errors in Debug Log Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Use this command to quickly identify errors by filtering the debug log for 'ERROR' or 'Traceback' and displaying the last 10 lines. ```bash # Check for errors grep "ERROR\|Traceback" debug.log | tail -10 ``` -------------------------------- ### See Outgoing Requests in Debug Log Source: https://github.com/vibheksoni/uniclaudeproxy/blob/master/README.md Use this command to inspect what is being sent upstream by searching for 'OUTGOING REQUEST' in the debug log and showing the last 5 lines. ```bash # See what's being sent upstream grep "OUTGOING REQUEST" debug.log | tail -5 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.