A minimal, dependency-free Go reverse proxy that exposes the Helmcode API (OpenAI-compatible) under your own domain, hiding your real Helmcode API key behind a single key you control.
LiteLLM is a full-featured proxy with multi-user auth, a database, budgets, routing across many providers, etc. MiniLiteLLM is the opposite: one upstream (Helmcode), one inbound key, no database, no per-user management. If you just need to hide one API key behind one API key for your own apps, this is a much smaller thing to run and reason about.
Every request under /v1/* is forwarded as-is to HELMCODE_BASE_URL, with
the Authorization header rewritten from your PROXY_API_KEY to your real
HELMCODE_API_KEY. There is no per-endpoint logic beyond that, except:
- SSE streaming (
stream:true) is flushed chunk by chunk instead of buffered. /v2/rerankis accepted as an alias of/v1/rerank.
| Method | Path | Notes |
|---|---|---|
| GET | /v1/models |
List available models |
| POST | /v1/chat/completions |
Supports stream:true (SSE) |
| POST | /v1/completions |
Legacy completions, supports stream:true |
| POST | /v1/embeddings |
|
| POST | /v1/rerank (/v2/rerank) |
/v2/rerank is an alias |
| POST | /v1/audio/speech |
Binary audio response |
| POST | /v1/audio/transcriptions |
multipart/form-data |
| POST | /v1/responses |
No incremental streaming |
| POST | /v1/images/generations |
|
| POST | /v1/images/edits |
multipart/form-data |
| GET | /health |
Unauthenticated healthcheck |
| GET | /docs |
Swagger UI (unauthenticated) |
Full request/response shapes match Helmcode exactly — see
openapi.yaml, served interactively at /docs, and the
upstream source of truth: https://nan.builders/docs/api.
curl https://your-domain.example.com/v1/chat/completions \
-H "Authorization: Bearer $PROXY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model",
"messages": [{"role": "user", "content": "Hello!"}]
}'See .env.example:
| Variable | Required | Default |
|---|---|---|
PROXY_API_KEY |
yes | — |
HELMCODE_API_KEY |
yes | — |
HELMCODE_BASE_URL |
no | https://api.helmcode.com/v1 |
PORT |
no | 8080 |
LOG_COLOR |
no | auto (colour only on a terminal) |
LOG_HEALTH |
no | false (health probes not logged) |
See DEPLOY.md for a full walkthrough covering Portainer, Nginx Proxy Manager, the mandatory SSE buffering fix, and Cloudflare.
- Create a new Railway project from this GitHub repo (Railway detects the
Dockerfileand builds from it automatically). - In the project's Variables tab, set
PROXY_API_KEY,HELMCODE_API_KEY, and optionallyHELMCODE_BASE_URL. Do not setPORT— Railway injects it automatically and the app reads it. - Every push to
maintriggers a new deploy. - Under Settings → Networking, add a custom domain (e.g.
llm.yourdomain.com) and copy the CNAME target Railway gives you.
- In Cloudflare DNS, add a
CNAMErecord:llm→ the Railway target from above, with the proxy (orange cloud) enabled. - In SSL/TLS → Overview, set the encryption mode to Full (Railway terminates TLS with a valid certificate, so Full — or Full (strict) — works; avoid Flexible, which would leave the Cloudflare↔Railway hop unencrypted).
- Wait for DNS propagation, then verify:
curl https://llm.yourdomain.com/health.
cp .env.example .env
export $(grep -v '^#' .env | xargs)
go run .See CONTRIBUTING.md for the full contributor workflow, commit conventions, and pre-PR checklist.