You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/billing.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Cortex uses Stripe Hosted Checkout, signed webhooks, and the customer portal for
4
4
5
5
## Configuration
6
6
7
-
Required variables:
7
+
Required local-development variables:
8
8
9
9
-`STRIPE_SECRET_KEY`
10
10
-`STRIPE_WEBHOOK_SECRET`
@@ -13,6 +13,11 @@ Required variables:
13
13
-`STRIPE_CANCEL_URL`
14
14
-`STRIPE_PORTAL_RETURN_URL`
15
15
16
+
In production, Cloud Run uses one `BILLING_CONFIG_JSON` Secret Manager value containing
17
+
`stripe_secret_key`, `stripe_webhook_secret`, and `stripe_pro_price_id`; the three redirect
18
+
URLs remain ordinary environment variables. This keeps the Stripe credentials within one
19
+
active secret version.
20
+
16
21
Store production secret values in Google Secret Manager. See [Production configuration](env-vars-production.md).
17
22
18
23
## Webhook setup
@@ -46,4 +51,3 @@ flowchart LR
46
51
```
47
52
48
53
Webhook events are the authoritative source for subscription state. The backend verifies the Stripe signature before updating `user_subscriptions`; research and chat quota guards then read the synchronized subscription and usage state.
Copy file name to clipboardExpand all lines: docs/env-vars-production.md
+9-17Lines changed: 9 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,14 @@ All secrets should be stored in **Google Secret Manager** and referenced via `va
8
8
9
9
| Env Var | Secret Manager | Notes |
10
10
|---|---|---|
11
-
|`OPENAI_API_KEY`| yes | Required when `LLM_PROVIDER=openai`|
11
+
|`PROVIDER_CONFIG_JSON`| yes |Secret JSON with provider, Redis, Langfuse, and LangSmith settings: `openai_api_key`, `tavily_api_key`, `redis_url`, `langfuse_public_key`, `langfuse_secret_key`, `langfuse_base_url`, `langsmith_api_key`, `langsmith_project`, `langsmith_endpoint`, `langsmith_redaction_mode`, `langsmith_sampling_rate`, and `langsmith_tracing`. Required when `LLM_PROVIDER=openai`.|
12
12
|`OPENROUTER_API_KEY`| yes | Required when `LLM_PROVIDER=openrouter`|
13
13
|`LLM_PROVIDER`| no |`openai` or `openrouter`|
14
14
|`OPENAI_MODEL`| no | e.g. `gpt-4o-mini`|
15
15
|`ROUTER_TIMEOUT_SECONDS`| no | Maximum duration of each router LLM request; production uses `10.0`|
16
16
|`EMBEDDING_PROVIDER`| no |`openai`|
17
17
|`EMBEDDING_MODEL`| no |`text-embedding-3-small`|
18
18
|`EMBEDDING_DIMENSIONS`| no |`1536`|
19
-
|`TAVILY_API_KEY`| yes ||
20
19
|`ALPHA_VANTAGE_API_KEY`| yes | Required when `ASSET_PRICE_PROVIDER=alphavantage_mcp`|
21
20
|`ASSET_PRICE_PROVIDER`| no |`alphavantage_mcp`|
22
21
|`ALPHA_VANTAGE_MCP_URL`| no | Optional full remote MCP URL override |
@@ -32,12 +31,9 @@ All secrets should be stored in **Google Secret Manager** and referenced via `va
32
31
|`READINESS_REQUIRE_SUPABASE`| no | Set to `true` in production; `/ready` returns `503` if Supabase is missing or unavailable |
33
32
|`READINESS_REQUIRE_NEO4J`| no | Set to `true` in production; `/ready` returns `503` if Neo4j is missing or unavailable |
34
33
|`READINESS_TIMEOUT_SECONDS`| no | Per-dependency probe timeout; defaults to `2.0` seconds |
35
-
|`INNGEST_EVENT_KEY`| yes | From Inngest dashboard → Keys |
36
-
|`INNGEST_SIGNING_KEY`| yes | From Inngest dashboard → Keys. **Must not be empty in prod.**|
37
-
|`REDIS_URL`| yes | Upstash `rediss://` URL |
38
-
|`STRIPE_SECRET_KEY`| yes ||
39
-
|`STRIPE_WEBHOOK_SECRET`| yes | Update Stripe webhook URL to `https://<cloud-run-url>/api/billing/webhook` after first deploy |
40
-
|`STRIPE_PRO_PRICE_ID`| no ||
34
+
|`INNGEST_CONFIG_JSON`| yes | Secret JSON with `inngest_event_key` and `inngest_signing_key` from the Inngest dashboard. |
35
+
|`REDIS_CACHE_TTL_DB_LIST_SECONDS`| no | Cache TTL for DB-heavy list/read-all responses; production uses `30`. `REDIS_URL` is supplied through `PROVIDER_CONFIG_JSON`. |
36
+
|`BILLING_CONFIG_JSON`| yes | Secret JSON with `stripe_secret_key`, `stripe_webhook_secret`, and `stripe_pro_price_id`. This bundles Stripe credentials into one Secret Manager version. |
41
37
|`STRIPE_SUCCESS_URL`| no |`https://<frontend>/billing/success`|
42
38
|`STRIPE_CANCEL_URL`| no |`https://<frontend>/billing/cancel`|
43
39
|`STRIPE_PORTAL_RETURN_URL`| no |`https://<frontend>`|
@@ -49,9 +45,8 @@ All secrets should be stored in **Google Secret Manager** and referenced via `va
0 commit comments