惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
NISL@THU
NISL@THU
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tenable Blog
Forbes - Security
Forbes - Security
V2EX - 技术
V2EX - 技术
Webroot Blog
Webroot Blog
Schneier on Security
Schneier on Security
T
The Exploit Database - CXSecurity.com
T
Tor Project blog
C
Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
PCI Perspectives
PCI Perspectives
O
OpenAI News
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
D
Docker
AI
AI
Blog — PlanetScale
Blog — PlanetScale
S
Security @ Cisco Blogs
S
Schneier on Security
The GitHub Blog
The GitHub Blog
W
WeLiveSecurity
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
C
Check Point Blog
A
About on SuperTechFans
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Engineering at Meta
Engineering at Meta
I
InfoQ
T
Threat Research - Cisco Blogs
Project Zero
Project Zero
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
Cisco Talos Blog
Cisco Talos Blog
L
Lohrmann on Cybersecurity
S
Securelist

Show HN

GitHub - steveking-gh/firmion: Firmion is DSL and engine for firmware image generation. GitHub - villagesql/villagesql-skills: Agent skills for VillageSQL - gemini-cli-extension; claude-code-plugin GitHub - flightdeckhq/flightdeck: Observability and control plane for AI agents. CSP Radar GitHub - Light-Heart-Labs/DreamServer: Turn your PC, Mac, or Linux box into an AI server. LLM inference, chat UI, voice, agents, workflows, RAG, and image generation. GitHub - Diplomat-ai/diplomat-agent-ts: What can your TypeScript AI agent do to the real world? Scan your code. See which tool calls have zero checks Code Block Selector - Visual Studio Marketplace Prometheus dependency graph — interactive showcase | Riftmap Show HN: I made a vi-like modal keyboard plugin for Figma GitHub - run-llama/liteparse: A fast, helpful, and open-source document parser GitHub - dalemyers/Roar: A macOS CLI tool for notifications GitHub - district-solutions/open-agent-tools-coder: Enables small-to-large self-hosted ai models to use local source code when running tool-calling agentic workloads. We actively data mine 20,900+ (2+ TB) popular github repos using large and small ai models to create reuseable: json, markdown and parquet files for local-first tool-calling models. GitHub - progapandist/stripeek: A local TUI proxy for real-time Stripe API debugging, built for navigating complex payloads fast. GitHub - sir1st/hermes-desktop: All-in-one cross-platform desktop app for Hermes Agent — bundles Python + hermes-agent + hermes-web-ui GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: Generate Claude Code Workflows using Spec Driven Development approach GitHub - nixys/nxs-universal-chart: The Helm chart you can use to install any of your applications into Kubernetes/OpenShift Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal). Release v0.1.2.1 · kouhxp/yapsnap GitHub - noopolis/moltnet: Self-hostable chat network for AI agents. Pre-built bridges for Claude Code, Codex, and the Claws. Rooms, DMs, history. No Slack bots, no Matrix, no glue code. GitHub - tamerh/enju: Coordinating Humans, AI Agents, and Compute as Peers on a Shared Workflow Graph Show HN: Continuity-auth – Respect-weighted rate limits for the open web GitHub - luml-ai/luml: AI lifecycle platform where engineers and agents track experiments, train models, and ship to production. GitHub - mrdanielcasper/CoreTex: A UNIX-inspired, biomimetic, flat-file AI harness and knowledge engine. GitHub - clemg/pierre-github: Pierre's diffs.com and trees.software for Github GitHub - lyriks-io/unspaghettit: Behavior-driven AI development without prompt spaghetti. GitHub - sofumel/claude-handoff-revive: Resume Claude Code work after rate/usage/context limits without replaying the prior transcript. Auto-saves at 90%/95% usage. Plugin-installable, 10 languages. GitHub - dotexorg/saferpc: Typed, end-to-end encrypted RPC over any bidirectional channel. GitHub - BeeZeeAgent/beezee: Agent harness orchestration Legato Next.js Boilerplate for Internal Tools · CoreUI GitHub - clark-labs-inc/clark-hash: Clark Hash, 32x smaller searchable sketches for embeddings GitHub - ZeroPointRepo/youtube-mcp: The fastest YouTube transcript + YouTube search MCP for AI agents. Try for free. Typing Mastery — climb toward 100+ WPM, deliberately GitHub - Andebugulin/Awareen GitHub - fayzan123/claude-workflow-composer: Visual desktop app for composing multi-agent coding workflows. Drag agents, attach skills and MCPs, wire handoffs, export to .claude/ GitHub - harshaneel/humanize: Best static AI text humanizer. Two research-grounded skills that work in any LLM (Claude, ChatGPT, Gemini, Codex): humanize beats perplexity-based detectors, ai-check produces forensic scoring with evidence-quoted flags. Nine levers, 50+ peer-reviewed sources, 2024-2026 detection literature. GitHub - StackOneHQ/stack-nudge GitHub - nodes-app/swift-markdown-engine: A native AppKit Markdown editor for macOS, built on TextKit 2 and bridged to SwiftUI. We hardened an LLM agent. Each defense we added made it more exploitable. GitHub - alkait/WhatsKept: Agent-queryable WhatsApp history from an iOS backup — a single Go binary. GitHub - octelium/cordium: Open-source, general-purpose sandbox platform for devs and AI agents that provides identity-based secure access to infrastructure without credentials. WAR.GOV/UFO Microfilm5 GitHub - scosman/videowright: Build animated explainer videos with your coding agent GitHub - dipankar/dscode: The code editor you can take apart. GitHub - zoharbabin/web-researcher-mcp: MCP server (Go) for AI assistants: web search, content extraction, academic/patent/news research. Multi-provider routing, 4-tier scraping, search lenses. Works with Claude, Cursor, and any MCP client. GitHub - ruvnet/RuView: π RuView turns commodity WiFi signals into real-time spatial intelligence, vital sign monitoring, and presence detection — all without a single pixel of video. GitHub - scanaislop/aislop: Catch the slop AI coding agents leave in your code: narrative comments, swallowed exceptions, as-any casts, dead code, oversized functions. 50+ rules across 7 languages (TypeScript, JavaScript, Python, Go, Rust, Ruby, PHP). Sub-second, deterministic, no LLM at runtime. MIT-licensed. GitHub - kouhxp/cheap-im: CPU-only voice agent approximating Thinking Machines' Interaction Models demo GitHub - unprovable/OrchidMantis: Orchid Mantis — standalone framework for Zero-Knowledge Proofs of eXploit (ZKPoX). GitHub - MarcellM01/TinySearch: Shrink the web for your local LLMs! GitHub - TangibleResearch/Halgorithem: A Algo designed to detect AI Hallucitions GitHub - DO-SAY-GO/freelang: I love freelang GitHub - CarpseDeam/Aura-IDE: An AI coding harness that shaped itself - Planner/Worker agents, repo awareness, surgical edits, validation, recovery, and safe diff approvals. GitHub - chojs23/concord: A feature-rich TUI client for Discord GitHub - tommyjepsen/awesome-ux-skills: UX & AI Product designs skills you can use today in Claude Code GitHub - aerf-spec/aerf: Agent Evidence Receipt Format (AERF) — an open specification for tamper-evident, independently verifiable records of AI agent actions. GitHub - kklimuk/docx-cli: CLI for AI agents (Claude, Codex) to read, edit, and comment on .docx files with full format fidelity. GitHub - Jwrede/tokentoll: Catch LLM cost changes in code review. Infracost for LLM spend. GitHub - samchon/ttsc: A `typescript-go` toolchain for compiler-powered plugins and type-safe execution + 500x faster lint integrated into compiler GitHub - Higangssh/homebutler: 🏠 Manage your homelab from chat. Single binary, zero dependencies. GitHub - olalie/tapmap: See where your computer connects and what stands out on a live world map. GitHub - Diplomat-ai/diplomat-agent: What can your AI agent do to the real world? Scan your code. See which tool calls have zero checks GitHub - Bajusz15/beacon: Open-source agent for secure remote access, monitoring, and deploys across home-lab and self-hosted machines like Raspberry Pi, N100, or any Linux server. Open web based TTY or tunnel Home Assistant and other local services securely without opening ports. BigTech AI News - Chrome 应用商店 GitHub - vinhnx/VTCode: VT Code is an open-source coding agent with LLM-native code understanding and robust shell safety. Supports multiple LLM providers with automatic failover and efficient context management. GitHub - michaelaz774/decision-engine: A decision operating system for startup founders, powered by Claude Code. Synthesizes wisdom from 25+ legendary founders and investors into interactive AI-driven decision frameworks. GitHub - Chrilleweb/dotenv-diff: Validate environment variable usage in your codebase GitHub - Lumen-Labs/brainapi2: BrainAPI is a knowledge graph–powered AI memory layer that transforms unstructured data into structured knowledge, enabling intelligent search, recommendations, and contextual memory for AI agents and applications. GitHub - familiar-software/familiar: Let AI watch you work. Familiar lets your AI update its memory, skills, and knowledge by watching your screen. GitHub - skorotkiewicz/rudo: A small, elegant dock for Wayland GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. make sidebar/address bar rounded corner toggleable
GitHub - raine/claude-code-proxy: Use Claude Code with your ChatGPT or Kimi subscription via a local Anthropic-compatible proxy
rane · 2026-05-31 · via Show HN

claude-code-proxy lets you use Claude Code with your ChatGPT Plus/Pro subscription or your Kimi Code (kimi.com) account.

Claude Code running through claude-code-proxy

Quick start · Providers · How it works · Configuration · Limitations

Why?

I feel Claude Code is still the best harness around, despite occasional frustrations caused by updates. However, Anthropic keeps tightening the usage limits, while OpenAI is still much more generous.

If you want to use OpenAI plans, your best options seem to be OpenCode and Codex. I tried OpenCode, but the UX has many rough edges, especially around skills feeling like a second-class feature. Fortunately it's open source and I ended up forking it and applying some patches, but would much rather not do it.

Quick start

1. Install

Homebrew (macOS and Linux):

brew install raine/claude-code-proxy/claude-code-proxy

Install script (macOS and Linux):

curl -fsSL https://raw.githubusercontent.com/raine/claude-code-proxy/main/scripts/install.sh | bash

Manual: download a prebuilt binary for your platform from the releases page. Windows artifacts are published as claude-code-proxy-windows-amd64.zip and claude-code-proxy-windows-arm64.zip; extract the .exe somewhere on your PATH.

2. Pick a provider and authenticate

The proxy supports two upstream providers. Pick one and run its login flow; the proxy will refuse to start traffic until a token is stored.

Codex (ChatGPT Plus/Pro):

claude-code-proxy codex auth login     # browser OAuth (PKCE)
# or, on a headless machine:
claude-code-proxy codex auth device    # device-code flow

Sign in with your ChatGPT Plus/Pro account, not an OpenAI API account.

Kimi (kimi.com Kimi Code):

claude-code-proxy kimi auth login      # device-code flow (prints URL + code)

Sign in with your kimi.com account. The verification URL is displayed; open it in any browser, confirm the code, and the CLI polls until done.

On macOS credentials go to Keychain. On Windows they are written under %APPDATA%\claude-code-proxy\<provider>\auth.json; on Linux they are written under ${XDG_CONFIG_HOME:-$HOME/.config}/claude-code-proxy/<provider>/auth.json (mode 0600 where supported).

Verify:

claude-code-proxy codex auth status
claude-code-proxy kimi auth status

3. Start the proxy

claude-code-proxy serve                # listens on 127.0.0.1:18765
PORT=11435 claude-code-proxy serve     # change the listen port

Binds to 127.0.0.1 only. One serve process handles all providers — the upstream for each request is chosen from ANTHROPIC_MODEL.

4. Point Claude Code at it

ANTHROPIC_MODEL selects the provider:

  • gpt-5.5, gpt-5.4, gpt-5.3-codex, gpt-5.3-codex-spark, gpt-5.4-mini, gpt-5.2codex
  • kimi-for-coding, kimi-k2.6, k2.6kimi

An unknown model returns a 400 listing the supported ids. There is no implicit default provider.

Claude Code also issues background requests (session title generation, token counts) against its built-in "small/fast" haiku model id. Those requests would 400 because no provider claims it, so set ANTHROPIC_SMALL_FAST_MODEL to a concrete id too (the same value as ANTHROPIC_MODEL is usually fine):

# Codex
ANTHROPIC_BASE_URL=http://localhost:18765 \
ANTHROPIC_AUTH_TOKEN=unused \
ANTHROPIC_MODEL=gpt-5.5[1m] \
ANTHROPIC_SMALL_FAST_MODEL=gpt-5.4-mini[1m] \
CLAUDE_CODE_AUTO_COMPACT_WINDOW=272000 \
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1 \
  claude

# Kimi
ANTHROPIC_BASE_URL=http://localhost:18765 \
ANTHROPIC_AUTH_TOKEN=unused \
ANTHROPIC_MODEL=kimi-for-coding[1m] \
ANTHROPIC_SMALL_FAST_MODEL=kimi-for-coding[1m] \
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1 \
  claude

CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1 is recommended because the proxy always talks to upstream providers with streaming requests, even when it accumulates a non-streaming Anthropic response for Claude Code. Disabling Claude Code's streaming-to-non-streaming fallback avoids retrying a partially completed stream in a way that can duplicate tool calls.

Or set it persistently in ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "http://127.0.0.1:18765",
    "ANTHROPIC_AUTH_TOKEN": "unused",
    "ANTHROPIC_MODEL": "gpt-5.5[1m]",
    "ANTHROPIC_SMALL_FAST_MODEL": "gpt-5.4-mini[1m]",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": 272000,
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1,
    "CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK": 1
  }
}

5. Context window size

Claude Code decides auto-compaction based on the model's context window. For unknown models, Claude Code uses its own fallback context size. The [1m] suffix is a local Claude Code hint that raises that compaction threshold. It is useful only when the upstream model can actually handle a window that large.

Use the [1m] suffix for Codex and Kimi models so Claude Code uses a larger local compaction threshold, such as gpt-5.5[1m], gpt-5.4-mini[1m], or kimi-for-coding[1m]. The proxy strips a trailing [1m] before sending the request upstream. The suffix affects Claude Code's local compaction decision and does not increase the upstream model's context window.

Official Codex metadata reports gpt-5.5 with a 272K-token window, not a 1M window. Set CLAUDE_CODE_AUTO_COMPACT_WINDOW=272000 with gpt-5.5[1m] so Claude Code does not compact too early, while still compacting before the real upstream limit.

If you'd rather disable auto-compact completely, set DISABLE_AUTO_COMPACT=1 in your env or ~/.claude/settings.json. Manual /compact still works, but you risk hitting real upstream limits before Claude Code can compact for you.

Toggling between proxy and direct Anthropic

If you still have an Anthropic subscription you want to fall back to, you can put a small wrapper in front of claude that only injects the proxy env vars when a flag file exists, plus a toggle script to flip the flag. Leave ~/.claude/settings.json free of proxy env vars so direct-to-Anthropic remains the default.

~/.local/bin/claude (ahead of the real claude on PATH):

#!/bin/bash
# Wrapper that optionally routes to claude-code-proxy.
# Active when ~/.claude/claude-code-proxy-enabled exists.

if [ -f "$HOME/.claude/claude-code-proxy-enabled" ]; then
    export ANTHROPIC_BASE_URL="http://localhost:18765"
    export ANTHROPIC_AUTH_TOKEN="unused"
    export ANTHROPIC_MODEL="gpt-5.5[1m]"
    export ANTHROPIC_SMALL_FAST_MODEL="gpt-5.4-mini[1m]"
    export CLAUDE_CODE_AUTO_COMPACT_WINDOW="272000"
    export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"
    export CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK="1"
fi

exec "$HOME/.local/bin/claude" "$@"

Adjust the exec path if the real claude binary lives elsewhere on your system (e.g. $(bun pm bin -g)/claude, $HOME/.claude/local/claude).

claude-proxy-toggle (anywhere on your PATH):

#!/bin/bash
# Toggle claude-code-proxy routing for the claude wrapper.
set -euo pipefail

flag="$HOME/.claude/claude-code-proxy-enabled"

if [ -f "$flag" ]; then
    rm "$flag"
    echo "proxy: off"
else
    mkdir -p "$(dirname "$flag")"
    touch "$flag"
    echo "proxy: on"
fi

Run claude-proxy-toggle to flip between routing through the proxy (Codex / Kimi) and talking to Anthropic directly. New or continued claude sessions pick up the change immediately; existing sessions keep whatever they started with.

Providers

Codex (ChatGPT)

Upstream: https://chatgpt.com/backend-api/codex/responses (Responses API).

Set ANTHROPIC_MODEL to a model your ChatGPT subscription is allowed to use. Append -fast to a Codex model name to request Codex fast mode for that request without restarting the proxy. For example, gpt-5.5-fast is sent upstream as model gpt-5.5 with service_tier: "priority". An explicit codex.serviceTier / CCP_CODEX_SERVICE_TIER override still takes precedence.

Reasoning effort: Claude Code's output_config.effort value (the one you see in the UI as ◐ medium · /effort) is forwarded as Codex reasoning.effort (low / medium / high / xhigh). Claude Code's max value is sent upstream as xhigh. An explicit codex.effort / CCP_CODEX_EFFORT override still takes precedence and can also force none.

Confirmed working on Plus:

  • gpt-5.4
  • gpt-5.3-codex

Also verified:

  • gpt-5.2
  • gpt-5.4-mini

If the resolved model isn't supported by your account, upstream returns a 400 like "The 'gpt-4.1' model is not supported when using Codex with a ChatGPT account.". The proxy surfaces that verbatim.

Auth:

Command What it does
codex auth login Browser OAuth (PKCE) via auth.openai.com
codex auth device Device-code OAuth for headless machines
codex auth status Show account ID + token expiry
codex auth logout Delete stored credentials

Kimi (Kimi Code)

Upstream: https://api.kimi.com/coding/v1/chat/completions (OpenAI-style chat-completions).

Only one wire model is exposed: kimi-for-coding (its display name in kimi-cli is Kimi-k2.6, 256k context, supports reasoning + image input + video input). kimi-k2.6 and k2.6 are accepted as aliases for the same wire id.

Reasoning effort: Claude Code's output_config.effort value (the one you see in the UI as ◐ medium · /effort) is forwarded as Kimi's reasoning_effort (low / medium / high). Thinking blocks from the upstream model are forwarded to Claude Code and rendered as thinking content. If Claude Code disables thinking, the proxy drops both reasoning_effort and the thinking: {type: "enabled"} flag before forwarding.

Auth:

Command What it does
kimi auth login Device-code OAuth via auth.kimi.com
kimi auth status Show user ID + token expiry
kimi auth logout Delete stored credentials

How it works

sequenceDiagram
    autonumber
    participant CC as Claude Code
    participant P as claude-code-proxy
    participant AUTH as OAuth host<br/>(auth.openai.com or<br/>auth.kimi.com)
    participant U as Upstream API<br/>(chatgpt.com/codex or<br/>api.kimi.com)

    Note over P,AUTH: One-time: PKCE / device OAuth<br/>tokens cached locally for reuse

    CC->>P: POST /v1/messages (Anthropic shape, stream: true)

    alt access token expiring
        P->>AUTH: POST /oauth/token (refresh_token)
        AUTH-->>P: new access (+ rotated refresh)
    end

    P->>P: translate request<br/>• strip Anthropic-only fields<br/>• system blocks → instructions / system message<br/>• tool_use / tool_result ↔ provider-specific shapes<br/>• prompt_cache_key = session id
    P->>U: POST upstream<br/>Bearer + provider-specific headers
    U-->>P: provider SSE<br/>(Codex: output_item.*, output_text.delta, …)<br/>(Kimi: chat.completion.chunk, reasoning_content, …)
    P->>P: reducer: typed events<br/>(thinking / text / tool start/delta/stop, finish)
    P-->>CC: Anthropic SSE<br/>(message_start, content_block_*, message_delta, message_stop)
Loading

Commands

Command Description
serve Start the proxy on PORT
codex auth login / device / status / logout Codex OAuth management
kimi auth login / status / logout Kimi OAuth management

serve

Starts the HTTP proxy and blocks. Binds to 127.0.0.1 only. Logs to the platform state directory (rotated at 20 MiB). Set CCP_LOG_STDERR=1 to mirror log lines to stderr while running.

claude-code-proxy serve
PORT=11435 claude-code-proxy serve
CCP_LOG_STDERR=1 claude-code-proxy serve

Prints the supported model → provider mapping on startup. One serve process dispatches to any provider based on the model field in each request. Requests whose model isn't registered with any provider are rejected with HTTP 400 listing the supported ids.


Codex auth commands

codex auth login

Runs the PKCE browser flow against auth.openai.com using the Codex CLI's client ID. Prints a URL, opens a local callback listener on port 1455, waits for the browser to redirect back, and stores the resulting access / refresh tokens in Keychain on macOS or locally on other platforms. The process exits automatically once the tokens are saved.

claude-code-proxy codex auth login

Sign in with your ChatGPT Plus/Pro account, not an OpenAI API account. The token file includes the extracted chatgpt_account_id so the proxy can set the ChatGPT-Account-Id header on every upstream call.

codex auth device

Same OAuth flow, but for headless machines. Prints a short user code and a URL; you enter the code from any browser on any other device, and the CLI polls auth.openai.com until you authorize, then stores the token.

claude-code-proxy codex auth device

Useful over SSH, inside a container, or on any host that can't open a browser.

codex auth status

Shows whether credentials are stored, the account ID, and how long until the access token expires. Non-zero exit if no auth is present.

claude-code-proxy codex auth status

Example output:

Account: 79342a5e-57b7-44ea-bfdc-a83ba070dad6
Expires: 2026-04-28T16:46:04.827Z (in 863946s)
Storage: macOS Keychain

The proxy refreshes the access token 5 minutes before expiry with a single-flight guard, so concurrent requests never trigger stampedes of refresh calls.

codex auth logout

Removes stored auth credentials. On macOS this deletes the Keychain entry. No server call is needed; the refresh token just becomes dead.

claude-code-proxy codex auth logout

Run codex auth login again to re-authenticate.


Kimi auth commands

kimi auth login

Runs a device-code OAuth flow (RFC 8628) against auth.kimi.com using the kimi-cli client ID. Prints a verification URL and a short user code; open the URL in any browser, confirm the code, and the CLI polls until the tokens are issued. Tokens are stored in Keychain on macOS or a mode-0600 file elsewhere.

claude-code-proxy kimi auth login

Sign in with your kimi.com account. The access token has a ~15 minute lifetime; the proxy refreshes it 5 minutes before expiry with a single-flight guard and persists the rotated refresh token.

A persistent device ID is generated on first login next to the Kimi auth file and reused forever — it's bound into the issued JWT, so rotating it would invalidate your token.

kimi auth status

claude-code-proxy kimi auth status

Shows the user ID extracted from the token, expiry time, scope, and storage backend. Non-zero exit if no auth is present.

kimi auth logout

claude-code-proxy kimi auth logout

Removes stored auth credentials (Keychain entry on macOS, file elsewhere). Run kimi auth login again to re-authenticate.


Endpoints

The proxy speaks enough of the Anthropic API for Claude Code:

  • POST /v1/messages: the main turn endpoint (streaming and non-streaming)
  • POST /v1/messages?beta=true: same (Claude Code always sends ?beta=true)
  • POST /v1/messages/count_tokens: local token count via gpt-tokenizer (o200k_base); used by Claude Code's compaction logic
  • GET /healthz: liveness check

Configuration

Settings can come from either environment variables or a config.json file. Precedence per setting: env var > config file > built-in default. The config file is optional — env-var-only setups continue to work unchanged.

The file lives at ~/.config/claude-code-proxy/config.json on macOS (deliberately not ~/Library), at %APPDATA%\claude-code-proxy\config.json on Windows, and at ${XDG_CONFIG_HOME:-$HOME/.config}/claude-code-proxy/config.json on Linux.

{
  "port": 18765,
  "aliasProvider": "codex",
  "codex": {
    "originator": "claude-code-proxy",
    "userAgent": "claude-code-proxy/dev",
    "model": "gpt-5.4",
    "effort": "medium",
    "serviceTier": "fast",
    "baseUrl": "https://chatgpt.com/backend-api/codex/responses",
    "transport": "websocket",
    "previousResponseId": false
  },
  "kimi": {
    "userAgent": "KimiCLI/1.37.0",
    "oauthHost": "https://auth.kimi.com",
    "baseUrl": "https://api.kimi.com/coding/v1"
  },
  "log": {
    "stderr": false,
    "verbose": false
  }
}
Variable Config key Default Purpose
PORT port 18765 Proxy listen port
XDG_STATE_HOME ~/.local/state Linux/macOS base dir for proxy.log
CCP_LOG_STDERR log.stderr unset Also mirror log lines to stderr
CCP_LOG_VERBOSE log.verbose unset Log full request/response bodies + every SSE event
CCP_TRAFFIC_LOG unset Write per-request traffic captures under traffic/ for session debugging
CCP_ALIAS_PROVIDER aliasProvider codex Route Anthropic-style aliases (haiku, sonnet, opus, claude-*) through codex or kimi
CCP_KIMI_OAUTH_HOST kimi.oauthHost https://auth.kimi.com Override Kimi's OAuth host (debugging only)
CCP_KIMI_BASE_URL kimi.baseUrl https://api.kimi.com/coding/v1 Override Kimi's API base URL
CCP_CODEX_MODEL codex.model unset Force all Codex requests to this model (gpt-5.2, gpt-5.3-codex, gpt-5.3-codex-spark, gpt-5.4, gpt-5.4-mini, gpt-5.5)
CCP_CODEX_EFFORT codex.effort unset Force all Codex requests to this reasoning effort (none, low, medium, high, xhigh)
CCP_CODEX_SERVICE_TIER codex.serviceTier unset Force all Codex requests to this service tier (fast/priority, flex; fast is sent upstream as priority)
CCP_CODEX_BASE_URL codex.baseUrl https://chatgpt.com/backend-api/codex/responses Override the Codex Responses endpoint
CCP_CODEX_TRANSPORT codex.transport websocket Codex transport: websocket, http, or auto
CCP_CODEX_PREVIOUS_RESPONSE_ID codex.previousResponseId false Enable WebSocket continuation with previous_response_id when the request is append-only
CCP_CODEX_ORIGINATOR codex.originator claude-code-proxy Override the originator header sent to Codex
CCP_CODEX_USER_AGENT codex.userAgent claude-code-proxy/<version> Override the User-Agent header sent to Codex
CCP_KIMI_USER_AGENT kimi.userAgent KimiCLI/1.37.0 Override the User-Agent header sent to Kimi
CCP_ORIGINATOR claude-code-proxy Fallback for CCP_CODEX_ORIGINATOR
CCP_USER_AGENT unset Fallback for CCP_CODEX_USER_AGENT and CCP_KIMI_USER_AGENT

A malformed config.json is reported on stderr and ignored; defaults are used in its place. Invalid types for individual keys are warned and skipped without affecting other keys.

Codex uses the WebSocket Responses transport by default. Set CCP_CODEX_TRANSPORT=http to use the older HTTP SSE transport for debugging or compatibility, or CCP_CODEX_TRANSPORT=auto to try WebSocket with HTTP fallback only when setup fails before a request is sent upstream. CCP_CODEX_PREVIOUS_RESPONSE_ID=1 enables opt-in WebSocket continuation for append-only turns. Continuation keeps in-memory state keyed by Claude Code session id, reuses a session WebSocket while it remains open, and sends previous_response_id only when the translated request shape is unchanged and the new input strictly extends the previous transcript. On mismatch, missing state, missing upstream response, closed connections, or setup failure, the proxy clears unsafe continuation state and sends the full request instead. Continuation reduces repeated request upload size, but it does not increase the upstream model context window. Multi-process or load-balanced deployments need sticky sessions or shared state before enabling continuation.

Files

  • proxy.log — JSON-lines log, rotated at 20 MiB. It lives at $XDG_STATE_HOME/claude-code-proxy/proxy.log on macOS/Linux and at %LOCALAPPDATA%\claude-code-proxy\proxy.log on Windows (falling back to %USERPROFILE%\AppData\Local). Secrets (authorization, access, refresh, id_token, ChatGPT-Account-Id, …) are redacted before write.
  • traffic/ — per-request captures written when CCP_TRAFFIC_LOG=1 is set. Captures live under the state directory, grouped by Claude Code session and request sequence. They include inbound Anthropic requests, translated upstream requests, upstream headers, upstream events, and downstream events. Stream events are written under each request's events/ directory with monotonic sequence numbers so sorted filenames preserve emission order. Token and account headers are redacted, but prompt and tool content are intentionally preserved for debugging.
  • config.json — optional configuration file (see table above). It lives at ~/.config/claude-code-proxy/config.json on macOS, ${XDG_CONFIG_HOME:-$HOME/.config}/claude-code-proxy/config.json on Linux, and %APPDATA%\claude-code-proxy\config.json on Windows.
  • Codex tokens — macOS uses Keychain under service claude-code-proxy.codex. Linux uses ${XDG_CONFIG_HOME:-$HOME/.config}/claude-code-proxy/codex/auth.json. Windows uses %APPDATA%\claude-code-proxy\codex\auth.json.
  • Kimi tokens — macOS uses Keychain under service claude-code-proxy.kimi. Linux uses ${XDG_CONFIG_HOME:-$HOME/.config}/claude-code-proxy/kimi/auth.json. Windows uses %APPDATA%\claude-code-proxy\kimi\auth.json.
  • Kimi device ID — persistent UUID bound into the Kimi JWT at login. Linux uses ${XDG_CONFIG_HOME:-$HOME/.config}/claude-code-proxy/kimi/device_id; Windows uses %APPDATA%\claude-code-proxy\kimi\device_id. Reused for the lifetime of the install.

Limitations

  • Terms of service: using the Codex or Kimi backends from a non-official client is a gray area. Use at your own risk.
  • Rate limits: shared across all clients of your upstream account. Codex's codex.rate_limits.limit_reached and Kimi's HTTP 429 are both surfaced as HTTP 429 with retry-after.
  • Codex — image inputs in tool results: Responses API function_call_output only takes a string, so image blocks nested inside tool_result are replaced with a [image omitted: <media_type>] placeholder. Top-level user-message images pass through.
  • Kimi — image inputs in tool results: pass through as image_url parts (Kimi accepts them in role:"tool" content).
  • Codex — reasoning blocks: not forwarded to Claude Code (dropped), even if the upstream model produced them.
  • Kimi — reasoning blocks: forwarded as Anthropic thinking content blocks and rendered by Claude Code. Disable by setting thinking: {"type":"disabled"} in your Anthropic request.
  • Session title generation: Claude Code's parallel title-gen request is forwarded upstream like any other structured-output request. This costs a handful of tokens per session rather than being stubbed.
  • Codex — output_config.format: translated to Responses API text.format (json_schema with strict: true); other Anthropic-specific output_config fields are dropped.

Development

bunx tsc --noEmit                          # typecheck
bun src/cli.ts serve                       # run locally (routes all providers)
tail -f ~/.local/state/claude-code-proxy/proxy.log | jq .

Install a compiled dev build globally: compile the current working tree to a binary and place it on your PATH without linking:

mkdir -p ~/.local/bin
bun build ./src/cli.ts --compile --outfile ~/.local/bin/claude-code-proxy

Related projects

  • claude-history: search Claude Code conversation history from the terminal
  • git-surgeon: non-interactive hunk-level git staging for AI agents
  • workmux: manage parallel AI coding tasks in separate git worktrees with tmux
  • consult-llm: Consult other AI models from your agent workflow