| name | anima-rate-limits |
| description | Implement rate limiting for Anima API code generation requests.
Use when batching component generation, handling rate limit errors,
or optimizing API throughput for large design systems.
Trigger: "anima rate limit", "anima throttling", "anima batch generation".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*) |
| version | 1.4.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","design","figma","anima","rate-limiting"] |
| compatibility | Designed for Claude Code |
Anima Rate Limits
Overview
Anima API has per-minute rate limits on code generation. Each generateCode call processes one Figma node through AI — it's compute-intensive and rate-limited accordingly.
Rate Limit Tiers
| Tier | Generations/min | Concurrent | Notes |
|---|
| Partner (standard) | 10 | 2 | Most common |
| Enterprise | 30 | 5 | Custom agreement |
Instructions
Step 1: Throttled Generator with Bottleneck
import Bottleneck from 'bottleneck';
import { Anima } from '@animaapp/anima-sdk';
const limiter = new Bottleneck({
maxConcurrent: 2,
minTime: 6000,
reservoir: 10,
reservoirRefreshInterval: 60000,
reservoirRefreshAmount: 10,
});
const anima = new Anima({ auth: { token: process.env.ANIMA_TOKEN! } });
async function throttledGenerate(params: any) {
return limiter.schedule( anima.(params));
}
() {
results = [];
( nodeId nodeIds) {
result = ({
: process..!,
: process..!,
: [nodeId],
settings,
});
results.({ nodeId, : result. });
.();
}
results;
}
{ throttledGenerate, batchGenerate };