coding.sh proxy
Run a local Anthropic/OpenAI API proxy that logs every model call. Every option of coding.sh proxy and its subcommands, from its own --help.
coding.sh proxy [action] [options]
Run a local Anthropic/OpenAI API proxy that logs every model call
Commands
status Show whether a proxy is running, and where (exit 1 when not)
stop Stop the background proxy
env Print the ANTHROPIC_BASE_URL / OPENAI_BASE_URL exports for the proxy
Options
-p, --port <PORT> Port to listen on, 0 = any free port ([proxy] port) (default: 4320)
--host <HOST> Interface to bind ([proxy] host) (default: 127.0.0.1)
--anthropic-upstream <URL> Where Anthropic calls go, e.g. a gateway ([proxy] anthropic_upstream) (default: https://api.anthropic.com)
--openai-upstream <URL> Where OpenAI calls go ([proxy] openai_upstream) (default: https://api.openai.com)
--background Start detached, print the URL once it answers (log: ~/.coding.sh/proxy.log)
-q, --quiet No line per call on stderr
Examples
coding.sh proxy
coding.sh proxy --background
coding.sh init --proxy
Notes
Forwards /v1/messages (and count_tokens), /v1/chat/completions, /v1/responses and every other path to the real API with the client's own auth headers. Auth headers are never stored.
Streams pass through as they arrive. A failed store write never fails the request.
Calls from Claude Code and Codex land in the session their hooks capture; other clients get a proxy-<hash> session per conversation (or send x-coding-sh-session: <id>).
Prints the environment to stdout; one line per call goes to stderr. coding.sh proxy status
Show whether a proxy is running, and where (exit 1 when not).
coding.sh proxy status Show whether a proxy is running, and where (exit 1 when not) Examples coding.sh proxy status
coding.sh proxy stop
Stop the background proxy.
coding.sh proxy stop Stop the background proxy Examples coding.sh proxy stop
coding.sh proxy env
Print the ANTHROPIC_BASE_URL / OPENAI_BASE_URL exports for the proxy.
coding.sh proxy env Print the ANTHROPIC_BASE_URL / OPENAI_BASE_URL exports for the proxy Examples eval "$(coding.sh proxy env)"