-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy path.env.example
More file actions
255 lines (191 loc) · 8.65 KB
/
.env.example
File metadata and controls
255 lines (191 loc) · 8.65 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# LLMGateway Production Environment Configuration
# Copy this file to .env and update the values for your deployment
# =============================================================================
# DATABASE CONFIGURATION
# =============================================================================
# PostgreSQL settings
POSTGRES_USER=postgres
POSTGRES_PASSWORD=change_this_secure_password
POSTGRES_DB=llmgateway
POSTGRES_PORT=5432
# Database URL (automatically constructed from above values)
DATABASE_URL=postgres://postgres:change_this_secure_password@postgres:5432/llmgateway
# =============================================================================
# REDIS CONFIGURATION
# =============================================================================
# Redis settings
REDIS_PASSWORD=change_this_redis_password
REDIS_PORT=6379
# =============================================================================
# SERVICE PORTS
# =============================================================================
# Service port mappings (change if you have conflicts)
GATEWAY_PORT=4001
API_PORT=4002
UI_PORT=3002
PLAYGROUND_PORT=3003
DOCS_PORT=3005
ADMIN_PORT=3006
# Health check timeout in milliseconds (defaults to 5000ms)
TIMEOUT_MS=5000
# HTTP server keep-alive timeout in seconds. Should be higher than load balancer's
# keepalive timeout to prevent 502 errors. GCP LB uses 600s.
# Defaults: gateway=620s, api=60s
# KEEP_ALIVE_TIMEOUT_S=620
# Gateway request timeout in milliseconds - maximum time for end-to-end request
# Defaults to 300000ms (5 minutes)
# GATEWAY_TIMEOUT_MS=300000
# AI API request timeout in milliseconds for streaming requests
# Should be shorter than GATEWAY_TIMEOUT_MS to allow for error handling
# Defaults to 240000ms (4 minutes) or 80% of GATEWAY_TIMEOUT_MS, whichever is smaller
# AI_STREAMING_TIMEOUT_MS=240000
# AI API request timeout in milliseconds for plain (non-streaming) requests
# Non-streaming requests use a shorter timeout since they don't benefit from incremental responses
# Defaults to 180000ms (3 minutes)
# AI_TIMEOUT_MS=180000
# =============================================================================
# WORKER CONFIGURATION
# =============================================================================
# Backfill duration in seconds for stats calculator (defaults to 300 seconds = 5 minutes)
BACKFILL_DURATION_SECONDS=300
# Enable data retention cleanup (set to "true" to enable automatic deletion of verbose log data)
# When enabled, verbose fields are nullified after the retention period (30 days for all plans)
ENABLE_DATA_RETENTION_CLEANUP=false
# Enable follow-up lifecycle emails (default: false, just logs events)
EMAIL_FOLLOW_UPS=false
# =============================================================================
# AUTHENTICATION & SECURITY
# =============================================================================
# UI and API URLs (update these for your domain in production)
UI_URL=http://localhost:3002
PLAYGROUND_URL=http://localhost:3003
CODE_URL=http://localhost:3004
API_URL=http://localhost:4002
API_BACKEND_URL=http://localhost:4002
ORIGIN_URLS=http://localhost:3002
DOCS_URL=http://localhost:3005
# GitHub OAuth (optional - for "Sign in with GitHub")
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
# Google OAuth (optional - for "Sign in with Google")
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Passkey configuration (update for your domain)
PASSKEY_RP_ID=localhost
PASSKEY_RP_NAME=LLMGateway
# Secret used to HMAC-hash logged upstream provider API keys.
# Required in production. Generate with: openssl rand -base64 32
GATEWAY_API_KEY_HASH_SECRET=your-api-key-hash-secret-here
# =============================================================================
# FEATURE FLAGS
# =============================================================================
# Platform fee percentage for credit usage (default: 5%)
# This fee is applied when users pay with credits using our API keys
PLATFORM_FEE_PERCENTAGE=0.05
# Set to "true" to bill cancelled requests based on estimated token usage (default: true)
# When enabled, cancelled requests will be billed for prompt tokens and any partial
# completion tokens that were streamed before cancellation, plus request costs
BILL_CANCELLED_REQUESTS=true
# =============================================================================
# IMAGE UPLOAD LIMITS
# =============================================================================
# Maximum image size in MB for free plans (default: 50)
IMAGE_SIZE_LIMIT_FREE_MB=50
# Maximum image size in MB for pro plans (default: 100)
IMAGE_SIZE_LIMIT_PRO_MB=100
# =============================================================================
# LLM PROVIDER API KEYS
# =============================================================================
# Add API keys for the providers you want to use
# You don't need all of them - only add the ones you plan to use
# OpenAI
LLM_OPENAI_API_KEY=sk-your_openai_key_here
# Anthropic
LLM_ANTHROPIC_API_KEY=sk-ant-your_anthropic_key_here
# Google AI Studio
LLM_GOOGLE_AI_STUDIO_API_KEY=your_google_ai_studio_key_here
# Glacier
LLM_GLACIER_API_KEY=your_glacier_key_here
LLM_GLACIER_BASE_URL=https://your-glacier-base-url
# Google Vertex AI
LLM_GOOGLE_VERTEX_API_KEY=your_google_vertex_key_here
LLM_GOOGLE_CLOUD_PROJECT=your_google_cloud_project_id
LLM_GOOGLE_VERTEX_REGION=global
# Inference.net
LLM_INFERENCE_NET_API_KEY=your_inference_net_key_here
# Together.ai
LLM_TOGETHER_AI_API_KEY=your_together_ai_key_here
# Mistral
LLM_MISTRAL_API_KEY=your_mistral_key_here
# Moonshot
LLM_MOONSHOT_API_KEY=your_moonshot_key_here
# Novita AI
LLM_NOVITA_AI_API_KEY=your_novita_ai_key_here
# xAI
LLM_X_AI_API_KEY=your_xai_key_here
# Groq
LLM_GROQ_API_KEY=your_groq_key_here
# DeepSeek
LLM_DEEPSEEK_API_KEY=your_deepseek_key_here
# Perplexity
LLM_PERPLEXITY_API_KEY=your_perplexity_key_here
# Alibaba
LLM_ALIBABA_API_KEY=your_alibaba_key_here
# Nebius
LLM_NEBIUS_API_KEY=your_nebius_key_here
# NanoGPT
LLM_NANO_GPT_API_KEY=your_nanogpt_key_here
# Z.ai
LLM_Z_AI_API_KEY=your_zai_key_here
# AWS Bedrock
LLM_AWS_BEDROCK_API_KEY=your_aws_bedrock_key_here
# Azure
LLM_AZURE_API_KEY=your_azure_key_here
# CanopyWave
LLM_CANOPY_WAVE_API_KEY=your_canopywave_key_here
# =============================================================================
# ANALYTICS (OPTIONAL)
# =============================================================================
# PostHog analytics - remove if you don't want analytics
# frontend & api
POSTHOG_KEY=your_posthog_project_key
POSTHOG_HOST=https://app.posthog.com
# docs
POSTHOG_KEY=your_posthog_project_key
POSTHOG_HOST=https://app.posthog.com
# =============================================================================
# EMAIL (RESEND)
# =============================================================================
# Resend configuration - needed for transactional emails and contact management
RESEND_API_KEY=your_resend_api_key_here
RESEND_AUDIENCE_ID=your_resend_audience_id_here
# Newsletter topic ID for Resend topic-based subscriptions
RESEND_NEWSLETTER_TOPIC_ID=your_resend_newsletter_topic_id_here
# =============================================================================
# PAYMENT PROCESSING (OPTIONAL)
# =============================================================================
# Stripe configuration - only needed if you want to enable billing
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
STRIPE_PRO_MONTHLY_PRICE_ID=price_your_pro_plan_price_id
STRIPE_PRO_YEARLY_PRICE_ID=price_your_pro_plan_price_id
# Dev Plans Stripe Price IDs (for code.llmgateway.io)
STRIPE_DEV_PLAN_LITE_PRICE_ID=price_your_dev_plan_lite_price_id
STRIPE_DEV_PLAN_PRO_PRICE_ID=price_your_dev_plan_pro_price_id
STRIPE_DEV_PLAN_MAX_PRICE_ID=price_your_dev_plan_max_price_id
# Dev Plan Credits Multiplier (credits = price * multiplier, default: 3)
DEV_PLAN_CREDITS_MULTIPLIER=3
# First-time credit purchase bonus multiplier (e.g., 1.5 = 50% bonus)
# Set to 1.5 to enable 50% bonus on first credit purchase (max $50 bonus)
# Leave unset or set to empty to disable bonus
FIRST_TIME_CREDIT_BONUS_MULTIPLIER=
# Invoice from information (company name and address on invoices)
# Use \n for line breaks, e.g., "Company Name\nAddress Line 1\nCity, State ZIP"
INVOICE_FROM=Fake Company\nUnited States
# =============================================================================
# NOTIFICATIONS (OPTIONAL)
# =============================================================================
# Discord webhook for notifications (signups, credit purchases)
DISCORD_NOTIFICATION_URL=
LLM_OBSIDIAN_SORA_ASYNC_API_KEY=
LLM_OBSIDIAN_SORA_ASYNC_BASE_URL=