LLM-auth-proxy is a local OpenAI-compatible proxy that lets existing tools and projects keep using standard OpenAI-style endpoints while authenticating upstream with either Codex OAuth or a normal API key.
Supported auth modes:
codex-oauthapi-key
Some projects only support an OpenAI-style base_url plus API key. This proxy lets those projects talk to a local service while the service decides how to authenticate upstream.
GET /healthGET /v1/modelsPOST /v1/responsesPOST /v1/chat/completions- Codex OAuth auth-file loading and refresh
- API-key backend support
- Loopback bind by default
The local proxy currently supports:
GET /healthhealth summary for configured backendsGET /v1/modelslightweight model list for OpenAI-compatible clients that probe available modelsPOST /v1/responsesprimary local Responses API surfacePOST /v1/chat/completionscompatibility route for projects that still send chat-completions style bodies
Compatibility behavior:
- extra unsupported fields are ignored when possible
temperatureis dropped forgpt-5*requestsmessages,input, andpromptare normalized into a Codex-compatible request body
Not supported in v1:
- streaming responses
- embeddings
- images
- audio
- realtime APIs
For a Codex OAuth-specific machine setup guide, read:
./SETUP-CODEX-OAUTH.md
- Copy the example config:
cp config/llm-auth-proxy.example.json config/llm-auth-proxy.json
- Start the server:
npm start
- Point a client at it:
export OPENAI_BASE_URL=http://127.0.0.1:4318/v1 export OPENAI_API_KEY=dummy
The server reads config from:
LLM_AUTH_PROXY_CONFIG- or
./config/llm-auth-proxy.json
Environment overrides:
LLM_AUTH_PROXY_HOSTLLM_AUTH_PROXY_PORTLLM_AUTH_PROXY_DEFAULT_BACKEND
- For
chat/completions, the proxy maps the request into a Responses-style payload and converts the response back into a chat-completions shape. - Codex OAuth requests are sent to the ChatGPT Codex backend path (
/backend-api/codex/responses) with the same Codex-specific headers OpenClaw uses.