From speak-pack
Implements Speak API rate limiting in TypeScript with per-minute throttling, 429 retry backoff, and batch queuing. Use for integrations hitting assessment/conversation limits.
How this skill is triggered — by the user, by Claude, or both
Slash command
/speak-pack:speak-rate-limitsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Handle Speak API rate limits with exponential backoff, request queuing, and optimization strategies.
Handle Speak API rate limits with exponential backoff, request queuing, and optimization strategies.
speak-install-auth setup| Tier | Assessments/min | Conversations/min | Audio upload/min |
|---|---|---|---|
| Free | 10 | 5 | 10 |
| Pro | 60 | 30 | 60 |
| Enterprise | 300 | 150 | 300 |
class RateLimitedSpeakClient {
private lastRequest = 0;
private minDelay: number;
constructor(private client: SpeakClient, requestsPerMinute: number = 60) {
this.minDelay = 60000 / requestsPerMinute;
}
private async throttle() {
const elapsed = Date.now() - this.lastRequest;
if (elapsed < this.minDelay) {
await new Promise(r => setTimeout(r, this.minDelay - elapsed));
}
this.lastRequest = Date.now();
}
async assessPronunciation(config: PronunciationConfig) {
await this.throttle();
return this.retryOn429(() => this.client.assessPronunciation(config));
}
private async retryOn429<T>(fn: () => Promise<T>, maxRetries = 3): Promise<T> {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (err: any) {
if (err.response?.status === 429 && i < maxRetries - 1) {
const wait = parseInt(err.response.headers['retry-after'] || String(2 ** i));
console.log(`Rate limited. Waiting ${wait}s...`);
await new Promise(r => setTimeout(r, wait * 1000));
continue;
}
throw err;
}
}
throw new Error('Max retries exceeded');
}
}
async function batchAssess(client: RateLimitedSpeakClient, recordings: Recording[]) {
const results = [];
for (const rec of recordings) {
const result = await client.assessPronunciation({
audioPath: rec.path, targetText: rec.text, language: rec.lang,
});
results.push({ ...rec, score: result.score });
console.log(`Assessed "${rec.text}": ${result.score}/100`);
}
return results;
}
| Error | Cause | Solution |
|---|---|---|
| 401 Unauthorized | Invalid API key | Verify SPEAK_API_KEY environment variable |
| 429 Rate Limited | Too many requests | Wait Retry-After seconds, use backoff |
| Audio format error | Wrong codec/sample rate | Convert to WAV 16kHz mono with ffmpeg |
| Session expired | Timeout after 30 min | Start a new conversation session |
See speak-prod-checklist for production readiness.
Basic: Apply rate limits with default configuration for a standard Speak integration.
Advanced: Customize for production with error recovery, monitoring, and team-specific requirements.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin speak-packProvides TypeScript patterns for Speak language learning API: conversation sessions, pronunciation assessment, ffmpeg audio preprocessing, retries. For SDK integration or troubleshooting.
Implements ElevenLabs rate limiting with plan-aware concurrency queuing, exponential backoff, and 429 error handling for TTS requests.
Implements exponential backoff with jitter, queue throttling, and concurrency limits for AssemblyAI transcription and streaming APIs. Use for 429 retry logic and throughput management.