-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathenv.example
More file actions
80 lines (71 loc) · 3.94 KB
/
Copy pathenv.example
File metadata and controls
80 lines (71 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Codex Assistant — environment variables
# Copy this file to user/.env and fill in your values.
# The user/ folder contains all privacy-related config and is in .gitignore.
#
# IMPORTANT: API keys for upstream providers (DeepSeek, MiMo, OpenAI, etc.)
# are now stored in user/provider-configs.json with AES-256-GCM encryption.
# The PROXY_AUTH_KEY below serves as the encryption master key.
# Configure providers via the Web UI at http://127.0.0.1:<UI_PORT>.
#
# !! WARNING: Do NOT commit your user/.env to version control !!
# !! WARNING: Do NOT share this file — it contains sensitive API keys !!
# === UI Server ===
# UI_PORT=8788 # Web management interface port (default: 8788)
# === Inbound auth ===
#
# Two modes, pick one or both (at least one recommended, otherwise the proxy is
# open to all processes on localhost):
#
# PROXY_AUTH_KEY — single key, no provider lock (simplest setup)
# ALSO serves as the master key for encrypting provider API keys.
# PROXY_KEYS — multi-key table, each key optionally locked to a provider
#
# Generate a key (48-char hex):
# openssl rand -hex 24
# node -e "console.log('sk-proxy-local-' + require('crypto').randomBytes(24).toString('hex'))"
#
# Single-key mode (simplest) — auto-generated on first UI access:
PROXY_AUTH_KEY=sk-proxy-local-replace-with-48-char-hex
#
# Multi-key mode (recommended for multi-profile setups):
# Each key followed by ":<provider>". Provider can be deepseek / mimo / openai /
# any dynamic provider name from provider-configs.json (e.g. "商汤") / * (any).
# PROXY_KEYS=sk-proxy-deepseek-aaa:deepseek,sk-proxy-mimo-bbb:mimo,sk-proxy-all-ccc:*
# === GitHub (optional) ===
# Optional: GitHub token for authenticated API calls (prevents 404 on private repos & rate limits).
# If unset, the proxy lazily runs `gh auth token` on first github.com fetch.
# GITHUB_TOKEN=your-github-token-here
# === Optional: Override defaults ===
# PROXY_PORT=4000
# DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
# MIMO_BASE_URL=https://token-plan-cn.xiaomimimo.com/v1
# OPENAI_BASE_URL=https://api.openai.com/v1
# DEFAULT_PROVIDER=deepseek # one of: deepseek, mimo, openai
# === Optional: Model lists (advertised via /v1/models) ===
# Prefer MODEL_CATALOG_PATH below — it overrides these three.
# DEEPSEEK_MODELS=deepseek-v4-pro,deepseek-v4-flash
# MIMO_MODELS=mimo-v2.5-pro # must be lowercase — MiMo model IDs are case-sensitive
# OPENAI_MODELS= # empty = OpenAI routing is opt-in only
# === Optional: Model catalog (single source of truth) ===
# Point to the same proxy-models.json that Codex reads via model_catalog_json.
# See proxy-models.example.json in this repo for a starter file you can copy.
# The proxy infers provider from slug prefix (deepseek-* / mimo-* / gpt-* etc.)
# and overrides *_MODELS above.
# MODEL_CATALOG_PATH=~/.codex/proxy-models.json
# === Optional: Heuristic prefix routing ===
# Model names starting with any of these prefixes route to OpenAI (even if not in OPENAI_MODELS).
# OPENAI_MODEL_PREFIXES=gpt-,o1,o3,o4,codex-,chatgpt-
# === Optional: Logging ===
# LOG_LEVEL=info # silent / error / warn / info (default) / debug
# ACCESS_LOG=0 # set to 0 to suppress per-request access logs
# === Optional: Timeouts / capacity (rarely need changing) ===
# UPSTREAM_TIMEOUT_MS=120000 # upstream chat/completions total timeout
# STORE_TTL_MS=3600000 # responseStore entry TTL
# STORE_MAX=500 # responseStore LRU capacity
# MAX_CONSECUTIVE_TOOL_CALLS=20 # circuit breaker for runaway tool-call loops
# FETCH_TIMEOUT_MS=15000 # web_fetch non-GET single request timeout
# FETCH_MAX_BODY=50000 # web_fetch non-GET response body limit
# MAX_FETCH_LOOPS=5 # web_fetch max nesting depth (prevents loops)
# JINA_BASE=https://r.jina.ai # Jina Reader base URL for GET fetches
# JINA_FETCH_TIMEOUT_MS=20000
# JINA_MAX_BODY=80000