Entitlements & Tiers
Credit System

Credit System

Credits are HiveForge's fungible unit for metered usage across all proxy services. Every billable action -- AI completions, email sends, vector searches, webhook deliveries, and MCP tool calls -- consumes credits from the deployment's balance.

How Credits Work

Each deployment has two credit pools:

PoolSourceRollover
Period balanceMonthly allocation included with the tierNo -- resets each billing period
Purchased balanceCredit packs bought separatelyYes -- persists until used

Credits are deducted in order: period balance first, then purchased balance.

Credit Costs by Action

Credits are consumed at different rates depending on the service and action type.

AI Proxy

ActionDescriptionCredits
standardGPT-4o-mini, Claude HaikuLow
advancedGPT-4o, Claude SonnetMedium
premiumGPT-4.5, Claude OpusHigh

Email

ActionDescriptionCredits
sendSend a transactional emailLow

Vectors

ActionDescriptionCredits
searchVector similarity searchLow
upsertInsert/update vector recordsLow

Webhooks

ActionDescriptionCredits
sendDeliver a webhook eventLow

MCP Tools

ActionMapped ToolsCredits
task_basicBasic CRUD (list, create, update, delete)Low
task_advancedAI-powered operations (chat, create instance, promote)Medium
crew_executeMulti-agent crew executionHigh
generateContent generationMedium
rag_queryRAG vector searchLow-Medium
rag_ingestDocument ingestionLow-Medium
tao_traceTrace loggingLow
tao_evaluateAI evaluationMedium
tao_analyticsAnalytics queriesLow-Medium
platform_basicRead-only platform queriesLow

Exact credit values are stored in the database and can change. Use the /credit-costs endpoint to retrieve current values at runtime. See MCP Credit Costs for the MCP-specific endpoint.

Credit Packs

When the monthly allocation runs out, credit packs provide additional capacity.

Purchasing Credit Packs

Credit packs are one-time purchases available through the billing dashboard or API:

curl -X POST https://api.hiveforge.dev/api/v1/credits/purchase \
  -H "X-Deployment-ID: d9f2a1b4-..." \
  -H "X-Deployment-Secret: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "pack_type_id": "pack-starter"
  }'

Auto-Purchase

Deployments can configure automatic credit pack purchases to avoid service interruptions:

curl -X PATCH https://api.hiveforge.dev/api/v1/credits/settings \
  -H "X-Deployment-ID: d9f2a1b4-..." \
  -H "X-Deployment-Secret: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "overage_mode": "auto_purchase",
    "auto_purchase_pack_id": "pack-starter"
  }'

Overage Modes

ModeBehavior
blockReject requests when credits are exhausted (default)
allowAllow requests; track negative balance for invoicing
auto_purchaseAutomatically buy a credit pack when balance hits zero
⚠️

With auto_purchase enabled, ensure a valid payment method is on file. Failed auto-purchases fall back to block behavior.

Credit Balance API

Get Balance

curl https://api.hiveforge.dev/api/v1/credits/balance \
  -H "X-Deployment-ID: d9f2a1b4-..." \
  -H "X-Deployment-Secret: sk_live_..."

Response:

{
  "deployment_id": "d9f2a1b4-...",
  "period_balance": 7500,
  "purchased_balance": 2000,
  "total_available": 9500,
  "monthly_allocation": 10000,
  "period_end": "2026-04-01T00:00:00Z",
  "overage_mode": "block"
}

Usage Summary

Get aggregated credit usage by service and action:

curl "https://api.hiveforge.dev/api/v1/credits/usage?deployment_id=d9f2a1b4-..." \
  -H "Authorization: Bearer hf_live_..."

Response:

{
  "total_credits_used": 5550,
  "by_service": {
    "ai": 4200,
    "mcp": 1300,
    "email": 50
  },
  "by_action": {
    "ai/standard": 3000,
    "ai/advanced": 1200,
    "mcp/crew_execute": 500,
    "mcp/task_basic": 300,
    "mcp/rag_query": 500,
    "email/send": 50
  },
  "period_start": "2026-03-01T00:00:00Z",
  "period_end": "2026-03-28T23:59:59Z"
}

Credit Deduction Flow

The credit deduction process is atomic -- it uses a database function to prevent race conditions:

Request arrives


┌──────────────┐
│ Look up cost │  (service + action → credits)
└──────┬───────┘


┌──────────────────┐     ┌───────────────┐
│ Period balance    │────►│ Deduct from   │
│ >= cost?          │ Yes │ period balance│
└──────┬───────────┘     └───────────────┘
       │ No

┌──────────────────┐     ┌───────────────┐
│ Purchased balance │────►│ Deduct from   │
│ >= cost?          │ Yes │ purchased     │
└──────┬───────────┘     └───────────────┘
       │ No

┌──────────────────┐     ┌───────────────┐
│ Auto-purchase    │────►│ Buy pack,     │
│ enabled?         │ Yes │ then deduct   │
└──────┬───────────┘     └───────────────┘
       │ No

┌──────────────────┐
│ Reject: credits  │
│ insufficient     │
└──────────────────┘

The atomic deduction ensures that concurrent requests cannot overdraw the balance. Each deduction is logged in the credit_usage table for full audit trail.

Relationship to Tiers

Tiers determine the monthly credit allocation -- the number of credits added to the period balance at each billing cycle. Higher tiers receive larger allocations. Purchased credits work identically across all tiers.

TierFeature GatingMonthly Credits
SandboxMost services disabledMinimal
TrialAll services enabledStarter allocation
LaunchAll services + custom domainStandard allocation
GrowthAll services + white labelHigh allocation
EnterpriseAll services, unlimited quotasCustom allocation

Best Practices

  1. Monitor total_available -- Alert when credits drop below 20% of monthly allocation
  2. Use auto_purchase -- For production deployments where service interruption is unacceptable
  3. Review usage by action -- Identify which services consume the most credits and optimize accordingly
  4. Cache credit costs -- The cost table changes infrequently; cache for up to 1 hour
  5. Check before execute -- For expensive operations (crew execution, premium AI), always check entitlement first