Back to blog
Guides·3 min read·499 words

API Key Management Guide — Budgets, Rate Limits & Spending Controls

Qubax gives you granular control over API spending. This guide covers budgets, rate limits, and multi-key strategies to keep costs predictable.

API Key Management Guide — Budgets, Rate Limits & Spending Controls — illustration

API Key Management: Budgets, Rate Limits & Spending Controls

Qubax gives you granular control over API spending. This guide covers budgets, rate limits, and multi-key strategies to keep costs predictable.

Creating API Keys

  1. Go to qubax.ai/app → API Keys
  2. Click Create Key
  3. Name it (e.g., "Production", "Testing", "Cline")
  4. Copy the key immediately (shown only once)

Budget Controls

Each API key can have three budget types:

BudgetScopeUse Case
DailyResets every 24hPrevent runaway costs
WeeklyResets every 7 daysSprint-based spending
MonthlyResets every 30 daysTeam budget per developer

Example: Limit Cline to $5/month

  1. Create a key named "Cline"
  2. Set Monthly Budget to $5.00
  3. Use that key in Cline settings

When the budget is hit, the API returns a 402 error instead of silently letting you overspend.

Rate Limits

SettingScopeExample
Rate limit per minutePrevents burst60 req/min
Rate limit per dayDaily cap1000 req/day

Example: Prevent accidental loops

Set rate limit to 100 req/min. If your code has an infinite loop, it'll hit the rate limit and stop instead of draining your balance in seconds.

Multi-Key Strategy

Best practice: use separate keys for different tools:

code
Key 1: "Cursor"     — Monthly budget $10, model: claude-sonnet-5
Key 2: "Cline"      — Monthly budget $5,  model: claude-sonnet-5
Key 3: "Scripts"    — Daily budget $1,    model: gpt-5.6-terra
Key 4: "Production" — Monthly budget $50, no rate limit

This way, if one tool goes rogue, it only burns its own budget — not your entire balance.

Monitoring Usage

Each key shows:

  • Total requests
  • Total cost in USD
  • Tokens in/out
  • 7-day daily breakdown
  • Top models used

All visible from the API Keys dashboard.

API Key Scopes

ScopeAccess
CHATChat completions endpoint
MODELSList models endpoint
BILLING_READView balance (read-only)

Use scoped keys for third-party integrations — they can only access what they need.

CLI Key Management

bash
# Create key via API
curl -X POST https://api.qubax.ai/v1/api-keys \
  -H "Authorization: Bearer qbx_live_YOUR_KEY" \
  -d '{"name": "Production", "monthlyBudgetUsd": 50}'

# List keys
curl https://api.qubax.ai/v1/api-keys \
  -H "Authorization: Bearer qbx_live_YOUR_KEY"

# Revoke a key
curl -X DELETE https://api.qubax.ai/v1/api-keys/KEY_ID \
  -H "Authorization: Bearer qbx_live_YOUR_KEY"

Best Practices

  1. Never commit keys to git — use environment variables
  2. Rotate keys quarterly — delete old, create new
  3. Set budgets on every key — even "unlimited" should have a cap
  4. Use scoped keys for integrations — minimize blast radius
  5. Monitor the 7-day chart — catch spikes early

Start managing your API spending — [get $1 free credits](https://qubax.ai/register).

Article tags

#api-keys#budgets#rate-limits#tutorial
Share:Post on XTelegramLinkedInYHacker NewsReddit
Qubax AI

Qubax AI

AI Models at up to 99% off · Pay with crypto

Access GPT, Claude, Gemini, GLM & 340+ models through one OpenAI-compatible API. Up to 99% off. Pay with 200+ cryptocurrencies. Get $1 free credits — no credit card needed.

Related articles