Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ENABLE_DATA_RETENTION_CLEANUP=false
# 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
Expand Down Expand Up @@ -197,6 +198,14 @@ 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
Expand Down
9 changes: 9 additions & 0 deletions .env.unified.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ AUTH_SECRET=your-secret-key-here

UI_URL=http://localhost:3002
PLAYGROUND_URL=http://localhost:3003
CODE_URL=http://localhost:3004
DOCS_URL=http://localhost:3005
ADMIN_URL=http://localhost:3006
API_URL=http://localhost:4002
Expand Down Expand Up @@ -125,3 +126,11 @@ 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
259 changes: 258 additions & 1 deletion apps/admin/src/lib/api/v1.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2433,7 +2433,7 @@ export interface paths {
updatedAt: string;
organizationId: string;
/** @enum {string} */
type: "subscription_start" | "subscription_cancel" | "subscription_end" | "credit_topup" | "credit_refund";
type: "subscription_start" | "subscription_cancel" | "subscription_end" | "credit_topup" | "credit_refund" | "dev_plan_start" | "dev_plan_upgrade" | "dev_plan_downgrade" | "dev_plan_cancel" | "dev_plan_end" | "dev_plan_renewal";
amount: string | null;
creditAmount: string | null;
currency: string;
Expand Down Expand Up @@ -3531,6 +3531,263 @@ export interface paths {
patch?: never;
trace?: never;
};
"/dev-plans/personal-org": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Personal organization retrieved or created */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
id: string;
name: string;
isPersonal: boolean;
/** @enum {string} */
devPlan: "none" | "lite" | "pro" | "max";
devPlanCreditsUsed: string;
devPlanCreditsLimit: string;
devPlanBillingCycleStart: string | null;
devPlanCancelled: boolean;
devPlanExpiresAt: string | null;
credits: string;
};
};
};
};
};
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/dev-plans/subscribe": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: {
content: {
"application/json": {
/** @enum {string} */
tier: "lite" | "pro" | "max";
};
};
};
responses: {
/** @description Stripe Checkout session created successfully */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
checkoutUrl: string;
};
};
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/dev-plans/cancel": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Dev plan subscription cancelled successfully */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
success: boolean;
};
};
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/dev-plans/resume": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Dev plan subscription resumed successfully */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
success: boolean;
};
};
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/dev-plans/change-tier": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: {
content: {
"application/json": {
/** @enum {string} */
newTier: "lite" | "pro" | "max";
};
};
};
responses: {
/** @description Dev plan tier changed successfully */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
success: boolean;
};
};
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/dev-plans/status": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Dev plan status retrieved successfully */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
hasPersonalOrg: boolean;
/** @enum {string} */
devPlan: "none" | "lite" | "pro" | "max";
devPlanCreditsUsed: string;
devPlanCreditsLimit: string;
devPlanCreditsRemaining: string;
devPlanBillingCycleStart: string | null;
devPlanCancelled: boolean;
devPlanExpiresAt: string | null;
regularCredits: string;
organizationId: string | null;
apiKey: string | null;
};
};
};
};
};
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
}
export type webhooks = Record<string, never>;
export interface components {
Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ app.use(
origin: process.env.ORIGIN_URLS?.split(",") || [
"http://localhost:3002",
"http://localhost:3003",
"http://localhost:3004",
"http://localhost:3005",
"http://localhost:3006",
],
allowHeaders: ["Content-Type", "Authorization", "Cache-Control"],
Expand Down
Loading
Loading