openevidence-rate-limits
Ensures reliable performance by implementing backoff and rate limiting logic for OpenEvidence APIs.
Install
mkdir -p .claude/skills/openevidence-rate-limits && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6335" && unzip -o skill.zip -d .claude/skills/openevidence-rate-limits && rm skill.zipInstalls to .claude/skills/openevidence-rate-limits
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Rate Limits for OpenEvidence.Key capabilities
- →Implement request queuing for clinical queries
- →Apply exponential backoff for API retries
- →Batch process research queries during off-peak hours
How it works
A token-bucket rate limiter tracks request counts per minute, while a retry function handles 429 errors using jittered backoff intervals.
Inputs & outputs
When to use openevidence-rate-limits
- →Handling rate limit errors
- →Implementing backoff strategies
- →Optimizing API throughput
- →Managing query queueing
About this skill
OpenEvidence Rate Limits
Overview
OpenEvidence's clinical decision support API enforces strict rate limits to ensure reliable evidence retrieval for healthcare applications. Clinical query endpoints are throttled per API key, with lower limits on evidence synthesis calls that involve AI-powered literature analysis. In clinical settings, rate limiting directly impacts patient care workflows, so implementations must prioritize graceful degradation over retry storms. Batch research queries during off-peak hours and cache evidence summaries aggressively since medical literature changes infrequently.
Rate Limit Reference
| Endpoint | Limit | Window | Scope |
|---|---|---|---|
| Clinical query | 30 req | 1 minute | Per API key |
| Evidence synthesis | 10 req | 1 minute | Per API key |
| Literature search | 60 req | 1 minute | Per API key |
| Citation retrieval | 120 req | 1 minute | Per API key |
| Bulk evidence export | 5 req | 1 hour | Per API key |
Rate Limiter Implementation
class OpenEvidenceRateLimiter {
private tokens: number;
private lastRefill: number;
private readonly max: number;
private readonly refillRate: number;
private queue: Array<{ resolve: () => void }> = [];
constructor(maxPerMinute: number) {
this.max = maxPerMinute;
this.tokens = maxPerMinute;
this.lastRefill = Date.now();
this.refillRate = maxPerMinute / 60_000;
}
async acquire(): Promise<void> {
this.refill();
if (this.tokens >= 1) { this.tokens -= 1; return; }
return new Promise(resolve => this.queue.push({ resolve }));
}
private refill() {
const now = Date.now();
this.tokens = Math.min(this.max, this.tokens + (now - this.lastRefill) * this.refillRate);
this.lastRefill = now;
while (this.tokens >= 1 && this.queue.length) {
this.tokens -= 1;
this.queue.shift()!.resolve();
}
}
}
const queryLimiter = new OpenEvidenceRateLimiter(25);
const synthesisLimiter = new OpenEvidenceRateLimiter(8);
Retry Strategy
async function openEvidenceRetry<T>(
limiter: OpenEvidenceRateLimiter, fn: () => Promise<Response>, maxRetries = 3
): Promise<T> {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
await limiter.acquire();
const res = await fn();
if (res.ok) return res.json();
if (res.status === 429) {
const retryAfter = parseInt(res.headers.get("Retry-After") || "30", 10);
const jitter = Math.random() * 2000;
await new Promise(r => setTimeout(r, retryAfter * 1000 + jitter));
continue;
}
if (res.status >= 500 && attempt < maxRetries) {
await new Promise(r => setTimeout(r, Math.pow(2, attempt) * 3000));
continue;
}
throw new Error(`OpenEvidence API ${res.status}: ${await res.text()}`);
}
throw new Error("Max retries exceeded");
}
Batch Processing
async function batchClinicalQueries(queries: string[], batchSize = 5) {
const results: any[] = [];
for (let i = 0; i < queries.length; i += batchSize) {
const batch = queries.slice(i, i + batchSize);
const batchResults = await Promise.all(
batch.map(q => openEvidenceRetry(queryLimiter, () =>
fetch(`${OE_BASE}/api/v1/clinical/query`, {
method: "POST", headers,
body: JSON.stringify({ question: q, includeEvidence: true }),
})
))
);
results.push(...batchResults);
if (i + batchSize < queries.length) await new Promise(r => setTimeout(r, 12_000));
}
return results;
}
Error Handling
| Issue | Cause | Fix |
|---|---|---|
| 429 on clinical query | Exceeded 30 req/min query cap | Queue queries, return cached if available |
| 429 on synthesis | Synthesis limit (10/min) is strict | Pre-cache common drug interaction queries |
| Synthesis timeout | Complex multi-study analysis | Set 120s timeout, poll async endpoint |
| 401 key expired | API key rotation missed | Automate key rotation with 7-day buffer |
| Stale evidence | Cached result older than 30 days | Set TTL on cache, re-query on expiry |
Resources
Next Steps
See openevidence-performance-tuning.
When not to use it
- →Ignoring 429 status codes in production
- →Retrying synthesis calls without jitter
Prerequisites
Limitations
- →Synthesis limit is strictly 10 requests per minute
- →Bulk evidence export limited to 5 requests per hour
How it compares
This implementation prioritizes graceful degradation in clinical workflows rather than simple retry loops.
Compared to similar skills
openevidence-rate-limits side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| openevidence-rate-limits (this skill) | 1 | 25d | No flags | Advanced |
| java-pro | 34 | 4mo | No flags | Advanced |
| bullmq-specialist | 25 | 6mo | No flags | Intermediate |
| golang-pro | 14 | 4mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by jeremylongshore
View all by jeremylongshore →You might also like
java-pro
sickn33
Master Java 21+ with modern features like virtual threads, pattern matching, and Spring Boot 3.x. Expert in the latest Java ecosystem including GraalVM, Project Loom, and cloud-native patterns. Use PROACTIVELY for Java development, microservices architecture, or performance optimization.
bullmq-specialist
davila7
BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications. Use when: bullmq, bull queue, redis queue, background job, job queue.
golang-pro
sickn33
Master Go 1.21+ with modern patterns, advanced concurrency, performance optimization, and production-ready microservices. Expert in the latest Go ecosystem including generics, workspaces, and cutting-edge frameworks. Use PROACTIVELY for Go development, architecture design, or performance optimization.
go-concurrency-patterns
wshobson
Master Go concurrency with goroutines, channels, sync primitives, and context. Use when building concurrent Go applications, implementing worker pools, or debugging race conditions.
rust-async-patterns
wshobson
Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns. Use when building async Rust applications, implementing concurrent systems, or debugging async code.
graphql
davila7
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.