Agent Rate Limits¶
!!! info "TL;DR" Rate limits are enforced per agent via Upstash Redis. Three tiers: Standard (60/min), Professional (300/min), Enterprise (1000/min). Custom limits available via policies.
Rate Limit Tiers¶
Each agent is assigned a rate limit tier. The tier determines requests per minute across all MCP tools.
| Tier | Requests/Minute | Use Case |
|---|---|---|
| Standard | 60 | Development, testing, low-volume agents |
| Professional | 300 | Production agents with moderate load |
| Enterprise | 1000 | High-volume production agents |
| Custom | Configurable | Special requirements (contact support) |
Rate limits are tracked per agent, not per API key. If an agent has multiple keys, the limit applies to all keys combined.
How Rate Limiting Works¶
The MCP server uses Upstash Redis with a sliding window algorithm. Each request:
- Increments a counter in Redis with the agent's ID
- Sets a TTL of 60 seconds
- Checks the current count
- If count exceeds limit, returns
429 Too Many Requests - If within limit, proceeds to execution
Rate Limit Headers¶
Every response includes rate limit headers:
X-RateLimit-Limit— Total requests allowed per minuteX-RateLimit-Remaining— Requests remaining in current windowX-RateLimit-Reset— Unix timestamp when the window resets
Rate Limit Response¶
If rate limited, the server returns:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 429,
"message": "Rate limit exceeded",
"data": {
"limit": 60,
"window": "1 minute",
"retry_after": 42
}
}
}
The retry_after field indicates seconds until the window resets.
Custom Rate Limits¶
You can override the default tier limit with a custom policy. In the admin dashboard:
- Navigate to Settings → Agents → Policies
- Create or edit a policy
- Under Rate Limiting, set custom limits
- Assign the policy to the agent
Example: Custom Policy¶
{
"name": "high-volume-survey-agent",
"scopes": ["surveys:*", "responses:*"],
"rate_limit": {
"requests_per_minute": 500,
"burst": 50
}
}
The burst parameter allows short spikes above the sustained rate. If the agent sends 50 requests in 5 seconds, it won't be rate limited, but sustained load above 500/min will trigger limiting.
Per-Tool Rate Limits¶
Some tools have additional rate limits beyond the agent-level limit:
| Tool | Additional Limit | Reason |
|---|---|---|
submit_response | 10/min per survey | Prevent response spam |
create_survey | 30/hour | Prevent survey spam |
trigger_workflow | 100/hour per workflow | Prevent infinite loops |
These limits apply even if the agent hasn't hit its overall rate limit.
Rate Limit Monitoring¶
The admin dashboard shows real-time rate limit usage under Settings → Agents → [Agent Name] → Activity.
Metrics include:
- Current requests/minute
- Peak requests/minute (last 24h)
- Total requests (last 7 days)
- Rate limit violations (last 7 days)
You can set up alerts to notify when an agent consistently hits its rate limit. This might indicate:
- The agent needs a higher tier
- A bug is causing excessive requests
- Malicious activity
Best Practices¶
- Cache responses — Don't re-fetch data you already have
- Batch operations — Use bulk tools when available (e.g.,
list_surveysinstead of multipleget_surveycalls) - Implement backoff — If rate limited, wait before retrying
- Use webhooks — Subscribe to realtime events instead of polling
- Monitor usage — Set up alerts for approaching limits
Example: Backoff Logic¶
async function callMcpTool(tool: string, params: unknown, retries = 3) {
try {
return await mcpClient.call(tool, params)
} catch (error) {
if (error.code === 429 && retries > 0) {
const retryAfter = error.data.retry_after || 60
await sleep(retryAfter * 1000)
return callMcpTool(tool, params, retries - 1)
}
throw error
}
}
Upgrading Tiers¶
To upgrade an agent's rate limit tier:
- Navigate to Settings → Agents → [Agent Name]
- Click Change Tier
- Select new tier
- Click Save
Changes take effect immediately. No API key regeneration required.
For custom tiers above 1000 requests/minute, contact support at support@canviq.app.
What's Next¶
- Authentication — API keys and scopes
- MCP Server — How rate limiting is implemented
- Available Tools — Which tools have additional limits