Budget Allocation & Token Cost Management
PostQode Enterprise provides multi-tier budget controls and real-time cost analytics in the PostQode Web Console (/budget, /billing-usage, /analytics), allowing organizations to set precise spending limits and prevent unexpected API overruns.
1. Multi-Tier Budget Hierarchy
PostQode enforces a hierarchical budgeting model, allowing administrators to configure spending boundaries at three distinct levels:
┌────────────────────────────────────────────────────────┐
│ Account-Level Budget │
│ (Organization Total / Monthly Cap) │
└───────────────────────────┬────────────────────────────┘
│
┌───────────────┴───────────────┐
▼ ▼
┌───────────────────────┐ ┌───────────────────────┐
│ Team-Level Budget │ │ Team-Level Budget │
│ (e.g., Team A) │ │ (e.g., Team B) │
└───────────┬───────────┘ └───────────┬───────────┘
│ │
┌───────┴───────┐ ┌───────┴───────┐
▼ ▼ ▼ ▼
┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐
│Member │ │Member │ │Member │ │Member │
│Budget │ │Budget │ │Budget │ │Budget │
└───────┘ └───────┘ └───────┘ └───────┘
Hierarchy Breakdown
| Budget Level | Scope | Configured In | Description |
|---|---|---|---|
| Account Budget | Entire Organization | /budget or /organization | Sets the global expenditure limit across all teams, proxy keys, and developers. |
| Team Budget | Specific Team | /teams ➔ Team Details | Allocates a dedicated spend envelope for an engineering squad or project group. |
| Member Budget | Individual Developer | /members ➔ Member Details | Caps individual developer consumption to ensure equitable token distribution. |
2. Configuring Budgets & Reset Periods
When configuring budgets for an account, team, or member, administrators define two core parameters:
Budget Parameters
- Limit ($): The dollar amount allocated for the target scope (e.g.
$50.00,$250.00). - Period:
MONTHLY: Automatically resets at the start of each calendar month, allocating fresh credits for the new billing cycle.TOTAL: Sets a lifetime fixed ceiling. The limit remains fixed until manually adjusted or removed by an administrator.
Visual Spend Indicators & Thresholds
The Web Console displays real-time progress bars and color-coded status badges based on consumption:
| Consumption Ratio | Visual Indicator | Status Behavior |
|---|---|---|
| 0% – 79% | 🟢 Green (text-green-600) | Normal operating state. Requests route without restriction. |
| 80% – 99% | 🟠 Amber (text-amber-500) | Warning threshold reached. Team leads can monitor upcoming limits. |
| ≥ 100% | 🔴 Red (text-red-500) | Budget depleted. Gateway requests are automatically throttled until reset or budget increased. |
3. Bulk Budget Management
To streamline onboarding across large engineering organizations, administrators can assign and update member budgets in bulk:
- Navigate to Members (
/members) in the PostQode Web Console. - Select multiple developers using the table checkboxes.
- Click Bulk Budget Management.
- Set the desired Limit ($) and select the Period (
MONTHLYorTOTAL). - Click Save Budget to apply the policy across all selected members simultaneously.
Administrators can also remove individual or bulk member budgets with a single click, reverting developers to their parent team's shared allocation.
4. Real-Time Cost & Token Analytics
The Analytics Dashboard (/analytics or /dashboard) aggregates live telemetry across four dedicated views:
- General View (
👁️): High-level KPI cards (Total Cost, Total Tokens In/Out, Total Requests), member-level comparison bar charts withCost/Tokenstoggles, and model summary tables. - Member View (
👥): Individual developer drilldown, tracking specific user token consumption, model choices, and CSV export. - Teams View (
⛓️): Squad-level budget consumption, team totals, and member contributions within the team. - Gateway View (
⚡): Telemetry per proxy key, prompt caching read/write rates, and dollar expenditures.
Cost & Token Visualizations
- Cost Overview Chart: Tracks total spending trajectories over daily, weekly, and monthly intervals.
- Token Usage Chart: Real-time breakdown of Prompt Tokens, Completion Tokens, and total request counts.
- Cache Token Usage Chart: Measures Cache Read Tokens versus uncached tokens, visualizing the 90%+ cost reductions achieved via prompt caching on supported providers (Anthropic Claude, DeepSeek, OpenAI).
- Model Usage Table: Breakdown of spending and token distribution across models (
claude-sonnet-5,deepseek-reasoner,gpt-4o,gemini-2.5-flash). - Team & Member Usage Tables: Granular leaderboards showing consumption per engineer and squad.
5. Gateway Key Usage & Invoices
Per-Key Usage Logs (/gateway-keys/:keyId/usage)
Inspect request-level telemetry for each generated gateway key:
- Exact Model used per invocation.
- Prompt, completion, and total tokens.
- Calculated per-request dollar cost.
- HTTP status code and response latency.
Billing Records & Invoices (/billing-usage)
- Monthly consolidated billing statements.
- Itemized breakdown of raw LLM costs, calculated platform charges, and enterprise licenses.
- Invoice status tracking (
DRAFT,FINALIZED,PENDING,PAID) with downloadable records.