Add self-serve billing: tiers, credits, BTCPay and Zaprite

This commit is contained in:
Keysat
2026-06-13 13:36:05 -05:00
parent 84d56c94c9
commit 0aa648706e
17 changed files with 3781 additions and 116 deletions
+11 -6
View File
@@ -11,15 +11,20 @@
// margin math — Google has been known to adjust prices ~quarterly.
export const GEMINI_PRICING = {
// Pro family — best for analysis.
"gemini-3.1-pro-preview": { input: 5.0, output: 25.0, thinking: 25.0 },
"gemini-3-pro-preview": { input: 5.0, output: 25.0, thinking: 25.0 },
// The five supported models, verified against Google's official
// docs (ai.google.dev/gemini-api/docs/models) on 2026-05-12.
// Retired model IDs (gemini-3-pro-preview shut down 2026-03-09,
// gemini-2.0-flash deprecated) intentionally omitted — they should
// never appear in cost calc here for current calls.
// Flash family — best speed/cost for transcription, common for
// analysis when sub-Pro quality is acceptable.
// Pro tier — best for analysis.
"gemini-3.1-pro-preview": { input: 5.0, output: 25.0, thinking: 25.0 },
"gemini-2.5-pro": { input: 1.25, output: 10.0, thinking: 10.0 },
// Flash tier — best speed/cost for transcription + cheap analysis.
"gemini-3-flash-preview": { input: 0.3, output: 2.5, thinking: 2.5 },
"gemini-2.5-flash": { input: 0.3, output: 2.5, thinking: 2.5 },
"gemini-2.0-flash": { input: 0.1, output: 0.4, thinking: 0.4 },
"gemini-3.1-flash-lite": { input: 0.1, output: 0.4, thinking: 0.4 },
// Fallback used when an unknown model id appears (e.g. operator
// typed a custom model name in setBackendRouting). Conservative —