Read rate-limit headroom from API response headers

Which providers send remaining-requests headers, which send credit headers, and which send nothing, so you know before the 429.

Headroom only shows up in response headers, never on a billing page. OpenAI sends x-ratelimit-remaining-requests and -tokens, Anthropic sends anthropic-ratelimit-requests-remaining and -tokens-remaining, and data providers like People Data Labs and LeadMagic send credit headers too. 20 of 28 common APIs send no rate-limit header at all, including Gemini, Perplexity and DeepSeek.

Headers by provider

ProviderRate-limit headersCredit headers
Anthropicanthropic-ratelimit-tokens-remaining, anthropic-ratelimit-requests-remainingNone
ApifyNoneNone
Apollo.ioNoneNone
Bright DataNoneNone
CoresignalNonex-credits-remaining
CrunchbaseNoneNone
Crustdatax-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-resetNone
DeepSeekNoneNone
ExaNoneNone
FirecrawlNoneNone
Google GeminiNoneNone
Google PlacesNoneNone
HubSpot BreezeNoneNone
Hunter.ioNoneNone
InstantlyNoneNone
LeadMagicRateLimit-RemainingX-Credits-Remaining, X-Credits-Cost
MillionVerifierNoneNone
OpenAIx-ratelimit-remaining-requests, x-ratelimit-remaining-tokensNone
OpenRouterX-RateLimit-Limit, X-RateLimit-RemainingNone
ParallelNoneNone
People Data Labsx-ratelimit-remainingx-call-credits-spent, x-totallimit-remaining, x-totallimit-overages-remaining
PerplexityNoneNone
PostmarkNoneNone
ProspeoNoneNone
SecurityTrailsNoneNone
SendGridNoneNone
Tavilyretry-afterNone
WhoisXML APIX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-ResetNone

Capture them at your egress

The only way to see headroom is to read it off responses as they come back. A fetch wrapper does it in one place:

const watched = ["x-ratelimit-remaining-requests", "anthropic-ratelimit-requests-remaining",
  "x-ratelimit-remaining", "x-credits-remaining", "x-totallimit-remaining"];

const original = globalThis.fetch;
globalThis.fetch = async (input, init) => {
  const res = await original(input, init);
  const host = new URL(input instanceof Request ? input.url : String(input)).host;
  for (const h of watched) {
    const v = res.headers.get(h);
    if (v !== null) record(host, h, Number(v)); // your metrics sink
  }
  return res;
};

The Argus SDK is this wrapper with every provider's header names built in, and it never reads bodies or auth headers. Argus turns the readings into headroom per provider, raises rate_limit_low at 10% or less, and answers get_rate_limit_status for your coding agent over MCP.

For providers that send nothing

Count your own requests per window against the published limit on each integration page, and treat the 429 rate as the signal. A rising 429 rate is the warning those providers won't give you.

Questions

Which OpenAI headers show remaining rate limit?
x-ratelimit-remaining-requests and x-ratelimit-remaining-tokens, on every API response.
Which Anthropic headers show remaining rate limit?
anthropic-ratelimit-requests-remaining and anthropic-ratelimit-tokens-remaining, on every API response.
Does Gemini send rate-limit headers?
No. Gemini responses carry no rate-limit headers; limits are per model and tier and only visible in the console. You find out with a 429 RESOURCE_EXHAUSTED.

Related

Let your coding agent watch the meter.

Connect a provider key, point Claude Code or Cursor at the Argus MCP server, and ask what the last run cost.