Agents

Quotas

Quotas let you set hard limits on token consumption, cost, and agent spawning on a per-agent per-workspace basis. They protect against runaway costs, prevent abuse, and ensure fair resource allocation in multi-tenant deployments.

Quota types

QuotaConfig keyDescription
Tokens per hourquotas.tokens.maxPerHourMaximum tokens (input + output) per agent per hour
Tokens per dayquotas.tokens.maxPerDayMaximum tokens per agent per calendar day
Cost per dayquotas.cost.maxPerDayMaximum USD spend per agent per calendar day
Concurrent spawnsquotas.spawn.maxConcurrentMaximum number of simultaneously running sub-agents
Spawn depthquotas.spawn.maxDepthMaximum nesting depth for agent spawning (max 3)

Configuration

yaml
quotas:
  tokens:
    maxPerHour: 200000      # 200K tokens per hour per agent
    maxPerDay: 1000000      # 1M tokens per day per agent
  cost:
    maxPerDay: 10.00        # $10 USD per day per agent
  spawn:
    maxConcurrent: 5        # Max 5 sub-agents running simultaneously
    maxDepth: 2             # Sub-agents cannot spawn further sub-agents

Quota enforcement

Quotas are checked at the start of each agent turn, before inference is called. If a quota would be exceeded by the current turn, the turn is rejected with a 429 Too Many Requests-style error and a quota.exceeded event is emitted.

Cost quotas are checked against estimated cost using the last known provider pricing. Since token pricing is not always available in advance, cost limits are enforced on a best-effort basis and may slightly exceed the limit for a single turn.

Billing tiers

Quota defaults are set by billing tier. You can override any quota in astra.yml:

TierTokens/dayCost/dayConcurrent spawns
free100K$1.002
standard2M$20.005
premium20M$200.0020

Monitoring quota usage

Current quota consumption can be checked via the REST API or the cost dashboard:

bash
# Get quota usage for a specific agent
GET /agents/:id/usage

# Response:
# {
#   "tokens": { "hour": 45000, "day": 120000 },
#   "cost":   { "day": 1.23 },
#   "spawn":  { "active": 2, "depth": 1 }
# }

# CLI cost dashboard
npx astra costs
💡Set up webhook notifications for quota.exceeded events so your team is alerted before an agent is silently throttled.