agcp-1.2.0 is not a library.
A blazing-fast Rust proxy that translates Anthropic's Claude API to Google's Cloud Code API. Use Claude and Gemini models through a single Anthropic-compatible endpoint.
Why AGCP?
- Lightweight - Single binary, minimal dependencies, ~3MB compiled
- Fast - Written in Rust with async I/O, handles concurrent requests efficiently
- Simple - Just
agcp loginand you're ready, no config files needed - Powerful - Multi-account support, response caching, smart load balancing
Features
- Anthropic API Compatible - Works with Claude Code, OpenCode, Cursor, Cline, and other Anthropic API clients
- Multiple Models - Access Claude (Opus, Sonnet) and Gemini (Flash, Pro) through a single endpoint
- Multi-Account Support - Rotate between multiple Google accounts with smart load balancing
- Response Caching - Cache non-streaming responses to reduce quota usage
- Interactive TUI - Beautiful terminal UI for monitoring and configuration
- Background Daemon - Runs quietly in the background
Quick Start
# Install from source
# Login with Google OAuth
# Start the proxy (runs as background daemon)
# Configure your AI tool to use http://127.0.0.1:8080
Installation
Homebrew (macOS/Linux)
APT (Debian/Ubuntu)
# Add the GPG key and repository
|
|
# Install
DNF (Fedora/RHEL)
# Add the repository
# Install
AUR (Arch Linux)
# With an AUR helper (e.g. yay, paru)
# Or manually
Nix
# Run directly
# Or install into profile
From Source
# Optional: Install to PATH
Shell Completions
# Bash
# Zsh
# Fish
Usage
Commands
| Command | Description |
|---|---|
agcp |
Start the proxy server (daemon mode) |
agcp login |
Authenticate with Google OAuth |
agcp setup |
Configure AI tools to use AGCP |
agcp tui |
Launch interactive terminal UI |
agcp status |
Check if server is running |
agcp stop |
Stop the background server |
agcp restart |
Restart the background server |
agcp logs |
View server logs (follows by default) |
agcp config |
Show current configuration |
agcp accounts |
Manage multiple accounts |
agcp doctor |
Check configuration and connectivity |
agcp quota |
Show model quota usage |
agcp stats |
Show request statistics |
agcp test |
Verify setup works end-to-end |
CLI Options
)
)
)
Interactive TUI
AGCP includes a terminal UI for monitoring and configuration (agcp tui):
Features:
- Overview - Real-time request rate, response times, account status
- Logs - Syntax-highlighted log viewer with scrolling
- Accounts - Manage and monitor account quota (search with
/, sort withs) - Config - Edit configuration interactively
- Mappings - Configure model name mappings with presets and glob rules
- Quota - Visual quota usage with donut charts
Model Aliases
For convenience, you can use these short aliases:
| Alias | Model |
|---|---|
opus |
claude-opus-4-6-thinking |
sonnet |
claude-sonnet-4-5 |
sonnet-thinking |
claude-sonnet-4-5-thinking |
flash |
gemini-3-flash |
pro |
gemini-3-pro-high |
gpt-oss |
gpt-oss-120b-medium |
Supported Models
Claude Models
claude-opus-4-6-thinkingclaude-opus-4-5-thinkingclaude-sonnet-4-5claude-sonnet-4-5-thinking
Gemini Models
gemini-3-flashgemini-3-pro-highgemini-3-pro-low
Other Models
gpt-oss-120b-medium
Configuration
AGCP uses a TOML configuration file at ~/.config/agcp/config.toml:
[]
= 8080
= "127.0.0.1"
# api_key = "your-optional-api-key"
= 300 # Per-request timeout (default: 5 minutes)
[]
= false
= false
[]
= "hybrid" # "sticky", "roundrobin", or "hybrid"
= 0.1 # Deprioritize accounts below 10% quota
= false
[]
= true
= 300
= 100
[]
= 120
= 5
= 1 # Max parallel requests to Cloud Code API
= 500 # Minimum delay between requests (ms)
Account Selection Strategies
sticky- Use the same account until it hits quota limitsroundrobin- Rotate through accounts evenlyhybrid- Smart selection based on account health and quota (recommended)
Multi-Account Management
AGCP supports multiple Google accounts for higher throughput:
# Add accounts
# View accounts
# Manage accounts
API Endpoints
| Endpoint | Description |
|---|---|
POST /v1/messages |
Anthropic Messages API (streaming and non-streaming) |
GET /v1/models |
List available models |
GET /health |
Health check |
GET /stats |
Server and cache statistics |
Response Caching
AGCP caches non-streaming responses to reduce API quota usage:
- Identical requests return cached responses instantly
- Streaming and thinking model responses are not cached
- Use
X-No-Cache: trueheader to bypass cache - Cache headers:
X-Cache: HIT,X-Cache: MISS,X-Cache: BYPASS
Configuring AI Tools
Claude Code
Select "Claude Code" from the interactive menu, or manually add to ~/.claude/settings.json:
Other Tools
Point any Anthropic API-compatible tool to http://127.0.0.1:8080/v1.
Troubleshooting
Files
| Path | Description |
|---|---|
~/.config/agcp/config.toml |
Configuration file |
~/.config/agcp/accounts.json |
Account credentials |
~/.config/agcp/agcp.log |
Server logs |
License
MIT - See LICENSE for details.
Made with Rust