Skip to content

Rate Limits Fresh

Rate limits control how many API requests you can make in a given time period. They ensure fair usage and system stability across the platform. When an agent drives the API through XMCP, the same limits apply - so build in caching and backoff.

Rate limits by product

Each X API product has its own rate-limiting approach:

ProductApproach
X API v2Per-endpoint limits based on 15-minute windows
Enterprise APICustom limits based on your enterprise agreement and data package
X Ads APILimits specific to ad management and analytics endpoints

How rate limits work

ConceptDescription
Time windowMost limits reset every 15 minutes
Per-user limitsApply when using OAuth 1.0a or OAuth 2.0 user tokens
Per-app limitsApply when using Bearer Token (app-only) authentication
Endpoint-specificEach endpoint has its own limit

Checking your limits

Every API response includes headers showing your current rate-limit status:

x-rate-limit-limit: 900
x-rate-limit-remaining: 847
x-rate-limit-reset: 1705420800
HeaderDescription
x-rate-limit-limitMaximum requests allowed in the current window
x-rate-limit-remainingRequests remaining in the current window
x-rate-limit-resetUnix timestamp when the limit resets

Rate-limit errors

When you exceed a limit, you receive a 429 Too Many Requests response:

json
{
  "errors": [{
    "code": 88,
    "message": "Rate limit exceeded"
  }]
}

Handling limits in an agent

flowchart TD
    Call[Tool call via XMCP] --> Resp{Status?}
    Resp -->|200| Use[Use data, cache it]
    Resp -->|429| Wait[Read x-rate-limit-reset]
    Wait --> Backoff[Wait, then retry with exponential backoff]
    Backoff --> Call

Best practices

  • Cache responses - store results locally to avoid repeated requests for the same data.
  • Use exponential backoff - when rate limited, wait before retrying and double the wait each time.
  • Check headers - monitor the rate-limit headers to avoid hitting limits proactively.
  • Use streaming for real-time - prefer the filtered stream over polling search endpoints for live data (note: streaming endpoints are not exposed through XMCP).

Agents amplify request volume

An autonomous agent can burn through a 15-minute window quickly in a loop. Allow-list only the tools it needs, cache aggressively, and honor x-rate-limit-reset.

See also