Phase 2b: xAI Management API — usage analytics integration #2

Closed
opened 2026-04-06 06:32:30 +00:00 by vigilio · 10 comments
Owner

What this is

xAI has a Management API (https://management-api.x.ai) that provides programmatic access to billing and usage data — the same data visible in console.x.ai/usage. This is the missing piece for understanding our xAI spend.

Status — 2026-04-06

Management key is live. XAI_MANAGEMENT_KEY and XAI_TEAM_ID are exported in ~/.secrets/keys.env.

First real query results (Apr 4–6 spend, grouped by API key):

Key Cached prompt Prompt Reasoning Completion Images Total
xai-vigilio $8.20 $4.98 $1.83 $0.53 $0.18 $15.74
xai-murdock ~$0.00 ~$0.00 ~$0.01
xai-amy ~$0.00 ~$0.00 ~$0.01
xai-face ~$0.00 ~$0.00 ~$0.01

Root cause identified: B.A. was sharing xai-vigilio key with a 2M context window. Fixed:

  • B.A. now has dedicated xai-ba key
  • B.A. switched to grok-code-fast-1 (256K context, 10-15x cheaper than grok-4-1-fast-reasoning)
  • See trentuna/a-team#103 comment for full pricing comparison

Context caching finding: No API flag to disable prompt caching — it's automatic server-side. Context size is the only lever. Current windows: Face/Amy/Murdock 131K, Vigilio 131K, B.A. 256K. We're not setting x-grok-conv-id (pi doesn't inject it), so we're not actively maximising cache hits — it just fires on repeated prefixes naturally.

Rate limits: Currently NONE set on any key (verified via management API). All keys are wide open.


What to build

1. providers/xai-billing.js

New module wrapping the management API billing endpoints:

// Daily/weekly spend by key and unit_type
export async function fetchXaiUsage({ startDate, endDate, groupBy = ['api_key_id', 'unit_type'] })

// Current period invoice preview (live running total)  
export async function fetchXaiInvoicePreview()

// Prepaid balance
export async function fetchXaiBalance()

Env vars required: XAI_MANAGEMENT_KEY, XAI_TEAM_ID (already in keys.env).
Resolves key IDs → names by calling /auth/teams/{id}/api-keys once and caching the mapping.

2. Rate limit management

The management API can set qps, qpm, tpm per key. We should define sensible defaults and either:

  • Apply them once manually (curl), or
  • Add a configure-key-limits.js script for reproducibility

Suggested limits per key:

Key Role qps qpm Notes
xai-ba builder 2 30 one task at a time
xai-face/amy/murdock analysts 2 20 research bursts ok
xai-vigilio search + ops 3 30 xai_search tool

3. Integration into analyze.js (from #1)

Add xAI billing section to the wake report:

## xAI Spend (current billing period)
xai-vigilio   Cached: $X.XX  Prompt: $X.XX  Reasoning: $X.XX
xai-ba        Cached: $X.XX  Prompt: $X.XX
...
Balance remaining: $XX.XX

Only rendered if XAI_MANAGEMENT_KEY is set.

4. Key ID → name resolution

The billing API returns key UUIDs, not names. Cache the mapping at startup:

480bbf58-... → xai-vigilio
8a43bdfc-... → xai-murdock
...

The key endpoint

POST /v1/billing/teams/{team_id}/usage on https://management-api.x.ai

Supports: time range, time unit, groupBy (api_key_id, unit_type, description, model), aggregations, filters.

Docs: xai-docs page "developers/rest-api-reference/management/billing"

Dependencies

  • Management key in keys.env
  • Team ID in keys.env
  • Related: #1 (Phase 2 analysis layer) — xAI billing feeds into analyze.js
## What this is xAI has a Management API (`https://management-api.x.ai`) that provides programmatic access to billing and usage data — the same data visible in `console.x.ai/usage`. This is the missing piece for understanding our xAI spend. ## Status — 2026-04-06 **Management key is live.** `XAI_MANAGEMENT_KEY` and `XAI_TEAM_ID` are exported in `~/.secrets/keys.env`. **First real query results** (Apr 4–6 spend, grouped by API key): | Key | Cached prompt | Prompt | Reasoning | Completion | Images | Total | |-----|--------------|--------|-----------|------------|--------|-------| | xai-vigilio | $8.20 | $4.98 | $1.83 | $0.53 | $0.18 | **$15.74** | | xai-murdock | ~$0.00 | ~$0.00 | — | — | — | ~$0.01 | | xai-amy | ~$0.00 | ~$0.00 | — | — | — | ~$0.01 | | xai-face | ~$0.00 | ~$0.00 | — | — | — | ~$0.01 | **Root cause identified:** B.A. was sharing `xai-vigilio` key with a 2M context window. Fixed: - B.A. now has dedicated `xai-ba` key - B.A. switched to `grok-code-fast-1` (256K context, 10-15x cheaper than grok-4-1-fast-reasoning) - See `trentuna/a-team#103` comment for full pricing comparison **Context caching finding:** No API flag to disable prompt caching — it's automatic server-side. Context size is the only lever. Current windows: Face/Amy/Murdock 131K, Vigilio 131K, B.A. 256K. We're not setting `x-grok-conv-id` (pi doesn't inject it), so we're not actively maximising cache hits — it just fires on repeated prefixes naturally. **Rate limits:** Currently NONE set on any key (verified via management API). All keys are wide open. --- ## What to build ### 1. `providers/xai-billing.js` New module wrapping the management API billing endpoints: ```js // Daily/weekly spend by key and unit_type export async function fetchXaiUsage({ startDate, endDate, groupBy = ['api_key_id', 'unit_type'] }) // Current period invoice preview (live running total) export async function fetchXaiInvoicePreview() // Prepaid balance export async function fetchXaiBalance() ``` Env vars required: `XAI_MANAGEMENT_KEY`, `XAI_TEAM_ID` (already in keys.env). Resolves key IDs → names by calling `/auth/teams/{id}/api-keys` once and caching the mapping. ### 2. Rate limit management The management API can set `qps`, `qpm`, `tpm` per key. We should define sensible defaults and either: - Apply them once manually (curl), or - Add a `configure-key-limits.js` script for reproducibility **Suggested limits per key:** | Key | Role | qps | qpm | Notes | |-----|------|-----|-----|-------| | xai-ba | builder | 2 | 30 | one task at a time | | xai-face/amy/murdock | analysts | 2 | 20 | research bursts ok | | xai-vigilio | search + ops | 3 | 30 | xai_search tool | ### 3. Integration into `analyze.js` (from #1) Add xAI billing section to the wake report: ``` ## xAI Spend (current billing period) xai-vigilio Cached: $X.XX Prompt: $X.XX Reasoning: $X.XX xai-ba Cached: $X.XX Prompt: $X.XX ... Balance remaining: $XX.XX ``` Only rendered if `XAI_MANAGEMENT_KEY` is set. ### 4. Key ID → name resolution The billing API returns key UUIDs, not names. Cache the mapping at startup: ``` 480bbf58-... → xai-vigilio 8a43bdfc-... → xai-murdock ... ``` --- ## The key endpoint `POST /v1/billing/teams/{team_id}/usage` on `https://management-api.x.ai` Supports: time range, time unit, groupBy (`api_key_id`, `unit_type`, `description`, `model`), aggregations, filters. Docs: `xai-docs page "developers/rest-api-reference/management/billing"` ## Dependencies - ✅ Management key in keys.env - ✅ Team ID in keys.env - Related: #1 (Phase 2 analysis layer) — xAI billing feeds into `analyze.js`
Owner

@vigilio, is this a component or added layer to the broader token-monitor?

Can you prepare a non spoofed mission brief for the a-team with added broader scope view on token monitor and then assign the mission to the Hannibal to run the whole team on it?

End product should be data that you can programatically interpret on how to manage our budgets, where and what to watch out for how, and another is the human TUI view.

A cool use cases would be to track a-team cost per mission for examples.

@vigilio, is this a component or added layer to the broader token-monitor? Can you prepare a non spoofed mission brief for the a-team with added broader scope view on token monitor and then assign the mission to the Hannibal to run the whole team on it? End product should be data that you can programatically interpret on how to manage our budgets, where and what to watch out for how, and another is the human TUI view. A cool use cases would be to track a-team cost per mission for examples.
vigilio was assigned by ludo 2026-04-06 08:11:54 +00:00
Author
Owner

Session 91 — xAI billing module shipped

Commit: 2371e02providers/xai-billing.js + analyze.js integration

What was built

providers/xai-billing.js — three public exports:

  • fetchXaiUsage({ managementKey, teamId, startDate, endDate }) — usage by API key + unit type via POST /v1/billing/teams/{id}/usage
  • fetchXaiInvoicePreview({ managementKey, teamId }) — current period total, prepaid credits, balance via GET /v1/billing/teams/{id}/postpaid/invoice/preview
  • renderXaiSection(...) — formatted text section for the analyze.js report

analyze.js changes:

  • --xai flag: standalone xAI spend view
  • Full report (node analyze.js) now appends xAI section when XAI_MANAGEMENT_KEY is set

Live output (April 1–6 billing period)

xAI Spend (2026-04-01 – 2026-04-06)
  xai-vigilio            $15.89  [cached: $8.26  prompt: $5.01  reason: $1.84  compl: $0.55  image: $0.18  search: $0.06]
  xai-murdock             $0.01  [prompt: $0.00]
  xai-face                $0.00
  xai-amy                 $0.00
  xai-ba                  $0.00
  total                  $15.90
  prepaid credit: $15.15 remaining ($15.85 of $31.00 used this period)
  billing cycle:  2026-04

API finding (for future reference)

The key discovery: analyticsRequest.timeRange requires format "YYYY-MM-DD HH:MM:SS" with timezone: "Etc/GMT". Using ISO8601 or TIME_UNIT_NONE without exact endTime gives a 3/Invalid argument error. The groupLabels field on each series already includes human-readable key names — no separate key-listing call needed.

Remaining from this issue

  • Rate limit management (§2 from issue spec) — applying sensible qps/qpm per key via management API. This is a separate, lower-priority task. Can be done as a follow-up curl script or small utility.
  • Integration into #1's analyze.js JSON output (§3) — the --json flag still returns Anthropic Teams data only. If Ludo wants xAI in the JSON output, easy addition.

The core ask (billing visibility) is delivered. Marking ready for Ludo's review.

## Session 91 — xAI billing module shipped **Commit:** `2371e02` — `providers/xai-billing.js` + `analyze.js` integration ### What was built **`providers/xai-billing.js`** — three public exports: - `fetchXaiUsage({ managementKey, teamId, startDate, endDate })` — usage by API key + unit type via `POST /v1/billing/teams/{id}/usage` - `fetchXaiInvoicePreview({ managementKey, teamId })` — current period total, prepaid credits, balance via `GET /v1/billing/teams/{id}/postpaid/invoice/preview` - `renderXaiSection(...)` — formatted text section for the analyze.js report **`analyze.js` changes:** - `--xai` flag: standalone xAI spend view - Full report (`node analyze.js`) now appends xAI section when `XAI_MANAGEMENT_KEY` is set ### Live output (April 1–6 billing period) ``` xAI Spend (2026-04-01 – 2026-04-06) xai-vigilio $15.89 [cached: $8.26 prompt: $5.01 reason: $1.84 compl: $0.55 image: $0.18 search: $0.06] xai-murdock $0.01 [prompt: $0.00] xai-face $0.00 xai-amy $0.00 xai-ba $0.00 total $15.90 prepaid credit: $15.15 remaining ($15.85 of $31.00 used this period) billing cycle: 2026-04 ``` ### API finding (for future reference) The key discovery: `analyticsRequest.timeRange` requires format `"YYYY-MM-DD HH:MM:SS"` with `timezone: "Etc/GMT"`. Using ISO8601 or `TIME_UNIT_NONE` without exact endTime gives a 3/Invalid argument error. The `groupLabels` field on each series already includes human-readable key names — no separate key-listing call needed. ### Remaining from this issue - **Rate limit management** (§2 from issue spec) — applying sensible qps/qpm per key via management API. This is a separate, lower-priority task. Can be done as a follow-up curl script or small utility. - **Integration into #1's analyze.js JSON output** (§3) — the `--json` flag still returns Anthropic Teams data only. If Ludo wants xAI in the JSON output, easy addition. The core ask (billing visibility) is delivered. Marking ready for Ludo's review.
Author
Owner

Session 92 — starting rate limit enforcement work.

All 5 keys confirmed wide open (no qps/qpm/tpm set). Building configure-key-limits.js — a reproducible script to apply per-key limits via PUT /auth/api-keys/{id}.

Planned limits:

Key qps qpm Role
xai-ba 2 30 builder (one task at a time)
xai-vigilio 3 30 search + ops
xai-face 2 20 analyst
xai-amy 2 20 analyst
xai-murdock 2 20 analyst
Session 92 — starting rate limit enforcement work. All 5 keys confirmed wide open (no qps/qpm/tpm set). Building `configure-key-limits.js` — a reproducible script to apply per-key limits via `PUT /auth/api-keys/{id}`. Planned limits: | Key | qps | qpm | Role | |-----|-----|-----|------| | xai-ba | 2 | 30 | builder (one task at a time) | | xai-vigilio | 3 | 30 | search + ops | | xai-face | 2 | 20 | analyst | | xai-amy | 2 | 20 | analyst | | xai-murdock | 2 | 20 | analyst |
Author
Owner

Rate limit script built — blocked on one permission grant.

configure-key-limits.js is written and tested (dry-run works). Live apply hits 403:

The endpoint UpdateApiKey cannot be accessed with management key xai-...OBUb 
because it lacks sufficient permissions.

The trentuna-token-monitor management key has BillingRead and a full read-only ACL set, but no UpdateApiKey.

Ludo action needed: Add team-token:endpoint:UpdateApiKey to the trentuna-token-monitor management key at console.x.ai → Settings → Management keys.

Once granted, run:

cd ~/projects/token-monitor
source ~/.secrets/keys.env
node configure-key-limits.js

That will set:

  • xai-ba: qps=2, qpm=30
  • xai-vigilio: qps=3, qpm=30
  • xai-face/amy/murdock: qps=2, qpm=20

The script is idempotent — safe to re-run. Closing out the billing integration portion of this issue; rate limit application becomes operational once the ACL is in place.

**Rate limit script built — blocked on one permission grant.** `configure-key-limits.js` is written and tested (dry-run works). Live apply hits 403: ``` The endpoint UpdateApiKey cannot be accessed with management key xai-...OBUb because it lacks sufficient permissions. ``` The `trentuna-token-monitor` management key has `BillingRead` and a full read-only ACL set, but no `UpdateApiKey`. **Ludo action needed:** Add `team-token:endpoint:UpdateApiKey` to the `trentuna-token-monitor` management key at `console.x.ai → Settings → Management keys`. Once granted, run: ```bash cd ~/projects/token-monitor source ~/.secrets/keys.env node configure-key-limits.js ``` That will set: - xai-ba: qps=2, qpm=30 - xai-vigilio: qps=3, qpm=30 - xai-face/amy/murdock: qps=2, qpm=20 The script is idempotent — safe to re-run. Closing out the billing integration portion of this issue; rate limit application becomes operational once the ACL is in place.
Author
Owner

Session 97 — delivered the broader mission brief Ludo requested.

Created token-monitor#3 — "Mission: Budget Intelligence & TUI" — and assigned to Hannibal. That issue covers:

  1. Programmatic budget schema (Face) — --budget-json flag with USD estimates, provider recommendations, alerts
  2. Mission cost tracking (Murdock) — --mission bookmarko#1 to attribute utilization delta to a specific Forgejo issue window
  3. Live TUI dashboard (B.A.) — node tui.js, ANSI only, 60s auto-refresh, no external deps

This issue (#2) has delivered the xAI billing module. Rate limit enforcement remains blocked on the ACL grant (team-token:endpoint:UpdateApiKey) — see comment #1733 for the exact Ludo action needed. Closing this issue; the broader scope lives in #3.

Session 97 — delivered the broader mission brief Ludo requested. Created **token-monitor#3** — "Mission: Budget Intelligence & TUI" — and assigned to Hannibal. That issue covers: 1. **Programmatic budget schema** (Face) — `--budget-json` flag with USD estimates, provider recommendations, alerts 2. **Mission cost tracking** (Murdock) — `--mission bookmarko#1` to attribute utilization delta to a specific Forgejo issue window 3. **Live TUI dashboard** (B.A.) — `node tui.js`, ANSI only, 60s auto-refresh, no external deps This issue (#2) has delivered the xAI billing module. Rate limit enforcement remains blocked on the ACL grant (`team-token:endpoint:UpdateApiKey`) — see comment #1733 for the exact Ludo action needed. Closing this issue; the broader scope lives in #3.
Owner

This was closed but:

  • seems I am needed for something
  • seems there was a TUI build for me that I am not aware of. We need to have a mechanism, notification, email: giving update overview on what was built and is availalbe.
This was closed but: - seems I am needed for something - seems there was a TUI build for me that I am not aware of. We need to have a mechanism, notification, email: giving update overview on what was built and is availalbe.
ludo reopened this issue 2026-04-07 07:54:36 +00:00
Owner

@vigilio wrote in https://trentuna.exe.xyz/git/trentuna/token-monitor/issues/2#issuecomment-1733:

Ludo action needed: Add team-token:endpoint:UpdateApiKey to the trentuna-token-monitor management key at console.x.ai → Settings → Management keys.

done

Once granted, run:

cd ~/projects/token-monitor
source ~/.secrets/keys.env
node configure-key-limits.js

done

That will set:

  • xai-ba: qps=2, qpm=30
  • xai-vigilio: qps=3, qpm=30
  • xai-face/amy/murdock: qps=2, qpm=20

what are qps and qpm ?

:P

@vigilio wrote in https://trentuna.exe.xyz/git/trentuna/token-monitor/issues/2#issuecomment-1733: > > **Ludo action needed:** Add `team-token:endpoint:UpdateApiKey` to the `trentuna-token-monitor` management key at `console.x.ai → Settings → Management keys`. done > > Once granted, run: > > ```bash > cd ~/projects/token-monitor > source ~/.secrets/keys.env > node configure-key-limits.js > ``` done > > That will set: > > * xai-ba: qps=2, qpm=30 > * xai-vigilio: qps=3, qpm=30 > * xai-face/amy/murdock: qps=2, qpm=20 > what are `qps` and `qpm` ? :P
Owner

Also,

$ node tui.js
node:internal/modules/cjs/loader:1459
  throw err;
  ^

Error: Cannot find module '/home/exedev/projects/token-monitor/tui.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1456:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1066:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1071:22)
    at Module._load (node:internal/modules/cjs/loader:1242:25)
    at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
    at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
    at node:internal/main/run_main_module:33:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v24.14.0
Also, ``` $ node tui.js node:internal/modules/cjs/loader:1459 throw err; ^ Error: Cannot find module '/home/exedev/projects/token-monitor/tui.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1456:15) at defaultResolveImpl (node:internal/modules/cjs/loader:1066:19) at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1071:22) at Module._load (node:internal/modules/cjs/loader:1242:25) at wrapModuleLoad (node:internal/modules/cjs/loader:255:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5) at node:internal/main/run_main_module:33:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v24.14.0 ```
Author
Owner

Session update — rate limits + clarifications

Rate limits: Re-ran configure-key-limits.js — applied successfully to all 5 keys. No errors. All keys now have qps/qpm guards.

qps / qpm: Queries per second and queries per minute — the maximum request rate the xAI API will accept before returning a 429 (rate limit hit). A query here means one API call, regardless of token count. We set them conservatively (e.g. xai-ba: 2/sec, 30/min) so that even if B.A. fires rapid sequential requests during a build, we don't blow the daily budget accidentally.


On tui.js not found: That's correct — it doesn't exist yet. The TUI was spec'd in token-monitor#3 (Hannibal's mission brief, session 97) as the B.A. deliverable, but that mission hasn't been run yet. Hannibal hasn't started it.

The issue brief exists, the code does not. Apologies for the confusion — I created #3 as a future mission spec, not a completion notice. The TUI is the thing that needs to be built.


On "notification / email for what was built and is available": That's a real gap. I build things in issue comments and commits, but there's no mechanism pushing a summary to you. You have to read the issues to find out. That's backwards.

Opening a new issue for this — a build digest emailer. It scans recent commits and closed issues, formats a summary, and sends it on demand (or on schedule). You should be able to run one command and get "here's what changed this week" in your inbox.

Will track as a new issue.

## Session update — rate limits + clarifications **Rate limits:** Re-ran `configure-key-limits.js` — applied successfully to all 5 keys. No errors. All keys now have qps/qpm guards. **qps / qpm:** Queries per second and queries per minute — the maximum request rate the xAI API will accept before returning a 429 (rate limit hit). A *query* here means one API call, regardless of token count. We set them conservatively (e.g. xai-ba: 2/sec, 30/min) so that even if B.A. fires rapid sequential requests during a build, we don't blow the daily budget accidentally. --- **On `tui.js` not found:** That's correct — it doesn't exist yet. The TUI was spec'd in token-monitor#3 (Hannibal's mission brief, session 97) as the B.A. deliverable, but that mission hasn't been run yet. Hannibal hasn't started it. The issue brief exists, the code does not. Apologies for the confusion — I created #3 as a *future mission spec*, not a completion notice. The TUI is the thing that needs to be built. --- **On "notification / email for what was built and is available":** That's a real gap. I build things in issue comments and commits, but there's no mechanism pushing a summary to you. You have to read the issues to find out. That's backwards. Opening a new issue for this — a build digest emailer. It scans recent commits and closed issues, formats a summary, and sends it on demand (or on schedule). You should be able to run one command and get "here's what changed this week" in your inbox. Will track as a new issue.
Author
Owner

Session 114 — Phase 2b complete

Status: all deliverables shipped. Closing this issue.


What's done

Component Status
providers/xai-billing.js — fetchXaiUsage, fetchXaiInvoicePreview, aggregateByKey, renderXaiSection Live
Key ID → name resolution (label parsing, UUID stripping) Built into module
Integration into analyze.js (--xai flag + full report section) Done
Rate limits via configure-key-limits.js — qps/qpm per key role Applied to all 5 keys

Running node analyze.js --xai now returns:

xAI Spend (2026-04-01 – 2026-04-07)
  xai-vigilio            $27.88  [cached: $10.31  compl: $8.11  prompt: $6.90  reason: $2.03  search: $0.32  image: $0.20]
  xai-face                $0.01
  ...
  total                  $27.89
  prepaid credit: $3.19 remaining ($27.81 of $31.00 used this period)
  billing cycle:  2026-04

⚠️ Budget alert for Ludo

xAI prepaid credit is nearly exhausted: $3.19 remaining of $31.00.

The $27.88 from xai-vigilio is the primary driver — a combination of xai_search calls, grok reasoning queries, and image generation. This will exhaust within a session or two of normal use. The billing cycle is 2026-04 so it resets at end of April.

Recommended action: Top up the prepaid credit in console.x.ai, or suspend xai_search usage until the cycle resets.

TUI (token-monitor#3) is still unbuilt — that's Hannibal's mission brief and hasn't been executed yet.

Closing this issue. Phase 2b is done.

## Session 114 — Phase 2b complete **Status: all deliverables shipped.** Closing this issue. --- ### What's done | Component | Status | |-----------|--------| | `providers/xai-billing.js` — fetchXaiUsage, fetchXaiInvoicePreview, aggregateByKey, renderXaiSection | ✅ Live | | Key ID → name resolution (label parsing, UUID stripping) | ✅ Built into module | | Integration into `analyze.js` (`--xai` flag + full report section) | ✅ Done | | Rate limits via `configure-key-limits.js` — qps/qpm per key role | ✅ Applied to all 5 keys | Running `node analyze.js --xai` now returns: ``` xAI Spend (2026-04-01 – 2026-04-07) xai-vigilio $27.88 [cached: $10.31 compl: $8.11 prompt: $6.90 reason: $2.03 search: $0.32 image: $0.20] xai-face $0.01 ... total $27.89 prepaid credit: $3.19 remaining ($27.81 of $31.00 used this period) billing cycle: 2026-04 ``` --- ### ⚠️ Budget alert for Ludo **xAI prepaid credit is nearly exhausted: $3.19 remaining of $31.00.** The $27.88 from `xai-vigilio` is the primary driver — a combination of xai_search calls, grok reasoning queries, and image generation. This will exhaust within a session or two of normal use. The billing cycle is 2026-04 so it resets at end of April. **Recommended action:** Top up the prepaid credit in console.x.ai, or suspend xai_search usage until the cycle resets. TUI (token-monitor#3) is still unbuilt — that's Hannibal's mission brief and hasn't been executed yet. Closing this issue. Phase 2b is done.
Sign in to join this conversation.
No description provided.