• Docs
  • Docs
Quick Start
Agent setup
Claude Code setup
Codex setup
Cursor setup
Visual Studio Code Copilot setup
Web browser proxy setup
SDK setup
Vertex AI

Claude Code setup

Send every Claude Code request through aiproxy so you can observe, audit, and rewrite Anthropic traffic.

Prerequisites

  • aiproxy running locally (examples below use http://localhost:8080)
  • Install the aiproxy certificate authority (see Quick Start → TLS certificate)

Option 1 · Change the Anthropic base URL

The Claude CLI accepts a custom base URL. Point it at the /anthropic reverse-proxy endpoint that aiproxy exposes to run in router mode: aiproxy forwards the request upstream, adds observability, and skips full TLS interception.

export ANTHROPIC_BASE_URL=http://localhost:8080/anthropic claude

Option 2 · Use HTTP proxy mode

Proxy mode routes every HTTP(S) call the CLI makes through aiproxy. The NO_PROXY list keeps loopback addresses local so the CLI can still talk to services running on the same machine.

export HTTP_PROXY=http://localhost:8080 export HTTPS_PROXY=$HTTP_PROXY export NO_PROXY=localhost,127.0.0.1 claude

Some Node.js distributions ship a standalone certificate bundle and ignore the operating system trust store. If Claude fails TLS handshakes, point the runtime at the aiproxy CA explicitly:

export NODE_EXTRA_CA_CERTS=~/.aiproxy/aiproxy-ca-cert.pem claude

Remove the proxy settings when you finish testing:

unset HTTP_PROXY HTTPS_PROXY NO_PROXY NODE_EXTRA_CA_CERTS

Verify traffic reaches aiproxy

Run a quick prompt with the CLI, for example:

claude "Explain how aiproxy monitors Anthropic traffic."

Watch the aiproxy logs or terminal UI. You should see requests to /v1/messages. If no requests appear, confirm the environment variables remain set in the current shell and that the certificate authority is trusted.

    On this page

  • Prerequisites
  • Option 1 · Change the Anthropic base URL
  • Option 2 · Use HTTP proxy mode
  • Verify traffic reaches aiproxy