Infrastructure

Rate Limits

High-throughput APIs built for autonomous agents. Purple Flea enforces per-minute and per-day limits by tier, with burst headroom and sensible per-endpoint caps for integrity-sensitive operations.

Rate Limit Tiers

All new registrations start on the Free tier. Limits apply per API key across all endpoints unless otherwise noted.

Tier Requests / min Requests / day Notes
Free 100 10,000 Default for all new API keys
Pro 1,000 1,000,000 Contact hello@purpleflea.com
Enterprise Unlimited Unlimited SLA available, dedicated infrastructure

Counting: Every HTTP request counts against your limit regardless of outcome — including 400, 401, and 404 responses. Failed requests still consume quota.

Per-Endpoint Limits

Some endpoints carry additional per-minute caps independent of your tier limit. These apply on top of the tier ceiling — whichever limit is lower takes precedence.

Endpoint Hard Cap (req/min) Reason
Casino /play 60 Game integrity — one bet per second max
Trading /positions 300 Order book access, risk management polling
Wallet /swap 120 DEX aggregator upstream limits
All /register endpoints 10 Anti-spam, account creation throttle

/register endpoints are IP-limited, not key-limited. The 10 req/min cap applies per originating IP address, even if the requests use different API keys. This is intentional anti-abuse behavior that cannot be bypassed with Pro or Enterprise tiers.

Burst Allowance

Purple Flea allows short traffic spikes using a token bucket algorithm. You may exceed your per-minute limit by up to 3x for a 10-second burst window before requests are rate-limited.

Tier Sustained (req/min) Burst Peak (req/10s) Burst Multiplier
Free 100 50 3x for 10s
Pro 1,000 500 3x for 10s
Enterprise Unlimited Unlimited

After a burst window, the bucket refills at the sustained rate. Burst is useful for initialization sequences (fetching market state on startup) but should not be relied upon for steady-state operation.

Rate Limit Headers

Every API response includes rate limit state in the following headers. Agents should read these on every response to avoid hitting limits.

Header Type Description
X-RateLimit-Limit integer Maximum requests allowed in the current window
X-RateLimit-Remaining integer Requests remaining in the current window
X-RateLimit-Reset unix timestamp UTC timestamp when the current window resets
Retry-After integer Seconds to wait before retrying (only on 429 responses)
HTTP/1.1 200 OK X-RateLimit-Limit: 100 X-RateLimit-Remaining: 73 X-RateLimit-Reset: 1735689600 Content-Type: application/json

429 Response Format

When a rate limit is exceeded, the API returns HTTP 429 with a JSON body describing the limit that was hit and when to retry.

HTTP/1.1 429 Too Many Requests Retry-After: 14 X-RateLimit-Limit: 100 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 1735689614 Content-Type: application/json { "error": "rate_limit_exceeded", "message": "Too many requests. You have exceeded the 100 req/min limit for your tier.", "limit": 100, "window": "1m", "retry_after_seconds": 14, "reset_at": "2025-12-31T12:00:14Z", "tier": "free", "upgrade_url": "https://purpleflea.com/pricing" }

Always use Retry-After. Do not hardcode sleep durations. The Retry-After header gives the exact number of seconds until your window resets. Use it directly in your backoff logic.

Best Practices for Agents

Autonomous agents that run continuously need to be rate-limit-aware by design, not as an afterthought. The following patterns keep agents within limits without sacrificing responsiveness.

1
Use exponential backoff on 429s
When you receive a 429, wait Retry-After seconds before retrying. If you receive consecutive 429s, multiply the wait by 2 each time (capped at 60s). Do not retry immediately.
2
Cache market data aggressively
Poll GET /v1/markets at most every 5 seconds. Market data changes rarely enough that sub-second polling wastes quota with no benefit. Store the last response in memory and serve it locally between polls.
3
Batch operations where possible
Fetch multiple positions, balances, or history entries in a single paginated call rather than one call per item. Use limit query parameters to retrieve up to 100 records at once.
4
Track X-RateLimit-Remaining proactively
If X-RateLimit-Remaining drops below 10, introduce a short sleep before the next request rather than waiting for a 429. Pre-emptive throttling prevents errors entirely.
5
Do not use burst for polling loops
Burst headroom is intended for initialization sequences and occasional spikes. Running a polling loop at burst speed will exhaust the burst budget immediately and then hit sustained limits.

Python: Rate-Limit-Aware Request Handler

Drop-in wrapper that handles 429 responses with exponential backoff, reads Retry-After, and pre-emptively slows down when remaining quota is low.

Upgrading Your Tier

The Free tier is sufficient for development, testing, and low-frequency agents. For agents running at production scale, Pro or Enterprise tiers remove practical limits.

Tier How to Activate Turnaround
Free Default on registration — no action required Instant
Pro Email hello@purpleflea.com with your API key Within 24 hours
Enterprise Email hello@purpleflea.com with your use case and expected volume Within 48 hours

Enterprise SLA includes: Dedicated rate limit pools, priority support, custom per-endpoint caps, and uptime SLA commitments. Suitable for agent fleets generating consistent high-volume traffic across all APIs.

To upgrade, email hello@purpleflea.com with your API key and a brief description of your agent's use case. Tier upgrades are applied to the API key within the stated turnaround time. No payment processor or dashboard is required — upgrades are handled manually.