Files
llmapikey/.env.example
T
tiennm99 02fa52ccf9 feat: scaffold OpenRouter key giveaway site (gated, code-only)
- Next.js 15 App Router (JS+JSDoc): landing, auth-gated dashboard, docs
- GitHub OAuth via Supabase; identity anchored on numeric provider_id
- key provisioning: reserve-then-mint-persist-compensate, one key per account
- api_keys in unexposed llmapikey schema via direct Postgres; RLS deny-all
- live minting gated behind PROVISIONING_ENABLED; Vercel auto-deploy disabled
- unit tests (mask, request-body), RLS deny-all test, reconcile script
2026-06-13 14:18:52 +07:00

33 lines
1.5 KiB
Bash

# ---- Supabase (auth) ----
# Public: safe to expose to the browser. Used for GitHub OAuth sign-in only.
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
# ---- Postgres (direct, server-only) ----
# Supabase pooler connection string (Project Settings > Database > Connection
# string > "Transaction" pooler, port 6543). Reaches the unexposed `llmapikey`
# schema. NEVER expose to the client. The connecting role must own/bypass RLS on
# the llmapikey schema (project `postgres` user).
DATABASE_URL=postgresql://postgres.your-ref:password@aws-0-region.pooler.supabase.com:6543/postgres
# ---- OpenRouter (server-only secret) ----
# Master Provisioning key used to mint per-user keys. NEVER expose to the client.
OPENROUTER_PROVISIONING_KEY=sk-or-v1-provisioning-...
# ---- App config ----
# Public repo URL for the soft star nudge.
NEXT_PUBLIC_REPO_URL=https://github.com/your-org/llmapikey
# Model id shown in /docs and used as the documented target.
NEXT_PUBLIC_OPENROUTER_MODEL=minimax/minimax-m3
# ---- Provisioning controls (server-only) ----
# Feature flag: live key minting is OFF until OpenRouter ToS gate (Phase 1)
# clears. When "false", generateKey() refuses to mint and returns a gated error.
PROVISIONING_ENABLED=false
# Sybil/abuse kill-switch: stop minting once this many active keys exist.
MAX_TOTAL_KEYS=500
# Per-key daily spend cap (USD) sent to OpenRouter.
KEY_DAILY_LIMIT_USD=10
# Key lifetime in days (sets expires_at on mint).
KEY_EXPIRY_DAYS=90