Skip to content

cjellick/anthropic-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anthropic API Proxy

A simple local proxy for inspecting Anthropic API requests and responses. Sits between your client and the Anthropic API, logging all traffic as JSON files with a web UI for browsing.

Quick Start

# Terminal 1 - Start the API proxy
uv run simple_proxy.py

# Terminal 2 - Start the web viewer
uv run viewer.py

Then point your Anthropic client's base URL to http://localhost:5001.

How It Works

The proxy forwards all requests to https://api.anthropic.com, passing through headers (including your API key) unchanged. Both requests and responses are saved as JSON files in ./logs/.

The web viewer at http://localhost:5002 lets you browse and inspect logged API calls — messages, tool use, token counts, etc.

Endpoints

Service URL Description
Proxy http://localhost:5001 Point your client here
Viewer http://localhost:5002 Web UI for browsing logs
Health http://localhost:5001/health Health check

Client Configuration Examples

Any client that lets you set a custom base URL will work:

# Python SDK
client = anthropic.Anthropic(base_url="http://localhost:5001")
# Claude Code
ANTHROPIC_BASE_URL=http://localhost:5001 claude

Log Format

Logs are saved to ./logs/ as pairs of JSON files:

  • {timestamp}_request.json — full request body
  • {timestamp}_response.json — full response (streaming responses are reconstructed)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors