agentsclimarketplace

Speak rate limits

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/speak-pack/skills/speak-rate-limits

'Handle Speak API rate limits with exponential backoff, request queuing, and optimization strategies.From its SKILL.md

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill speak-rate-limits

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.7 KB, 767 tokens by cl100k_base, as published. Nobody here has run it

Speak Rate Limits

Overview

Handle Speak API rate limits with exponential backoff, request queuing, and optimization strategies.

Prerequisites

  • Completed speak-install-auth setup
  • Valid API credentials configured
  • Understanding of Speak API patterns

Instructions

Rate Limit Overview

TierAssessments/minConversations/minAudio upload/min
Free10510
Pro603060
Enterprise300150300

Rate-Limited Client

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');
  }
}

Batch Assessment Queue

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;
}

Output

  • Limits implementation complete
  • Speak API integration verified
  • Production-ready patterns applied

Error Handling

ErrorCauseSolution
401 UnauthorizedInvalid API keyVerify SPEAK_API_KEY environment variable
429 Rate LimitedToo many requestsWait Retry-After seconds, use backoff
Audio format errorWrong codec/sample rateConvert to WAV 16kHz mono with ffmpeg
Session expiredTimeout after 30 minStart a new conversation session

Resources

Next Steps

See speak-prod-checklist for production readiness.

Examples

Basic: Apply rate limits with default configuration for a standard Speak integration.

Advanced: Customize for production with error recovery, monitoring, and team-specific requirements.

What ships with it: 1 file

2.6 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.