diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fcb24b..f3ed964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to Overmind are recorded here, in the reader's order: Remove ## [Unreleased] +### Added + +- AI Gateway: a tab with requests and tokens by model, requests by provider and errors, once watched. It is free, so it adds no limits. + --- ## [0.2.2] - 2026-10-11 diff --git a/Modules/Analytics/Tests/ReadPlanTests.swift b/Modules/Analytics/Tests/ReadPlanTests.swift index d68267e..7ac88df 100644 --- a/Modules/Analytics/Tests/ReadPlanTests.swift +++ b/Modules/Analytics/Tests/ReadPlanTests.swift @@ -56,6 +56,13 @@ struct ReadPlanTests { #expect(query.contains(#"actionType_in: ["write"]"#)) } + @Test func `should rank AI Gateway's models by how many requests each had`() throws { + let query = plan.breakdowns(try ServiceCatalog.builtIn("ai-gateway"), focus: .everything, at: Fixture.now).query.text + + #expect(query.contains("b0: aiGatewayRequestsAdaptiveGroups(limit: 5")) + #expect(query.contains("orderBy: [count_DESC]) { dimensions { model } count }")) + } + @Test func `should chart only KV's reads on the reads chart`() throws { let query = plan.breakdowns(try ServiceCatalog.builtIn("kv"), focus: .everything, at: Fixture.now).query.text diff --git a/Modules/Monitor/Sources/Account.swift b/Modules/Monitor/Sources/Account.swift index 5e551b3..36652be 100644 --- a/Modules/Monitor/Sources/Account.swift +++ b/Modules/Monitor/Sources/Account.swift @@ -202,6 +202,12 @@ public final class Account { defer { isRefreshing = false } if let planReadAt, now.timeIntervalSince(planReadAt) >= Self.planEvery { await readPlan(summary, at: now) } let reads = limits.map { LimitRead($0.definition, period: plan.period(for: $0.id, at: now)) } + // Only charts are watched (AI Gateway): nothing to read, and an empty query is an error. + guard !reads.isEmpty else { + lastRead = now + lastProblem = nil + return + } let planned = ReadPlan(account: summary.id).limits(reads, at: now) let started = Date() do { @@ -262,7 +268,13 @@ public final class Account { } let reads = definitions.map { LimitRead($0, period: Self.isKept($0) ? nil : month) } let planned = ReadPlan(account: summary.id).limits(reads, at: now) - guard let usages = try? planned.usages(from: try await analytics.read(planned.query)) else { return } + let usages: [LimitID: Usage] + if reads.isEmpty { + usages = [:] // nothing priced is watched: the subscription alone + } else { + guard let read = try? planned.usages(from: try await analytics.read(planned.query)) else { return } + usages = read + } let monthToDate = usages.filter { !Self.isKept(usage: $0.value) }.mapValues(\.used) let kept = usages.filter { Self.isKept(usage: $0.value) }.mapValues(\.used) var invoices: [Invoice] = [] @@ -323,9 +335,11 @@ public final class Account { public func isWatching(_ serviceID: String) -> Bool { watching.contains { $0.id == serviceID } } /// Whether the account's plans count any of this service: R2 needs R2 on the account - /// (*not on this account's plans*). + /// (*not on this account's plans*). A service with no limits (AI Gateway) has nothing a plan + /// could miss. public func isCounted(_ serviceID: String) -> Bool { - services.first { $0.id == serviceID }?.limits.contains { plan.allowance(for: $0.id) != nil } ?? false + guard let service = services.first(where: { $0.id == serviceID }) else { return false } + return service.limits.isEmpty || service.limits.contains { plan.allowance(for: $0.id) != nil } } /// Whether *Watching* lets this switch go off: never the last one (law 21). diff --git a/Modules/Monitor/Tests/AccountTests.swift b/Modules/Monitor/Tests/AccountTests.swift index 4f08843..4a9e9f2 100644 --- a/Modules/Monitor/Tests/AccountTests.swift +++ b/Modules/Monitor/Tests/AccountTests.swift @@ -487,6 +487,38 @@ struct AddOnTests { #expect(account.isCounted("d1")) } + @Test func `should watch AI Gateway for its charts, without a card or a gap in the plans`() async throws { + let world = World() + let account = try world.account() + await account.connect(token: "tok", at: .utc("2026-10-09T14:20:00")) + let before = account.limits.count + + await account.watch("ai-gateway", at: .utc("2026-10-09T14:30:00")) + + #expect(account.isWatching("ai-gateway")) + #expect(account.limits.count == before) + #expect(account.isCounted("ai-gateway")) + } + + @Test func `should count a refresh as a good read, without asking Cloudflare, when only AI Gateway is watched`() async throws { + let world = World() + let account = try world.account() + await account.connect(token: "tok", at: .utc("2026-10-09T14:20:00")) + await account.watch("ai-gateway", at: .utc("2026-10-09T14:20:00")) + account.unwatch("workers") + account.unwatch("d1") + let before = world.cloudflare.queries.count + + await account.refresh(at: .utc("2026-10-09T14:40:00")) + await account.openBill(at: .utc("2026-10-09T14:40:00")) + + #expect(account.watching.map(\.id) == ["ai-gateway"]) + #expect(account.lastRead == .utc("2026-10-09T14:40:00")) + #expect(account.lastProblem == nil) + #expect(account.bill?.estimate == Money(0, "USD")) + #expect(world.cloudflare.queries.count == before) // an empty query is a GraphQL error + } + @Test func `should never offer R2 as a plan to switch to, and quote Workers Paid with R2 kept`() async throws { let world = World() world.cloudflare.ratePlans = ["r2_paid"] diff --git a/Modules/Services/Resources/Services/ai-gateway.json b/Modules/Services/Resources/Services/ai-gateway.json new file mode 100644 index 0000000..484acb9 --- /dev/null +++ b/Modules/Services/Resources/Services/ai-gateway.json @@ -0,0 +1,22 @@ +{ + "id": "ai-gateway", + "name": "AI Gateway", + "order": 9, + "watchedByDefault": false, + "look": { "glyph": "⇄", "color": "pink" }, + "limits": [], + "breakdowns": [ + { "title": "Requests by model · last 24 hours", + "top": { "dataset": "aiGatewayRequestsAdaptiveGroups", "dimension": "model", "measure": "count", + "count": 5, "time": "datetime", "focus": "gateway" } }, + { "title": "Tokens by model · last 24 hours", + "top": { "dataset": "aiGatewayRequestsAdaptiveGroups", "dimension": "model", "measure": "sum.totalTokens", + "count": 5, "time": "datetime", "focus": "gateway" } }, + { "title": "Requests by provider", + "split": { "dataset": "aiGatewayRequestsAdaptiveGroups", "dimension": "provider", "measure": "count", + "time": "datetime", "focus": "gateway" } }, + { "title": "Errors by model", + "top": { "dataset": "aiGatewayErrorsAdaptiveGroups", "dimension": "model", "measure": "count", + "count": 5, "time": "datetime", "focus": "gateway" } } + ] +} diff --git a/Modules/Services/Tests/BuiltInServicesTests.swift b/Modules/Services/Tests/BuiltInServicesTests.swift index 0ba3798..47250d3 100644 --- a/Modules/Services/Tests/BuiltInServicesTests.swift +++ b/Modules/Services/Tests/BuiltInServicesTests.swift @@ -5,13 +5,22 @@ import Measures /// The built-in service files, read through the real JSON. @Suite struct BuiltInServicesTests { - @Test func `should show Workers, then D1, KV, Queues, R2, Workers AI, Vectorize and Durable Objects`() throws { - #expect(try ServiceCatalog.builtIns().map(\.id) == ["workers", "d1", "kv", "queues", "r2", "ai", "vectorize", "durable-objects"]) + @Test func `should show Workers, then D1, KV, Queues, R2, Workers AI, Vectorize, Durable Objects and AI Gateway`() throws { + #expect(try ServiceCatalog.builtIns().map(\.id) == ["workers", "d1", "kv", "queues", "r2", "ai", "vectorize", "durable-objects", "ai-gateway"]) + } + + @Test func `should know AI Gateway is charts only, free on every plan, ranking models by requests`() throws { + let gateway = try ServiceCatalog.builtIn("ai-gateway") + + #expect(gateway.limits.isEmpty) + let source = BreakdownDefinition.Source(dataset: "aiGatewayRequestsAdaptiveGroups", measure: "count", time: .datetime, focus: "gateway") + #expect(gateway.breakdowns.first?.kind == .top(source, dimension: "model", count: 5)) + #expect(gateway.watchedByDefault == false) } @Test func `should leave every service but Workers and D1 off until the person watches it`() throws { #expect(try ServiceCatalog.builtIns().filter { !$0.watchedByDefault }.map(\.id) - == ["kv", "queues", "r2", "ai", "vectorize", "durable-objects"]) + == ["kv", "queues", "r2", "ai", "vectorize", "durable-objects", "ai-gateway"]) } @Test func `should know Workers AI counts neurons across every model`() throws { diff --git a/README.md b/README.md index 29e442a..849e0ba 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Try it without an account: `OVERMIND_DEMO=1 .build/dd/Build/Products/Debug/Overm | Workers AI (off until watched) | neurons against 10k a day; on Workers Paid each day's overage is priced | neurons per hour, top models | | Vectorize (off until watched) | queried and stored vector dimensions | queried dimensions per day, top indexes | | Durable Objects (off until watched) | requests, SQLite rows read and written, storage | requests per hour, requests by outcome | +| AI Gateway (off until watched) | none: it is free on every plan | requests and tokens by model, requests by provider, errors by model | Plans: Free and Workers Paid, with R2 as an add-on beside either; the Bill tab prices this month on both. Other Cloudflare products are one JSON file each → [ENGINE_DESIGN](docs/architecture/ENGINE_DESIGN.md). diff --git a/Sources/App/SettingsView.swift b/Sources/App/SettingsView.swift index b3b2aa7..260364d 100644 --- a/Sources/App/SettingsView.swift +++ b/Sources/App/SettingsView.swift @@ -62,6 +62,7 @@ struct SettingsView: View { SettingsRow(title: "\(service.look.glyph) \(service.name)", note: locked ? "Overmind watches at least one service" : account.summary != nil && !account.isCounted(service.id) ? "not on this account's plans" + : service.limits.isEmpty ? "free · charts only" : service.limits.map(\.name).joined(separator: " · ")) { PopSwitch(isOn: on) { if on { account.unwatch(service.id) } else { Task { await account.watch(service.id, at: Demo.now ?? .now) } } diff --git a/design-concept/overmind-pop.html b/design-concept/overmind-pop.html index 7aa15ad..68d6ed9 100644 --- a/design-concept/overmind-pop.html +++ b/design-concept/overmind-pop.html @@ -545,6 +545,7 @@

Watching

✦
Workers AInew · neurons
⋰
Vectorizenew · queried dimensions · stored dimensions
◈
Durable Objectsnew · requests · rows read · rows written · storage
+
⇄
AI Gatewaynew · free · charts only
A service you don't watch is never read: no tab, no card, no warning, no line in the Bill.
diff --git a/design-concept/screenshots/settings.png b/design-concept/screenshots/settings.png index 2129d59..54c0a5b 100644 Binary files a/design-concept/screenshots/settings.png and b/design-concept/screenshots/settings.png differ diff --git a/docs/architecture/CANONICAL_MODEL.md b/docs/architecture/CANONICAL_MODEL.md index af8b681..d2b6bd3 100644 --- a/docs/architecture/CANONICAL_MODEL.md +++ b/docs/architecture/CANONICAL_MODEL.md @@ -83,7 +83,8 @@ Account ◆ THE ROOT — one per app (v1) │ ├── watching: [ServiceDefinition] "Worker ☑ · D1 ☑ · KV ☐" — DERIVED from the person's choices and │ each file's watchedByDefault; never empty (law 21) -├── isCounted(service) DERIVED — false when no plan or add-on counts it: "not on this account's plans" +├── isCounted(service) DERIVED — false when no plan or add-on counts any of its limits: "not on this account's plans"; +│ true for a service with no limits (AI Gateway: "free · charts only") ├── canUnwatch(service) DERIVED — false for the last one watched: its switch is dimmed ├── estimateCovers: Coverage DERIVED — everything · only(["Worker"]): "est. · Worker only" ├── focus: Focus ◇ .worker(name) · .allWorkers — breakdowns only diff --git a/docs/architecture/ENGINE_DESIGN.md b/docs/architecture/ENGINE_DESIGN.md index b25b6c8..20691c1 100644 --- a/docs/architecture/ENGINE_DESIGN.md +++ b/docs/architecture/ENGINE_DESIGN.md @@ -104,6 +104,10 @@ by `date`, in one query; `Bill` counts the days whose use reached the allowance | `split(dataset, dimension, measure)` | a list per value | invocations by `status` | | `figures([Read])` | a row of numbers | CPU p50 · p99, errors | +A `top` or `split` measures a field (`sum.totalTokens`) or `count`, the number of requests in +each group. **A service may have no limits**: AI Gateway is free on every plan, so its file has +only charts. It adds a tab when watched, and no card, menu bar number, warning or Bill line. + ## 5 · The files ```jsonc @@ -165,6 +169,8 @@ by `date`, in one query; `Bill` counts the days whose use reached the allowance | Vectorize limits | Free: 30M queried dimensions a month, 5M stored; Paid: 50M queried a month then $0.01/M, 10M stored then $0.05 per 100M a month | verified on [Vectorize pricing](https://developers.cloudflare.com/vectorize/platform/pricing/), 2026-10-11 | | Durable Objects | GraphQL `durableObjectsInvocationsAdaptiveGroups` · `sum.requests`; `durableObjectsPeriodicGroups` · `sum.rowsRead` · `sum.rowsWritten` (also `sum.duration`, `sum.activeTime`); `durableObjectsSqlStorageGroups` · `max.storedBytes` per `namespaceId`; all by `datetime` | verified by introspection 2026-10-11; **the unit of `sum.duration` is not**, so GB-s duration waits for a live read on an account using Durable Objects | | Durable Objects limits | Free per day: 100k requests, SQLite 5M rows read, 100k written, 5 GB stored; Paid per month: 1M requests then $0.15/M, 25B rows read then $0.001/M, 50M written then $1.00/M, 5 GB then $0.20/GB-month | verified on [Durable Objects pricing](https://developers.cloudflare.com/durable-objects/platform/pricing/), 2026-10-11 | +| AI Gateway | GraphQL `aiGatewayRequestsAdaptiveGroups` · `count`, `sum.totalTokens`, `sum.cachedRequests`, `sum.erroredRequests`, by `gateway` · `model` · `provider` · `cached`, `datetime`; also `aiGatewayErrorsAdaptiveGroups`, `aiGatewayCacheAdaptiveGroups`, `aiGatewaySizeAdaptiveGroups` (`max.rows`, logs stored) | verified by introspection and a live read 2026-10-11 (`orderBy: [count_DESC]` accepted; `cached` is 0 or 1, so no chart labels by it) | +| AI Gateway pricing | core features free on every plan; Logpush on Paid 10M a month then $0.05/M; logs stored: legacy Free 100k across gateways, Paid 10M **per gateway**, gateways from 2026-09-24 on Workers Logs pricing. No limit ships: per gateway is no `Allowance` case, and the new pricing is unclear | [AI Gateway pricing](https://developers.cloudflare.com/ai-gateway/reference/pricing/), 2026-10-11 | | Rate Limiting bindings | none exists | out of scope ([journeys §5](USER_JOURNEYS.md#5--out-of-scope-for-now)) | | GraphQL budget | 300 queries / 5 min / user; 31 days retention on adaptive datasets | verified | | Plan | `GET /accounts/{id}/subscriptions`: one entry per rate plan (an account can have *R2 Paid* without *Workers Paid*) | verified | diff --git a/docs/architecture/TARGET_ARCHITECTURE.md b/docs/architecture/TARGET_ARCHITECTURE.md index 41db164..ed55a25 100644 --- a/docs/architecture/TARGET_ARCHITECTURE.md +++ b/docs/architecture/TARGET_ARCHITECTURE.md @@ -74,6 +74,7 @@ ConnectSheet ─ account.connect(token) ```text Refresher ─ account.refresh(at: now) limits of the watched services only law 21 + none (only AI Gateway watched) → a good read, no query: an empty query is a GraphQL error plan.period(for: each limit, at: now) law 5 ReadPlan(limits, periods) → one AnalyticsQuery one POST per refresh: the GraphQL API allows 300 per 5 min AnalyticsAPI.read(query) → answer diff --git a/docs/architecture/USER_JOURNEYS.md b/docs/architecture/USER_JOURNEYS.md index 8693ad5..d78c1b0 100644 --- a/docs/architecture/USER_JOURNEYS.md +++ b/docs/architecture/USER_JOURNEYS.md @@ -68,6 +68,7 @@ do, the command that lands on the domain, and the node that answers. | 21b | Kai tries to turn the last service off | the last switch is dimmed: *Overmind watches at least one service* | — | `account.unwatch(…)` says no | `Account` (law 21) | | 21d | Lee watches *R2* on an account with an R2 subscription | R2 cards (*Class A*, *Class B*, *R2 storage*) against R2's own free tier; the Bill adds R2's lines to the Workers plan's; the header still reads *FREE* or *WORKERS PAID* | — | `account.watch("r2")` | `Plan.addOns` (law 23) | | 21e | Lee watches *R2* without an R2 subscription | the *R2* row reads *not on this account's plans*; no R2 cards | — | — | `account.isCounted("r2")`: no allowance, so no limit (ENGINE §3) | +| 21f | Lee watches *AI Gateway* | its row reads *free · charts only*; an *AI Gateway* tab: requests by model, tokens by model, requests by provider, errors by model. No card, no menu bar number, no warning: Cloudflare charges nothing for it | reads | `account.watch("ai-gateway")` · `account.open("ai-gateway")` | `Breakdown` only (ENGINE §4) | | 21c | A new version ships KV | *KV* appears in *Watching*, off; Worker and D1 keep Kai's choices | turns it on if they use KV | `account.watch("kv")` | the service file's `watchedByDefault` | | 22 | A new version is out | Sparkle's *A new version of Overmind is available* · *Check now* in Settings | installs | — | `Updater` (App, Sparkle) | @@ -105,7 +106,7 @@ do, the command that lands on the domain, and the node that answers. - **Changing anything on Cloudflare.** The token is read-only, and no port has a write call. - **Several accounts at once.** One connected account; switching is *Connect again*. -- **Services other than Workers and D1, all at once.** They ship one at a time, each off until the person watches it (moment 21c): KV, then Queues and R2 (an add-on plan, law 23), then Workers AI (billed day by day, law 24), Vectorize and Durable Objects, each once its datasets were confirmed by introspection (ENGINE §6): a wrong dataset name would fail the whole refresh. Durable Objects' GB-s duration waits for a live read. Decided 2026-10-11. +- **Services other than Workers and D1, all at once.** They ship one at a time, each off until the person watches it (moment 21c): KV, then Queues and R2 (an add-on plan, law 23), then Workers AI (billed day by day, law 24), Vectorize and Durable Objects, each once its datasets were confirmed by introspection (ENGINE §6): a wrong dataset name would fail the whole refresh. Durable Objects' GB-s duration waits for a live read. AI Gateway is a tab only: it is free, so nothing counts against a plan; its provider spend (`cost`) is not Cloudflare's bill and stays out. Decided 2026-10-11. - **The `cf` CLI's login.** v1 connects with an API token. `Analytics` and `BillingAPI` are ports, so a `cf`-backed credential or adapter can come later without touching the domain. - **Changing the plan from Overmind.** Cloudflare's API can (`POST`/`PUT`/`DELETE /accounts/{id}/subscriptions`), but it needs *Billing: Edit*, which can cancel any subscription, and the payment belongs in Cloudflare's own flow. Decided 2026-10-09: a link to Cloudflare's plans page instead; revisit as an opt-in capability once a Paid account can verify it. - **Rate limits.** Cloudflare keeps no analytics for Rate Limiting bindings, and a request the Worker answers with 429 is a *success* to Workers analytics. Once a Worker writes an Analytics Engine data point per block, a *Blocked by rate limit* breakdown is one entry in `worker.json`. Decided 2026-10-09: not in v1. diff --git a/docs/features/service-tabs/README.md b/docs/features/service-tabs/README.md index 1395759..34ed414 100644 --- a/docs/features/service-tabs/README.md +++ b/docs/features/service-tabs/README.md @@ -1,5 +1,5 @@ --- -description: The Worker, D1, KV, Queues, R2, Workers AI, Vectorize and Durable Objects tabs — the charts and lists each shows, the Worker focus, and the deployment pins. Read when a chart looks empty or different from the dashboard. +description: The Worker, D1, KV, Queues, R2, Workers AI, Vectorize, Durable Objects and AI Gateway tabs — the charts and lists each shows, the Worker focus, and the deployment pins. Read when a chart looks empty or different from the dashboard. --- # Service tabs @@ -14,6 +14,7 @@ description: The Worker, D1, KV, Queues, R2, Workers AI, Vectorize and Durable O | **Workers AI** | neurons per hour today · top models by neurons · the neurons limit (10k a day on both plans) | | **Vectorize** | queried dimensions per day (7 days) · top indexes · queried and stored dimensions | | **Durable Objects** | requests per hour today · requests by outcome · requests, SQLite rows read and written, storage. The Worker focus narrows the request charts. GB-s duration isn't counted yet | +| **AI Gateway** | requests by model · tokens by model · requests by provider · errors by model, over the last 24 hours. Charts only: AI Gateway is free, so it has no limits, cards or warnings | - **The focus** (*leaderboard ▾ · All Workers*) narrows the charts to one Worker. The limits never change: Cloudflare counts them across the account. - **Pins** (*d605dc93*) mark when a version of the focused Worker went live. diff --git a/docs/features/settings/README.md b/docs/features/settings/README.md index 6fbc1ce..ed2e89d 100644 --- a/docs/features/settings/README.md +++ b/docs/features/settings/README.md @@ -9,7 +9,7 @@ Open it from the popover: **⚙ → Settings…**. Changes save at once. | Section | Holds | |---|---| | **Account** | the connected account and its plan · *Disconnect* · the Worker in focus | -| **Watching** | one switch per service: *Worker* · *D1* · *KV* · *Queues* · *R2* · *Workers AI* · *Vectorize* · *Durable Objects*. A service the account's plans don't count reads *not on this account's plans*. A service you don't watch is never read: no tab, no card, no menu bar number, no warning, no line in the Bill. The last one stays on. New services arrive off | +| **Watching** | one switch per service: *Worker* · *D1* · *KV* · *Queues* · *R2* · *Workers AI* · *Vectorize* · *Durable Objects* · *AI Gateway* (*free · charts only*). A service the account's plans don't count reads *not on this account's plans*. A service you don't watch is never read: no tab, no card, no menu bar number, no warning, no line in the Bill. The last one stays on. New services arrive off | | **Reading** | *Read every 5 · 10 · 15 · 30 minutes*. *STALE* shows after two missed reads | | **Warnings** | *Warn me at 50% 75% 90%* · *Warn on pace* · *Notifications* | | **General** | *Start at login* · *Check for updates automatically* · *Check now* | diff --git a/docs/status.md b/docs/status.md index 72a4302..227c4b3 100644 --- a/docs/status.md +++ b/docs/status.md @@ -4,7 +4,7 @@ description: Where Overmind stands — what is built per module with test counts # Status -> As of **2026-10-11** · **182 tests** (and 4 live checks), all passing. Every slice is built; the app +> As of **2026-10-11** · **186 tests** (and 4 live checks), all passing. Every slice is built; the app > runs on a real account and on demo data. This file is the one home for > "what's built and what's next". Update it when a slice lands. @@ -16,7 +16,7 @@ description: Where Overmind stands — what is built per module with test counts | `Overmind` app | the menu bar, Today, the Workers and D1 tabs, Bill, Connect, the Settings window, `LoginItem`, `Updater` (Sparkle), the icon; demo mode and screenshots | — | | Release | `tests.yml`, `release.yml` (sign, notarize, DMG, appcast), ClaudeBar's scripts; a universal Release archive built and Developer-ID-signed locally | — | | `Measures` | `Quantity` (reads *5M rows*, prints *3.75M*, *75.7k ms*), `Money` (Decimal), `Period` (UTC day, billing month), `Percent`, `LimitID`; units rows, requests, ms, bytes, count, operations, neurons, dimensions | 20 | -| `Services` | `ServiceDefinition` (`watchedByDefault`), `LimitDefinition`, `Read` (`where`), `BreakdownDefinition`, `ServiceCatalog`; `workers.json`, `d1.json`, `kv.json`, `queues.json`, `r2.json`, `ai.json`, `vectorize.json`, `durable-objects.json` | 20 | +| `Services` | `ServiceDefinition` (`watchedByDefault`), `LimitDefinition`, `Read` (`where`), `BreakdownDefinition`, `ServiceCatalog`; `workers.json`, `d1.json`, `kv.json`, `queues.json`, `r2.json`, `ai.json`, `vectorize.json`, `durable-objects.json`, `ai-gateway.json` | 21 | | `Plans` | `PlanDefinition` (upgrade link, `addOn`), `Plan` (`addOns`), `Allowance`, `Price`, `cost(of:)`, `lines(of:)`, `PlanCatalog`; `free.json`, `workers-paid.json` (every service but R2), `r2-paid.json`; law 24 (a priced daily allowance billed by the day) | 32 | | `Limits` | `Limit` (laws 2–8), `Usage`, `Level`, `Pace` | 16 | | `Analytics` | `ReadPlan` (one query; storage summed per database; per-day use; `where` filters), answers, breakdowns, `Focus`; `GraphQLAnalytics` | 18 + 2 live | @@ -45,6 +45,7 @@ description: Where Overmind stands — what is built per module with test counts | 13 ✅ | Workers AI | `Plans` (law 24: a priced daily allowance billed day by day), `Billing`, `ai.json`, both plan files, the `neurons` unit | neurons against 10k a day; on Paid the Bill charges each day's overage | | 14 ✅ | Vectorize | `vectorize.json`, both plan files, the `dimensions` unit | queried and stored vector dimensions against each plan, off until watched | | 15 ✅ | Durable Objects | `durable-objects.json`, both plan files | requests, SQLite rows read and written, and storage; GB-s duration after a live read | +| 16 ✅ | AI Gateway, a tab only | `ai-gateway.json` (no limits), App (Settings note) | requests, tokens and errors by model, requests by provider, on its tab, off until watched; no card, warning or Bill line | ## Decisions