AGENT SKILL

codex-proxy

Run an OpenAI-compatible Chat Completions endpoint on localhost that spends the user's ChatGPT/Codex subscription instead of an API key — for apps that take a Base URL, API key and model id (dictation post-processing, editors, scripts). Install it as an always-on LaunchAgent, check its status, print the key, try a request, or debug a failing app.

适用职业开发工程师
使用场景后端与接口
License 许可
MIT
最近更新
2026-11-11
Stars
★ 0
Forks
0

01 前言 Front Matter

name
codex-proxy
description
Run an OpenAI-compatible Chat Completions endpoint on localhost that spends the user's ChatGPT/Codex subscription instead of an API key — for apps that take a Base URL, API key and model id (dictation post-processing, editors, scripts). Install it as an always-on LaunchAgent, check its status, print the key, try a request, or debug a failing app.
when_to_use
Trigger on: codex-proxy, "use my Codex subscription in <app>", "OpenAI-compatible endpoint without an API key", "the app wants an OpenAI key", Base URL 127.0.0.1:8723, the dictation app's post-processing provider fails, codex-proxy install / status / key / try / uninstall.
allowed-tools
Bash

02 资源文件 3

03 SKILL.md 正文

codex-proxy

codex-proxy (on PATH via this plugin's bin/) serves http://127.0.0.1:8723/v1:

Local Upstream
POST /v1/chat/completions POST chatgpt.com/backend-api/codex/responses (SSE)
GET /v1/models GET chatgpt.com/backend-api/codex/models (list)

It authenticates with the OAuth token Codex CLI keeps in ~/.codex/auth.json, so Codex must be logged in with ChatGPT (codex login status → "Logged in using ChatGPT"). An API-key login has no such token; then the app should just use the key directly.

Commands

codex-proxy install [--port 8723] [--model gpt-6-luna] [--effort low]  # LaunchAgent local.codex-proxy
codex-proxy status       # launchd loaded? port answering? hours left on the token
codex-proxy key          # the local API key to paste into the app
codex-proxy try "текст"  # one cleanup request through the running proxy, with timing
codex-proxy uninstall
codex-proxy serve ...    # foreground, for debugging

install points launchd at the script's real path — the checkout it was run from — and at /usr/bin/python3 (stdlib only). Re-run it after moving the checkout or changing flags. Log: ~/Library/Logs/codex-proxy.log, one line per request with model, effort and seconds.

What to give the app

  • Base URL http://127.0.0.1:8723/v1
  • API key: output of codex-proxy key (stored in ~/.config/codex-proxy/key)
  • Model: any slug from /v1/models. For short text cleanup gpt-6-luna at the default low effort answers in ~1.5–2 s; bigger models are slower, not better at this. The priority service tier was measured slower for such short requests and is not used.

Behaviour worth knowing

  • system/developer messages → instructions; user/assistant → input. A request with only a system message sends it as the input. Tools, images, temperature, max_tokens are dropped; reasoning_effort in the request overrides --effort.
  • stream: true gets Chat Completions chunks and [DONE]; otherwise one JSON completion.
  • auth.json is re-read per request. Within 5 minutes of expiry, or on an upstream 401, the proxy refreshes with the refresh token and writes the rotated tokens back atomically (mode 0600, other fields kept) under a lock — codex keeps working off the same file.
  • Requests need Authorization: Bearer <key> and a localhost Host, so a web page cannot drive it through the browser.

Debugging an app that fails

  1. codex-proxy status. Not listening → read the log; install again.
  2. codex-proxy try. Works here but not in the app → the app's Base URL (must end in /v1), key or model id; the log shows whether the request even arrived.
  3. Upstream 401 after a refresh → codex login again (the refresh token was revoked). Upstream 400 naming a model → the slug is not in /v1/models for this plan.

This uses the subscription outside the Codex client; OpenAI may change or close the backend at any time. Tests: python3 -m pytest plugins/bosp/skills/codex-proxy.

04 同仓库更多 Skills

isachivka
isachivka/beware-of-skills

yt-dub

Give a YouTube video Yandex's Russian voice-over (the Yandex Browser / voice-over-translation one) at any length — including past Yandex's 4-hour limit — and mux it into the best video YouTube serves, with the original sound kept as a second track; optionally drop the result into Plex on SugarDaddy. Also when only the translated audio is wanted.

图像与多媒体
★ 0
isachivka
isachivka/beware-of-skills

revdiff-ru

Review a diff in revdiff with everything except the code translated into Russian, line numbering preserved 1:1 so annotations map back to the real files. One command does the translation; then /revdiff:revdiff opens the result.

开发工程师
★ 0
isachivka
isachivka/beware-of-skills

peer-chat

A prompt starting with "Chat from Codex:" is a peer message: answer it only through peer-chat.py, never in your own output. Also use when the user says "chat with codex", "talk to codex", "work with codex", "do this with codex", "build this with codex", "discuss this with codex" (the agent in the other pane of this agterm split). Not for a one-shot task handed off, and not for a read-only second opinion.

Skill与智能体开发
★ 0
isachivka
isachivka/beware-of-skills

memory-review

Use when an agent memory directory has grown large enough that nobody remembers what is in it, when memories look stale or contradictory, when the same fact seems to live in both memory and a CLAUDE.md, or when the user asks to review, prune, audit or clean up their memories. Also use before retiring a project whose memories should move somewhere else.

开发工程师
★ 0
isachivka
isachivka/beware-of-skills

decomment

Strip the noise comments an AI agent left behind on a branch — the ones that restate the code line by line or narrate the change as a story ("was X, now Y", "added a guard here"). Git holds the history and the code holds the present; only genuinely non-obvious comments survive.

开发工程师Skill与智能体开发
★ 0
isachivka
isachivka/beware-of-skills

cleanup

Tidy up after yourself and close your own agterm session.

★ 0