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
| Quota | Config key | Description |
|---|---|---|
| Tokens per hour | quotas.tokens.maxPerHour | Maximum tokens (input + output) per agent per hour |
| Tokens per day | quotas.tokens.maxPerDay | Maximum tokens per agent per calendar day |
| Cost per day | quotas.cost.maxPerDay | Maximum USD spend per agent per calendar day |
| Concurrent spawns | quotas.spawn.maxConcurrent | Maximum number of simultaneously running sub-agents |
| Spawn depth | quotas.spawn.maxDepth | Maximum nesting depth for agent spawning (max 3) |
Configuration
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-agentsQuota 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:
| Tier | Tokens/day | Cost/day | Concurrent spawns |
|---|---|---|---|
free | 100K | $1.00 | 2 |
standard | 2M | $20.00 | 5 |
premium | 20M | $200.00 | 20 |
Monitoring quota usage
Current quota consumption can be checked via the REST API or the cost dashboard:
# 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 costsquota.exceeded events so your team is alerted before an agent is silently throttled.