| name | palantir-rate-limits |
| description | Implement Palantir Foundry API rate limiting, backoff, and request queuing.
Use when handling 429 errors, implementing retry logic,
or optimizing API request throughput for Foundry.
Trigger with phrases like "palantir rate limit", "foundry throttling",
"palantir 429", "foundry retry", "palantir backoff".
|
| allowed-tools | Read, Write, Edit |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","palantir","foundry","rate-limits","reliability"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Palantir Rate Limits
Overview
Handle Foundry API rate limits with exponential backoff, request queuing, and monitoring. Foundry rate limits vary by endpoint and enrollment tier.
Prerequisites
foundry-platform-sdk installed
- Understanding of HTTP 429 responses
Instructions
Step 1: Understand Foundry Rate Limits
Foundry rate limits are per-user and per-endpoint. Key limits:
| Endpoint Category | Typical Limit | Burst |
|---|
| Ontology reads | 100 req/s | 200 |
| Ontology writes (Actions) | 50 req/s | 100 |
| Dataset reads | 50 req/s | 100 |
| Search queries | 20 req/s | 50 |
Rate limit headers returned:
X-RateLimit-Limit — max requests per window
X-RateLimit-Remaining — requests left in window
Retry-After — seconds to wait (on 429)
Step 2: Implement Retry with Backoff (Python)
import time
import random
import foundry
def retry_foundry_call(fn, *args, max_retries=5, base_delay=1.0, **kwargs):
"""Retry Foundry API calls with jittered exponential backoff."""
for attempt in range(max_retries + 1):
try:
return fn(*args, **kwargs)
except foundry.ApiError as e:
if attempt == max_retries:
raise
if e.status_code not in (, , , ):
delay = base_delay * ( ** attempt) + random.uniform(, )
retry_after = (e, , )
retry_after:
delay = (delay, (retry_after))
()
time.sleep(delay)
employees = retry_foundry_call(
client.ontologies.OntologyObject.,
ontology=, object_type=, page_size=,
)