Appearance
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:
| Product | Approach |
|---|---|
| X API v2 | Per-endpoint limits based on 15-minute windows |
| Enterprise API | Custom limits based on your enterprise agreement and data package |
| X Ads API | Limits specific to ad management and analytics endpoints |
How rate limits work
| Concept | Description |
|---|---|
| Time window | Most limits reset every 15 minutes |
| Per-user limits | Apply when using OAuth 1.0a or OAuth 2.0 user tokens |
| Per-app limits | Apply when using Bearer Token (app-only) authentication |
| Endpoint-specific | Each 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| Header | Description |
|---|---|
x-rate-limit-limit | Maximum requests allowed in the current window |
x-rate-limit-remaining | Requests remaining in the current window |
x-rate-limit-reset | Unix 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 --> CallBest 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.