OriginCoder

Claude Code Proxy: HTTP Proxy or API Gateway? Which One You Need

Published 2026-11-11

When people search for "Claude Code proxy" or "Claude Code relay", they mean one of two things that solve different problems. Mixing them up is the most common reason a setup does not work. This short guide helps you tell them apart and points to the right steps. The full walkthrough for the second case already exists, so we only cover the differences here.

Disclosure: we run OriginCoder, an API gateway, which is the second case. This guide is current as of November 2026.

Two meanings

What you want What changes Typical reason
1. HTTP proxy Claude Code's network traffic goes out through a proxy server, but it still talks to the same service The network path A corporate network, a firewall, or a required outbound proxy
2. API gateway or relay Claude Code sends requests to a different API address, which forwards them to a model provider The service address and the key Pay-per-token billing, one key for several models, per-request cost records

A quick test: do you need to change who receives your requests, or only the road they travel on? If the destination stays Anthropic, it is case 1. If the destination changes to a gateway, it is case 2.

Case 1: an HTTP proxy

If your network requires an outbound proxy, Claude Code honours the standard proxy environment variables used by most command-line tools:

export HTTPS_PROXY="http://proxy.example.com:8080"
export HTTP_PROXY="http://proxy.example.com:8080"
export NO_PROXY="localhost,127.0.0.1"

Notes:

  • The address proxy.example.com:8080 is a placeholder for your own proxy.
  • If your proxy inspects TLS with its own certificate authority, you may also need to tell Node.js to trust that certificate, for example with NODE_EXTRA_CA_CERTS.
  • Proxy support details, including which proxy types work, change between versions. Check Anthropic's current Claude Code documentation for the authoritative list.
  • This changes only the network route. Your account, billing and limits stay with whichever service you are signed in to.

This is a networking topic and is covered by Anthropic's documentation, so we do not go deeper. Be careful with third-party proxy software from unknown sources: a proxy sees everything that passes through it.

Case 2: an API gateway (custom Base URL)

If you want pay-per-token billing, several models behind one key, or per-request cost records, you point Claude Code at a gateway by setting its address and key:

export ANTHROPIC_BASE_URL="https://origincoder.com"
export ANTHROPIC_AUTH_TOKEN="sk-xxxx"

Do not add /v1 to the Base URL for Claude Code, since Claude Code appends the path itself. The complete setup, including CC-Switch one-click import, settings.json, verification and troubleshooting, is in How to use Claude Code with a custom API endpoint. You do not need an HTTP proxy for this, unless your network also requires one, in which case combine both.

Using both together

They are independent. If your office network forces an outbound proxy and you also want a gateway, set the proxy variables from case 1 and the Base URL variables from case 2. Requests then go to the gateway, through your proxy.

Which one should you pick?

A gateway is a third party in the request path and can see your prompts and code context, so read its terms first. Per-model prices are on the model pricing page. OriginCoder is independent and not affiliated with Anthropic.

All guides

More guides