Skip to content
Skillv1.0.0

speak-rate-limits

Handle Speak API rate limits with exponential backoff, request queuing, and optimization strategies. Use when implementing rate limits features, or troubleshooting Speak language learning integration

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/speak-rate-limits/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill speak-rate-limits. Copyright stays with the author (MIT).

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

Tier Assessments/min Conversations/min Audio upload/min
Free 10 5 10
Pro 60 30 60
Enterprise 300 150 300

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

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

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.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-speak-rate-limits/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-speak-rate-limits.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-speak-rate-limits",
  "kind": "skill",
  "name": "speak-rate-limits",
  "description": "Handle Speak API rate limits with exponential backoff, request queuing, and optimization strategies. Use when implementing rate limits features, or troubleshooting Speak language learning integration issues. Trigger with phrases like \"speak rate limits\", \"speak rate limits\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "speak",
      "api",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Handle Speak API rate limits with exponential backoff, request queuing, and optimization strategies. Use when implementing rate limits features, or troubleshooting Speak language learning integration issues. Trigger with phrases like \"speak rate limits\", \"speak rate limits\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/speak-rate-limits/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/speak-rate-limits/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/speak-rate-limits/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(npm:*),",
      "Bash(curl:*),",
      "Grep"
    ],
    "license": "MIT"
  },
  "instructions": "# Speak Rate Limits\n\n## Overview\n\nHandle Speak API rate limits with exponential backoff, request queuing, and optimization strategies.\n\n## Prerequisites\n\n- Completed `speak-install-auth` setup\n- Valid API credentials configured\n- Understanding of Speak API patterns\n\n## Instructions\n\n### Rate Limit Overview\n\n| Tier | Assessments/min | Conversations/min | Audio upload/min |\n|------|----------------|-------------------|-----------------|\n| Free | 10 | 5 | 10 |\n| Pro | 60 | 30 | 60 |\n| Enterprise | 300 | 150 | 300 |\n\n### Rate-Limited Client\n\n```typescript\nclass RateLimitedSpeakClient {\n  private l",
  "cost": {
    "context_tokens": 799
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-speak-rate-limits/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.