When your application receives a 429 Too Many Requests error with code: rate_limited, use this guide to identify the specific bottleneck and adjust throughput.
Rendering diagram...
1. Pinpointing the Triggered Limit
Dike enforces two main per-minute sliding window tiers:
- Reasoning Quota (
POST /v1/reason):- Limit:
10 requests / minuteon Pay As You Go. - Common Cause: Autonomous agent loops calling
dike_reasonat every intermediate sub-goal. - Solution: Switch intermediate exploratory steps to
dike_searchanddike_graph_traverse, invokingdike_reasononce for the final synthesis.
- Limit:
- Standard API Quota (
/v1/search,/v1/cite,/v1/document/*,/v1/graph/traverse):- Limit:
30 req/min(Free),120 req/min(Pay As You Go). - Common Cause: Unbounded parallel thread execution during bulk document processing.
- Solution: Use an asynchronous semaphore with a maximum concurrency of 5–10 workers.
- Limit:
2. Automated Header-Driven Backoff (Python)
import time
import httpx
def execute_with_quota_guard(client: httpx.Client, endpoint: str, payload: dict):
response = client.post(endpoint, json=payload)
if response.status_code == 429:
reset_timestamp = int(response.headers.get("X-RateLimit-Reset", time.time() + 15))
sleep_duration = max(1, reset_timestamp - int(time.time()))
print(f"Hit rate limit on {endpoint}. Sleeping {sleep_duration}s until reset window...")
time.sleep(sleep_duration)
return execute_with_quota_guard(client, endpoint, payload)
response.raise_for_status()
return response.json()Next Steps
- Explore Weak Grounding Diagnostics.
- Review MCP Debugging.