Skip to content

vermarjun/xypro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xypro

Your ChatGPT Codex, speaking fluent OpenAI on localhost.

What it is

Xypro is a small local proxy. It lets any OpenAI-compatible app use your ChatGPT Codex subscription, with no API key bill.

You keep writing normal OpenAI code. Xypro does the translation behind the scenes.

How it works

  • Your app calls the usual OpenAI endpoint at http://localhost:1455/v1.
  • Xypro signs the request with your ChatGPT login and forwards it to the Codex backend.
  • The reply comes back in plain OpenAI shape, streaming or not.

That is the whole trick. Your app never knows Codex is involved.

Install

npm install -g xypro

Then connect once and start it:

xypro auth     # sign in with ChatGPT, one time
xypro serve    # start the proxy, opens the control panel

Prefer not to install globally? Use npx:

npx xypro auth
npx xypro serve

That is the whole setup. Your code keeps calling OpenAI, Xypro points it at Codex.

Commands

  • xypro serve starts the proxy and opens the control panel.
  • xypro auth connects your ChatGPT Codex account (one time).
  • xypro key [value] sets an API key your apps must send. No value means it generates one.
  • xypro key clear removes the key so the proxy is open again.
  • xypro help shows the help.

Use it from your app

Point any OpenAI client at the Xypro base URL. Nothing else changes.

from openai import OpenAI

client = OpenAI(base_url="http://localhost:1455/v1", api_key="xypro")
client.chat.completions.create(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "hello"}],
)
curl http://localhost:1455/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.5","messages":[{"role":"user","content":"hi"}],"stream":true}'

If you set a key with xypro key, send it as Authorization: Bearer <key>.

Models

These are the only models a ChatGPT account can use through Codex (checked against the live backend):

  • gpt-5.5
  • gpt-5.4
  • gpt-5.4-mini

Each one takes a reasoning_effort of none, low, medium, high, or xhigh. More effort means more thinking and more tokens. none is fastest, xhigh thinks the hardest.

A couple of things Xypro handles quietly so your app does not break:

  • It maps reasoning_effort: "minimal" (which Codex does not accept) to low.
  • It drops max_tokens instead of forwarding it, because the Codex backend rejects output caps.

The control panel

Open http://localhost:1455 after xypro serve.

  • Providers: connection status, connect or reconnect, refresh, and a quick model test.
  • Quick test: fire one request to confirm a model works.
  • Usage: live token consumption, totals, by model, and recent requests.
  • Settings: default reasoning effort, reasoning summary, and default model.

Configuration

Settings live in proxy/.env (optional, sensible defaults otherwise):

  • PORT is the port Xypro runs on. Default is 1455.
  • PROXY_API_KEY is the key your apps must send. Empty means open, which is fine locally.
  • CODEX_PROXY_DATA_DIR is where your token, usage, and settings are stored. Default is ~/.codex-proxy.

Your tokens never leave your machine.

Notes

  • Codex always thinks first, so non-streaming replies are assembled after the stream finishes.
  • Reasoning text is returned on a reasoning field next to the normal content.
  • This maps text chat. Tool calls and vision are not translated yet.

Develop

Two live-reloading servers, backend on 1455 and frontend on 5173:

npm run dev

The backend lives in proxy/ (Express) and the control panel in web/ (Vite and React).

License

MIT

About

Use Codex subscription as API. One command, no extra API bills. Access all models available in codex as clean OpenAI compatible API

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors