Design evidence-based PostHog private-API throttling with correct endpoint classes, team-wide budgets, backoff, and export alternatives.

MITAuto-check passedBackend & APIs

Install Posthog Rate Limits

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-rate-limits -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-rate-limits --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/posthog-rate-limits .claude/skills/posthog-rate-limits && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
posthog-rate-limits
GitHub stars
2.8k
Token cost
~2.2k tokens
SKILL.md length
513 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Design evidence-based PostHog private-API throttling with correct endpoint classes, team-wide budgets, backoff, and export alternatives.

  • Works in 4 steps: Implement Exponential Backoff with… → Request Queue for Burst Protection → Cache Frequently Accessed Data → …
  • A private API returns 429
  • SKILL.md covers Overview, Prerequisites, PostHog Rate Limit Tiers and Instructions, plus 6 more sections
  • Reaches us.posthog.com; needs POSTHOG_PERSONAL_API_KEY

What it does

Posthog Rate Limits is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design evidence-based PostHog private-API throttling with correct endpoint classes, team-wide budgets, backoff, and export alternatives. Use when a private API returns 429 or a polling job needs a request budget. Trigger with "PostHog rate limit", "PostHog 429", or "PostHog backoff".

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/official-docs.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Rate limiting. It works with PostHog. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • A private API returns 429
  • A polling job needs a request budget
  • With PostHog rate limit
  • PostHog backoff

Example prompts

  • “PostHog rate limit”
  • “PostHog 429”
  • “PostHog backoff”
  • “/posthog-rate-limits”

Requirements

  • A credential in POSTHOG_PERSONAL_API_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Implement Exponential Backoff with Retry-After
  2. Request Queue for Burst Protection
  3. Cache Frequently Accessed Data
  4. Monitor Rate Limit Headers

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • us.posthog.com

    Also links to:

    • posthog.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • POSTHOG_PERSONAL_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Posthog Rate Limits loads about 2.2k tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 76 tokens; SKILL.md has 513 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 513 words, ~2,198 tokens.

Download SKILL.mdSave it as .claude/skills/posthog-rate-limits/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
posthog-rate-limits
description
Design evidence-based PostHog private-API throttling with correct endpoint classes, team-wide budgets, backoff, and export alternatives. Use when a private API returns 429 or a polling job needs a request budget. Trigger with "PostHog rate limit", "PostHog 429", or "PostHog backoff".
allowed-tools
Read, Write, Edit
compatibility
Designed for Claude Code
argument-hint
[integration] [endpoint-class]
version
1.14.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, posthog, api

PostHog Rate Limits

Overview

PostHog rate limits apply to private API endpoints authenticated with a personal API key, project secret key where available, or OAuth. Public POST-only capture and flag endpoints have no PostHog request-level rate limit, but capture can still report billing limits in a successful response.

Prerequisites

  • A least-privilege personal API key, project secret key where available, or OAuth token for private endpoints
  • Understanding of which endpoints you call and how often
  • posthog-node or direct API usage

PostHog Rate Limit Tiers

Endpoint CategoryRate LimitExamples
Public event capture (/e, /i/v0/e, /batch/)No request-level limitSDK capture and batch ingestion
Public feature flags (/flags)No request-level limitClient-side flag evaluation
Analytics API (insights, persons, recordings)240/min, 1200/hourTrend queries, person lookup
Events values (/events/values)60/min, 300/hourEvent-property value lookup
Query API (/api/projects/:id/query/)2400/hourHogQL and structured queries
Feature flag local evaluation polling600/minServer SDK flag definition fetch
Other private CRUD endpoints480/min, 4800/hourFeature flag CRUD, cohorts, annotations

These budgets apply to the whole PostHog team, not to each key or process. Coordinate workers through a shared limiter when more than one caller uses the same endpoint class.

Instructions

Tool discipline

Use Read to inspect the relevant configuration and implementation before proposing changes. Use Write only for a new, explicitly requested artifact inside the target project. Use Edit for minimal changes to existing project files after the evidence pass.

Step 1: Implement Exponential Backoff with Retry-After
typescript
async function postHogApiCall<T>(
  url: string,
  options: RequestInit,
  maxRetries = 5
): Promise<T> {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    const response = await fetch(url, {
      ...options,
      headers: {
        'Content-Type': 'application/json',
        Authorization: `Bearer ${process.env.POSTHOG_PERSONAL_API_KEY}`,
        ...options.headers,
      },
    });

    if (response.ok) {
      return response.json();
    }

    if (response.status === 429) {
      // Honor the Retry-After header from PostHog
      const retryAfter = parseInt(response.headers.get('Retry-After') || '0');
      const backoffMs = retryAfter > 0
        ? retryAfter * 1000
        : Math.min(1000 * Math.pow(2, attempt) + Math.random() * 500, 32000);

      console.warn(`PostHog 429: retrying in ${Math.round(backoffMs)}ms (attempt ${attempt + 1}/${maxRetries})`);
      await new Promise(r => setTimeout(r, backoffMs));
      continue;
    }

    // Don't retry client errors (except 429)
    if (response.status >= 400 && response.status < 500) {
      const body = await response.text();
      throw new Error(`PostHog API ${response.status}: ${body}`);
    }

    // Retry server errors (500+)
    if (attempt < maxRetries) {
      const delay = 1000 * Math.pow(2, attempt);
      await new Promise(r => setTimeout(r, delay));
      continue;
    }

    throw new Error(`PostHog API failed after ${maxRetries} retries: ${response.status}`);
  }

  throw new Error('Unreachable');
}
Step 2: Request Queue for Burst Protection
typescript
import PQueue from 'p-queue';

// Conservative analytics budget: 20/min averages to 1200/hour.
// A shared limiter is required when multiple workers use the same PostHog team.
const posthogQueue = new PQueue({
  concurrency: 2,       // Max parallel requests
  interval: 60_000,
  intervalCap: 20,
});

async function queuedPostHogCall<T>(
  url: string,
  options: RequestInit
): Promise<T> {
  return posthogQueue.add(() => postHogApiCall<T>(url, options));
}

// Usage: all calls are automatically throttled
const insights = await queuedPostHogCall(
  `https://us.posthog.com/api/projects/${PROJECT_ID}/insights/trend/`,
  { method: 'GET' }
);
Step 3: Cache Frequently Accessed Data
typescript
// Cache insight results to reduce API calls
class PostHogCache {
  private cache = new Map<string, { data: any; expiry: number }>();

  async get<T>(key: string, fetcher: () => Promise<T>, ttlMs = 300000): Promise<T> {
    const cached = this.cache.get(key);
    if (cached && Date.now() < cached.expiry) {
      return cached.data as T;
    }

    const data = await fetcher();
    this.cache.set(key, { data, expiry: Date.now() + ttlMs });
    return data;
  }

  invalidate(key: string) {
    this.cache.delete(key);
  }
}

const phCache = new PostHogCache();

// Cache trend data for 5 minutes
const trends = await phCache.get('weekly-pageviews', () =>
  queuedPostHogCall(`https://us.posthog.com/api/projects/${PROJECT_ID}/insights/trend/?events=[{"id":"$pageview"}]&date_from=-7d`, { method: 'GET' })
);
Step 4: Monitor Rate Limit Headers
typescript
class RateLimitMonitor {
  private remaining = Infinity;
  private resetAt = 0;

  update(headers: Headers) {
    const remaining = headers.get('X-RateLimit-Remaining');
    const reset = headers.get('X-RateLimit-Reset');

    if (remaining) this.remaining = parseInt(remaining);
    if (reset) this.resetAt = parseInt(reset) * 1000;
  }

  shouldThrottle(): boolean {
    return this.remaining < 10 && Date.now() < this.resetAt;
  }

  waitTime(): number {
    return Math.max(0, this.resetAt - Date.now());
  }

  log() {
    console.log(`PostHog rate limit: ${this.remaining} remaining, resets in ${Math.round(this.waitTime() / 1000)}s`);
  }
}

const rateLimits = new RateLimitMonitor();

// After each API call, update the monitor
const response = await fetch(url, options);
rateLimits.update(response.headers);
if (rateLimits.shouldThrottle()) {
  console.warn(`Approaching PostHog rate limit — waiting ${rateLimits.waitTime()}ms`);
  await new Promise(r => setTimeout(r, rateLimits.waitTime()));
}

Error Handling

ErrorCauseSolution
HTTP 429 on insights>240 req/min on analyticsQueue requests, cache results
429 on flag polling>600 req/min local eval fetchIncrease featureFlagsPollingInterval
429 on query API>2400 req/hour across the teamCache query results, reduce frequency, or use an export product
429 on events values>60 req/min or >300 req/hourCache dimensions and avoid interactive polling
429 on other CRUD>480 req/min or >4800 req/hourCoordinate callers through a team-wide limiter
Thundering herd on retryAll clients retry simultaneouslyAdd random jitter to backoff
Show full SKILL.md (165 more words)Show less

Key Points

  • Public capture and /flags have no PostHog request-level limit — still inspect successful capture responses for quota_limited and check ingestion warnings.
  • Private endpoints are limited by class — authentication may be a personal key, project secret key where available, or OAuth.
  • Limits are team-wide — separate keys do not create separate budgets.
  • Cache aggressively — insight data rarely needs real-time refresh
  • Honor Retry-After — PostHog tells you exactly how long to wait

Output

  • Exponential backoff with Retry-After header support
  • Endpoint-class request queue that respects both minute and hour budgets
  • In-memory cache for API responses
  • Rate limit header monitoring

Examples

For a scheduled HogQL query job, budget against the documented query limit, serialize retries from Retry-After, add jitter, and stop after a bounded attempt count. Do not apply private-API limits to public capture endpoints; inspect quota_limited and ingestion warnings separately.

Resources

See official PostHog references for current authority and verification boundaries.

Next Steps

For security configuration, see posthog-security-basics.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/.curated/posthog-rate-limits of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/official-docs.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Posthog Rate Limits next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Posthog Rate Limits compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Posthog Rate Limits this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.2kAutomated safety check: PassMIT
Consuming Endpoints From Client CodePostHog/posthog40k—~3.3kAutomated safety check: PassCustom licence
Routing Outbound API CallsPostHog/posthog40k—~2.7kAutomated safety check: PassCustom licence
Monitoring Capture ServicePostHog/posthog40k—~5kAutomated safety check: PassCustom licence
Using Redis Token BucketsPostHog/posthog40k—~1.6kAutomated safety check: PassCustom licence
Authoring CI WorkflowsPostHog/posthog40k—~12kAutomated safety check: PassCustom licence

Similar skills

  • Official

    Wire a PostHog endpoint into a client app or SDK. An agent skill from PostHog/posthog.

    40k GitHub stars~3.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Official

    Use before adding or changing Python code that calls a third-party HTTP API from PostHog (a vendor REST call, a vendor SDK client, a scraping or enrichment service), and before adding or changing a…

    40k GitHub stars~2.7k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Official

    Guide for using the Grafana MCP to monitor and diagnose the capture service (rust/capture) in production.

    40k GitHub stars~5k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Official

    A skill your agent uses when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit…

    40k GitHub stars~1.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Authoring CI Workflows

    PostHog/posthog

    Official

    A skill your agent uses when adding or editing a GitHub Actions workflow, composite action, or reusable workflow under .github/ — new CI jobs, triggers, matrices, checkout/clone tuning, action…

    40k GitHub stars~12k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Add Hosted Key

    simstudioai/sim

    Add hosted API key support to a tool so Sim provides the key (metered and billed to the workspace) when a user has not brought their own.

    30k GitHub stars~3.6k tokensUpdated today
    Backend & APIsAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Posthog Rate Limits

What does Posthog Rate Limits do?

Design evidence-based PostHog private-API throttling with correct endpoint classes, team-wide budgets, backoff, and export alternatives. Posthog Rate Limits is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design evidence-based PostHog private-API throttling with correct endpoint classes, team-wide budgets, backoff, and export alternatives.

When should I use Posthog Rate Limits?

Posthog Rate Limits fits situations like: A private API returns 429; A polling job needs a request budget; with PostHog rate limit; postHog backoff.

How do I install Posthog Rate Limits in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-rate-limits -a claude-code`. Or copy the skill folder (skills/.curated/posthog-rate-limits in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/posthog-rate-limits in your project. Claude Code loads it when a task matches its description.

How do I install Posthog Rate Limits in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-rate-limits -a codex`. Or copy the skill folder (skills/.curated/posthog-rate-limits in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/posthog-rate-limits in your project. Codex loads it when a task matches its description.

Can I use Posthog Rate Limits in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-rate-limits -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/posthog-rate-limits, .gemini/skills/posthog-rate-limits, .github/skills/posthog-rate-limits and .opencode/skills/posthog-rate-limits in your project.

What does Posthog Rate Limits need to run?

Going by SKILL.md and its folder, Posthog Rate Limits needs credentials named POSTHOG_PERSONAL_API_KEY. Our summary lists: A credential in POSTHOG_PERSONAL_API_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit. Compatibility (from SKILL.md): Designed for Claude Code.

Does Posthog Rate Limits access the network?

SKILL.md names 3 domains. In commands or code: us.posthog.com; the agent is likely to contact it when it follows the instructions. As links in the text: posthog.com and github.com. This is read from the text; nothing was executed.

Is Posthog Rate Limits safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Posthog Rate Limits use?

Posthog Rate Limits is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Posthog Rate Limits use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 199 tokens, read only when the agent opens those files.

What are the alternatives to Posthog Rate Limits?

Skills that share tags, products or a category with Posthog Rate Limits: Consuming Endpoints From Client Code (PostHog/posthog, 40k stars), Routing Outbound API Calls (PostHog/posthog, 40k stars), Monitoring Capture Service (PostHog/posthog, 40k stars) and Using Redis Token Buckets (PostHog/posthog, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Posthog Rate Limits?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.