GitHub Rate Limits: 403 = Permission OR Rate Limit

5,000·60·900
PAT req/hr · unauthenticated req/hr · secondary points/min
Last verified: 2026-11-10

GitHub returns 403 for both permission errors and rate limits. The headers tell you which one you actually hit — and retrying the wrong one can get your integration banned.

Which 403 do you have?

GitHub returns HTTP 403 for two different conditions: a rate limit and a permission error. A rate limit has either a retry-after header, or x-ratelimit-remaining: 0, or an error message mentioning a rate limit. A 403 with none of those three signals is a permission problem — retrying it wastes calls and can get the integration banned.

StatusSignalMeaningWhat to do
429AnyRate limitedFollow retry-after, or wait for reset
403retry-after presentSecondary rate limitWait exactly that many seconds
403x-ratelimit-remaining: 0Primary rate limit exhaustedWait until x-ratelimit-reset (UTC epoch)
403Message contains "rate limit" or "abuse detection"Secondary limit, no retry headerWait at least 60s, then exponential backoff
403None of the abovePermission error — not a rate limitDo not retry. Fix the token or scopes.
The expensive one. A 403 with no retry-after, no x-ratelimit-remaining: 0, and no rate-limit language in the body is a permission problem. Retrying it wastes calls and, per GitHub's own docs, "continuing to make requests while you are rate limited may result in the banning of your integration."

Primary limits (requests per hour)

GitHub's REST API allows 5,000 requests per hour for authenticated PATs, 60 per hour unauthenticated, and 1,000 per hour per repository for the GITHUB_TOKEN in Actions. GitHub App installations get 5,000 per hour plus 50 per repository and 50 per user above 20. The REST and GraphQL APIs have separate primary budgets.

AuthenticationLimitScope
Unauthenticated60 /hrPer IP address
Personal access token5,000 /hrPer user
GITHUB_TOKEN in Actions1,000 /hrPer repository
GitHub App installation5,000 /hr+50/repo and +50/user above 20

Secondary limits (burst protection)

Secondary rate limits protect against bursts and abuse, and none of them can be measured from the response. Concurrency is capped at 100 shared across REST and GraphQL. REST points are capped at 900 per minute, GraphQL at 2,000 per minute. GitHub's docs state these limits can change without notice and there is no way to check how close you are to them.

DimensionLimitNotes
Concurrent requests100Shared across REST and GraphQL
REST points per minute900GET/HEAD/OPTIONS = 1 pt; POST/PATCH/PUT/DELETE = 5 pts
GraphQL points per minute2,000No mutation = 1 pt; with mutation = 5 pts
Content-generating requests80 /min · 500 /hrIncludes actions taken in the web UI
CPU time90 s / 60 s realApproximate via total response time

What a rate-limited response looks like

A primary rate limit returns HTTP 403 with x-ratelimit-remaining: 0 and a x-ratelimit-reset epoch timestamp. A secondary limit also returns 403 or 429, but the body mentions "secondary rate limit" or "abuse detection mechanism". The x-ratelimit-remaining header is often non-zero during a secondary limit.

HTTP/1.1 403 Forbidden
x-ratelimit-limit: 5000
x-ratelimit-remaining: 0
x-ratelimit-used: 5000
x-ratelimit-reset: 1770000000
x-ratelimit-resource: core

{
  "message": "API rate limit exceeded for user ID 12345.",
  "documentation_url": "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api"
}

Retry logic that does not get you banned

GitHub's own guidance is to honour retry-after first, then x-ratelimit-reset if remaining is 0, and otherwise wait at least 60 seconds with exponential backoff. Continuing to call while rate limited can get the integration banned. The optimal retry loop returns None for a permission 403 — meaning "do not retry, fix the token."

import time, random, httpx

def github_wait_seconds(r, attempt):
    if r.status_code not in (403, 429):
        return None

    ra = r.headers.get("retry-after")
    if ra:
        return float(ra)

    if r.headers.get("x-ratelimit-remaining") == "0":
        reset = int(r.headers.get("x-ratelimit-reset", "0"))
        return max(reset - int(time.time()), 0)

    body = r.json() if r.content else {}
    msg = body.get("message", "").lower()
    if r.status_code == 429 or "rate limit" in msg or "abuse" in msg:
        return 60 * (2 ** attempt) + random.random()

    return None

One escape hatch

Conditional requests are the only technique on this page that makes a request free. Send If-None-Match with the stored ETag, or If-Modified-Since with Last-Modified. If the resource is unchanged, GitHub returns 304 Not Modified, and a 304 does not count against your primary rate limit. A polling job that touches 1,000 resources hourly costs 1,000 requests the first time and close to 0 after that.

What this is. A dated record of GitHub's published REST and GraphQL API rate limits, error shapes, and retry behaviour. Numbers are copied verbatim from GitHub's own documentation on the date shown. This page does not track you, does not ask for your email, and does not sell anything.

Source: docs.github.com — REST rate limits
Wrong or stale? Open an issue — corrections are the point.

← All APIs · Stripe · Slack