Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement Ideogram rate limiting, backoff, and request queuing patterns. Use when handling rate limit errors, implementing retry logic, or optimizing API request throughput for Ideogram. Trigger with phrases like "ideogram rate limit", "ideogram throttling", "ideogram 429", "ideogram retry", "ideogram backoff", "ideogram queue".
.claude/skills/jeremylongshore-ideogram-rate-limits/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -1% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 17% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 38% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 40% | 0% |
Handle Ideogram's rate limits with exponential backoff, request queuing, and concurrency control. Ideogram enforces a default limit of 10 in-flight requests (concurrent, not per-minute). Image generation takes 5-15 seconds per call, so this limit can be hit quickly during batch operations.
IDEOGRAM_API_KEY configuredp-queue npm package (optional, for queue-based approach)| Aspect | Detail | |--------|--------| | Type | Concurrent in-flight requests | | Default limit | 10 simultaneous requests | | Error code | HTTP 429 | | Retry header | Not guaranteed -- use exponential backoff | | Higher limits | Contact partnership@ideogram.ai | | Generation time | 5-15s per image (varies by model/resolution) |
typescriptasync function withBackoff<T>( operation: () => Promise<T>, config = { maxRetries: 5, baseMs: 1000, maxMs: 30000, jitterMs: 500 } ): Promise<T> { for (let attempt = 0; attempt <= config.maxRetries; attempt++) { try { return await operation(); } catch (err: any) { if (attempt === config.maxRetries) throw err; const status = err.status ?? err.response?.status; // Only retry on 429 (rate limited) or 5xx (server error) if (status && status !== 429 && status < 500) throw err; const exponential = config.baseMs * Math.pow(2, attempt); const jitter = Math.random() * config.jitterMs; const delay = Math.min(exponential + jitter, config.maxMs); console.warn(`Rate limited (attempt ${attempt + 1}/${config.maxRetries}). Waiting ${delay.toFixed(0)}ms`); await new Promise(r => setTimeout(r, delay)); } } throw new Error("Unreachable"); }
typescriptimport PQueue from "p-queue"; // Ideogram allows 10 in-flight -- use 8 to leave headroom const ideogramQueue = new PQueue({ concurrency: 8 }); async function queuedGenerate(prompt: string, options: any = {}) { return ideogramQueue.add(async () => { const response = await fetch("https://api.ideogram.ai/generate", { method: "POST", headers: { "Api-Key": process.env.IDEOGRAM_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({ image_request: { prompt, model: "V_2", ...options }, }), }); if (response.status === 429) { throw Object.assign(new Error("Rate limited"), { status: 429 }); } if (!response.ok) throw new Error(`Generate failed: ${response.status}`); return response.json(); }); } // Process 50 prompts safely -- queue manages concurrency const prompts = Array.from({ length: 50 }, (_, i) => `Design variant ${i + 1}`); const results = await Promise.all(prompts.map(p => queuedGenerate(p)));
typescriptclass TokenBucket { private tokens: number; private lastRefill: number; constructor( private maxTokens: number = 10, private refillRate: number = 1, // tokens per second ) { this.tokens = maxTokens; this.lastRefill = Date.now(); } async acquire(): Promise<void> { this.refill(); if (this.tokens > 0) { this.tokens--; return; } // Wait for next token const waitMs = (1 / this.refillRate) * 1000; await new Promise(r => setTimeout(r, waitMs)); this.refill(); this.tokens--; } private refill() { const now = Date.now(); const elapsed = (now - this.lastRefill) / 1000; this.tokens = Math.min(this.maxTokens, this.tokens + elapsed * this.refillRate); this.lastRefill = now; } } const bucket = new TokenBucket(10, 1); async function throttledGenerate(prompt: string) { await bucket.acquire(); return queuedGenerate(prompt); }
typescriptasync function batchGenerate( prompts: string[], onProgress?: (done: number, total: number) => void ) { const results: any[] = []; const errors: { prompt: string; error: Error }[] = []; for (let i = 0; i < prompts.length; i++) { try { const result = await withBackoff(() => queuedGenerate(prompts[i])); results.push(result); } catch (err) { errors.push({ prompt: prompts[i], error: err as Error }); } onProgress?.(i + 1, prompts.length); } console.log(`Batch complete: ${results.length} success, ${errors.length} failed`); return { results, errors }; }
| Scenario | Detection | Action | |----------|-----------|--------| | 429 received | HTTP status | Exponential backoff + retry | | All retries exhausted | Max attempts reached | Log and skip, continue batch | | Burst spike | Queue depth > 20 | Pause new submissions | | Credits exhausted | 402 status | Alert, stop batch immediately |
partnership@ideogram.aiFor security configuration, see ideogram-security-basics.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-24 | pass→pass | 13,911 | 20,426 | +47% | 1 | 1 | 0% | 2,802 | 4,709 | +68% | 0 | 0 | — |
case-01 | fail→pass | 26,411 | 24,591 | -7% | 1 | 1 | 0% | 5,862 | 5,775 | -1% | 0 | 0 | — |
case-02 | fail→fail | 26,676 | 22,706 | -15% | 1 | 1 | 0% | 4,575 | 6,692 | +46% | 0 | 0 | — |
case-03 | fail→pass | 19,277 | 11,843 | -39% | 1 | 1 | 0% | 2,352 | 2,754 | +17% | 0 | 0 | — |
case-04 | pass→pass | 16,312 | 7,379 | -55% | 1 | 1 | 0% | 1,871 | 2,830 | +51% | 0 | 0 | — |
case-13 | pass→pass | 25,467 | 13,686 | -46% | 1 | 1 | 0% | 2,274 | 2,950 | +30% | 0 | 0 | — |
case-05 | pass→pass | 20,975 | 10,740 | -49% | 1 | 1 | 0% | 2,946 | 3,662 | +24% | 0 | 0 | — |
case-06 | pass→pass | 18,166 | 17,481 | -4% | 1 | 1 | 0% | 2,388 | 3,914 | +64% | 0 | 0 | — |
case-07 | pass→pass | 21,566 | 17,240 | -20% | 1 | 1 | 0% | 3,135 | 4,099 | +31% | 0 | 0 | — |
case-08 | pass→fail | 12,581 | 8,070 | -36% | 1 | 1 | 0% | 2,216 | 3,206 | +45% | 0 | 0 | — |
case-23 | pass→pass | 19,574 | 20,279 | +4% | 1 | 1 | 0% | 3,626 | 5,769 | +59% | 0 | 0 | — |
case-09 | fail→pass | 22,514 | 11,369 | -50% | 1 | 1 | 0% | 1,646 | 2,728 | +66% | 0 | 0 | — |
case-10 | fail→pass | 16,835 | 12,153 | -28% | 1 | 1 | 0% | 2,674 | 3,695 | +38% | 0 | 0 | — |
case-11 | pass→pass | 19,851 | 13,028 | -34% | 1 | 1 | 0% | 1,650 | 2,552 | +55% | 0 | 0 | — |
case-12 | pass→pass | 13,546 | 9,451 | -30% | 1 | 1 | 0% | 1,725 | 2,457 | +42% | 0 | 0 | — |
case-14 | fail→pass | 12,833 | 7,256 | -43% | 1 | 1 | 0% | 1,372 | 1,919 | +40% | 0 | 0 | — |
case-15 | pass→pass | 16,013 | 15,232 | -5% | 1 | 1 | 0% | 1,766 | 2,759 | +56% | 0 | 0 | — |
case-16 | fail→pass | 14,535 | 14,986 | +3% | 1 | 1 | 0% | 2,542 | 3,433 | +35% | 0 | 0 | — |
case-17 | fail→pass | 11,464 | 11,091 | -3% | 1 | 1 | 0% | 1,963 | 2,648 | +35% | 0 | 0 | — |
case-18 | pass→pass | 21,750 | 18,243 | -16% | 1 | 1 | 0% | 2,620 | 4,184 | +60% | 0 | 0 | — |
case-19 | fail→pass | 7,130 | 2,039 | -71% | 1 | 1 | 0% | 1,196 | 1,882 | +57% | 0 | 0 | — |
case-20 | pass→pass | 17,460 | 10,410 | -40% | 1 | 1 | 0% | 2,145 | 2,618 | +22% | 0 | 0 | — |
case-21 | pass→pass | 15,529 | 7,185 | -54% | 1 | 1 | 0% | 1,923 | 1,829 | -5% | 0 | 0 | — |
case-22 | pass→pass | 23,926 | 14,236 | -40% | 1 | 1 | 0% | 2,509 | 4,014 | +60% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +29 percentage points is the difference between those two pass rates over the 24 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.