Amp
Configure Sourcegraph's Amp coding agent to route through Cheapa API using CLIProxyAPI for unified model access and billing.
What This Does
Amp is Sourcegraph's frontier coding agent for the terminal and editor. It supports multiple agent modes — smart, rush, and deep — and integrates with IDEs like VS Code, JetBrains, and Zed. By routing Amp through Cheapa API via CLIProxyAPI, you can use any supported model while consolidating your AI spend under a single Cheapa API account.
Amp's native BYOK (Isolated Mode) has been removed. To use Cheapa API with Amp, you need CLIProxyAPI — a lightweight proxy server that intercepts Amp's API calls and routes them through your Cheapa API endpoint.
Setup
Step 1: Install Amp
curl -fsSL https://ampcode.com/install.sh | bashOr via npm:
npm install -g @anthropic-ai/ampStep 2: Install CLIProxyAPI
CLIProxyAPI is a proxy server that wraps Amp's API calls to route through custom providers:
docker pull eceasy/cliproxyapiOr install from source:
git clone https://github.com/router-for-me/CLIProxyAPI.git
cd CLIProxyAPIStep 3: Configure CLIProxyAPI
Create a config.yaml for CLIProxyAPI:
server:
port: 3456
upstream-url: "https://ampcode.com"
upstream-api-key: "YOUR_AMP_API_KEY"
restrict-management-to-localhost: true
model-mappings:
claude-opus-4-6: "claude-opus-4.8"
claude-sonnet-4-6: "claude-sonnet-4.6"
claude-haiku-4-6: "gemini-3.1-flash-lite-preview"
force-model-mappings: true
custom-providers:
- name: "Cheapa API"
base-url: "https://api.cheapaapi.com/v1"
api-key: "YOUR_Cheapa API_API_KEY"
models:
# Frontier flagships
- "gpt-5.5"
- "gpt-5.4"
- "claude-opus-4.8"
- "claude-sonnet-4.6"
- "gemini-3.5-flash"
# Code-specialized
- "kimi-k2.7-code"
# High-context, low-cost open-weight options
- "kimi-k2.6"
- "deepseek-v4-pro"
- "deepseek-v4-flash"
- "minimax-m3"
- "glm-5.1"
- "qwen3.6-plus"Replace YOUR_AMP_API_KEY with your Amp key from ampcode.com/settings and YOUR_Cheapa API_API_KEY with your Cheapa API key from cheapaapi.com/keys.
Step 4: Start CLIProxyAPI
docker run -d \
--name cliproxyapi \
-p 3456:3456 \
-v ./config.yaml:/CLIProxyAPI/config.yaml \
eceasy/cliproxyapiStep 5: Configure Amp to Use the Proxy
Point Amp to the local proxy by setting environment variables:
export ANTHROPIC_BASE_URL="http://localhost:3456"
export ANTHROPIC_API_KEY="YOUR_Cheapa API_API_KEY"Add these to your ~/.zshrc or ~/.bashrc to persist across sessions.
Step 6: Verify the Connection
Run Amp and start a conversation:
ampTry a simple prompt to confirm the proxy is routing requests through Cheapa API.
Recommended Models for Amp
| Amp Mode | Mapped Model | Why |
|---|---|---|
| Smart (frontier reasoning) | claude-opus-4.8 | Anthropic's flagship — best long-context reasoning and code understanding |
| Smart (alternative) | gpt-5.5 | OpenAI's flagship — strong general reasoning, 1M context |
| Rush (quick tasks) | gemini-3.1-flash-lite-preview | Fastest and cheapest text response |
| Deep (extended thinking) | claude-sonnet-4.6 | Strong code-focused reasoning at lower cost than Opus |
| Large codebase analysis | minimax-m3 | 1M token context, low per-token cost |
| Bulk / cost-optimised | deepseek-v4-flash | Cheapest tokens in the catalog while still capable |
IDE Integrations
Amp also works with IDEs. After configuring CLIProxyAPI, connect Amp to your editor:
| IDE | Setup |
|---|---|
| VS Code / Cursor / Windsurf | Install Amp CLI, ensure editor is running, then run amp |
| JetBrains | Install Amp CLI, then run amp --jetbrains |
| Zed | Install Amp CLI, ensure Zed is running, then run amp |
| Neovim | Install Amp CLI and the Amp Neovim plugin, then run amp |
Use the command palette (Ctrl+O) and select ide connect to link Amp with your editor.
Troubleshooting
Proxy not starting
- Verify Docker is running:
docker ps - Check CLIProxyAPI logs:
docker logs cliproxyapi - Ensure port 3456 is not in use:
lsof -i :3456
Amp connection errors
- Confirm the proxy is running at
http://localhost:3456 - Verify
ANTHROPIC_BASE_URLis set correctly - Test the proxy directly:
curl http://localhost:3456/health
Model mapping not working
- Check that
force-model-mappings: trueis set in your CLIProxyAPI config - Verify the model names in
model-mappingsmatch what Amp requests - Review CLIProxyAPI logs for unmapped model requests
Authentication errors
- Ensure your Cheapa API API key is valid at cheapaapi.com/keys
- Check that the
custom-providerssection has the correctapi-key
Notes
- Amp's native Isolated Mode (BYOK) has been removed — CLIProxyAPI is the recommended way to use custom providers
- The
model-mappingssection translates Amp's default model names to Cheapa API models - All token consumption routed through Cheapa API appears in your dashboard in real-time
- Amp uses AGENTS.md files for project-specific guidance — these work independently of the proxy setup