-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautumn.config.ts
More file actions
106 lines (96 loc) · 2.86 KB
/
Copy pathautumn.config.ts
File metadata and controls
106 lines (96 loc) · 2.86 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
import { feature, item, plan } from "atmn";
// Pre-existing features in the local "testa" sandbox org — kept here so
// `atmn push` doesn't delete them.
export const codeReview = feature({
id: "code-review",
name: "Code Reviews",
type: "metered",
consumable: true,
});
export const token = feature({
id: "token",
name: "token",
type: "metered",
consumable: true,
});
// Two AI credit systems (assistant tiers). Each prices token usage from
// models.dev plus its own markups — the premium tier marks everything up
// harder. Per-model overrides differ between tiers on purpose so tier
// switching is observable per model.
export const premiumAssistant = feature({
id: "premium_assistant",
name: "Premium Assistant",
type: "ai_credit_system",
defaultMarkup: 50,
providerMarkups: {
openrouter: { markup: 40 },
},
modelMarkups: {
"openrouter/openai/gpt-4o-mini": { markup: 30 },
"openrouter/anthropic/claude-sonnet-4.5": { markup: 60 },
"openrouter/google/gemini-2.5-flash": { markup: 0 },
"custom/gateway-echo": { markup: 0, inputCost: 5, outputCost: 15 },
},
});
export const standardAssistant = feature({
id: "standard_assistant",
name: "Standard Assistant",
type: "ai_credit_system",
defaultMarkup: 20,
providerMarkups: {
openrouter: { markup: 10 },
},
modelMarkups: {
"openrouter/openai/gpt-4o-mini": { markup: 5 },
"openrouter/anthropic/claude-sonnet-4.5": { markup: 15 },
// -100% markup → cost multiplier 0 → free for the customer
"openrouter/google/gemini-2.5-flash": { markup: -100 },
"custom/gateway-echo": { markup: 0, inputCost: 5, outputCost: 15 },
},
});
// The customer-facing wallet: one credit balance both assistant tiers draw
// from. 1 credit == $1 of AI usage, so balances read directly as dollars.
export const aiCredits = feature({
id: "ai_credits",
name: "AI Credits",
type: "credit_system",
creditSchema: [
{ meteredFeatureId: premiumAssistant.id, creditCost: 1 },
{ meteredFeatureId: standardAssistant.id, creditCost: 1 },
],
});
const creditAllowance = (included: number) =>
item({
featureId: aiCredits.id,
included,
reset: { interval: "month" },
});
const creditTopUp = (amount: number, billingUnits: number) =>
item({
featureId: aiCredits.id,
price: {
amount,
interval: "one_off",
billingUnits,
billingMethod: "prepaid",
},
});
// Allowances are in credits (1 credit = $1 of AI usage)
export const free = plan({
id: "free",
name: "Free",
autoEnable: true,
items: [creditAllowance(1)],
});
export const pro = plan({
id: "pro",
name: "Pro",
price: { amount: 20, interval: "month" },
items: [creditAllowance(10), creditTopUp(12, 10)],
});
export const scale = plan({
id: "scale",
name: "Scale",
price: { amount: 200, interval: "month" },
items: [creditAllowance(120), creditTopUp(10, 10)],
});