A tiny OpenAI-compatible proxy with a live health page — one click to Render.
Zero dependencies (~1 file of vanilla Node), so you can read every line before
you ship it. Default upstream: https://daoxe.com/v1, but it works with any
OpenAI-compatible endpoint.
- Share access without sharing your key. In gateway mode, callers use a
PROXY_TOKENyou hand out; the proxy swaps it for the real upstream key, which never leaves the server. Rotate or revoke the token anytime. - Fix browser CORS. Point a browser app at
/v1and get permissive CORS headers, so BYO-key front-ends stop throwing CORS errors. - See that it's alive.
/renders a health dashboard;/healthzreturns JSON (mode, upstream reachability, config) for uptime monitors.
| Mode | Trigger | Who holds the key | Callers send |
|---|---|---|---|
| passthrough (default) | no DAOXE_API_KEY |
each caller (their own) | their own upstream key |
| gateway | DAOXE_API_KEY and PROXY_TOKEN |
the server | the PROXY_TOKEN |
Fail-closed safety: if DAOXE_API_KEY is set but PROXY_TOKEN is not, the
server stays in passthrough mode and refuses to inject the key — a misconfig
can't silently become an open wallet. To intentionally inject the key for
everyone (behind your own network controls), set ALLOW_OPEN_RELAY=true.
- Click Deploy to Render above. Render reads
render.yaml. - Render prompts for the
sync: falsevariables:- For a CORS relay only, leave
DAOXE_API_KEY/PROXY_TOKENblank. - For a gateway, set
DAOXE_API_KEY(your key) andPROXY_TOKEN(invent a strong random string).
- For a CORS relay only, leave
- Deploy. Open the service URL to see the health page.
Point any OpenAI SDK/client at https://<your-service>.onrender.com/v1:
# gateway mode: the "api key" you give clients is the PROXY_TOKEN
curl https://<your-service>.onrender.com/v1/chat/completions \
-H "Authorization: Bearer $PROXY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"hi"}]}'from openai import OpenAI
client = OpenAI(base_url="https://<your-service>.onrender.com/v1",
api_key="<PROXY_TOKEN or your own upstream key>")| Name | Required | Default | Notes |
|---|---|---|---|
DAOXE_BASE_URL |
— | https://daoxe.com/v1 |
Any OpenAI-compatible root. |
DAOXE_API_KEY |
for gateway | — | Real upstream key. Server-side only. |
PROXY_TOKEN |
for gateway | — | Token callers use in place of the key. |
DAOXE_ALLOWED_MODELS |
— | any | Comma-separated allow-list on /v1/chat/completions. |
CORS_ORIGIN |
— | * |
Lock to your domain in production. |
ALLOW_OPEN_RELAY |
— | false |
true = inject key without a token (dangerous). |
PORT |
— | provided by Render | — |
cp .env.example .env # fill values; never commit it
node --env-file=.env server.js # Node 20.6+
# or: DAOXE_API_KEY=... PROXY_TOKEN=... node server.jsVisit http://localhost:10000/ for the health page.
GET /— HTML health dashboard.GET /healthz— JSON status (mode, upstream reachability, config).ANY /v1/*— proxied to${DAOXE_BASE_URL}/*(e.g./v1/chat/completions,/v1/models), streaming passed through unchanged.
*CORS + gateway mode = a public relay for your credits. If you enable the gateway, treatPROXY_TOKENlike a password and set a realCORS_ORIGIN.- The proxy never logs or returns your key; upstream error bodies are trimmed.
- Render's free web service spins down when idle; the first request after a nap is slow. That's a plan trait, not a bug.
Sibling starters, same idea (provider-neutral, key via env, one click):
- daoxe-vercel-chat — streaming chat UI + Edge function (Vercel).
- daoxe-railway-discord-bot — Discord
/askbot (Railway).
This template is maintained by people who work on daoxe, an
OpenAI-compatible, multi-model LLM gateway (one key, many models). It is
not available in mainland China. The default DAOXE_BASE_URL and the health
page link point to daoxe, but both are one-line changes — the proxy is fully
provider-neutral.
daoxe.com
MIT — see LICENSE.