Rate Limits
Each plan has a per-second rate limit on API requests:
| Plan | Rate Limit |
|---|
| Free | 5 requests/second |
| Growth | 300 requests/second |
| Enterprise | Custom — contact our team |
Requests that exceed your rate limit will be rejected. If you consistently hit your rate limit, consider optimizing your usage or upgrading your plan.
How Requests Are Counted
Every interaction with the Codex API counts against your plan’s monthly request limit. Here’s how each type of interaction is measured:
| Interaction | What counts as 1 request |
|---|
| Query | Each time you execute a query (HTTP request) |
| Subscription | Each message the subscription sends you |
| Webhook | Each webhook delivery to your endpoint |
Subscriptions can generate a high volume of requests depending on what you’re subscribed to. For example, subscribing to trade events on a high-volume token could produce thousands of messages per hour — each one counts as a request.
Overages
If you exceed your plan’s monthly request limit, overages are charged at your plan’s price per million requests. For example, if you’re on a 1M request Growth plan and you use 1.5M requests, you’ll be charged for an additional 500K requests at the same per-million rate.
For high-volume usage (10M+ requests/month), contact us on Discord or via email for custom plan pricing with volume discounts.
WebSocket Connection Limits
WebSocket connections are the transport layer for subscriptions. Each connection can carry multiple subscriptions.
| Plan | Connection Limit |
|---|
| Growth | 300 connections |
| Enterprise | Soft limit — contact our team for your specific needs |
Connection limits are per API key. Each connection can handle multiple subscriptions (we recommend ~25 per connection), so the connection limit is rarely a bottleneck.
Subscriptions Per Connection
There is no hard limit on subscriptions per connection, but we recommend ~25 subscriptions per connection for reliable performance. The actual capacity depends on:
- Throughput — subscribing to
onTokenEventsCreated for SOL generates far more messages than a low-volume token
- Number of tokens per subscription —
onPricesUpdated supports up to 25 tokens per subscription, and you can have multiple subscriptions on the same connection
- Network capacity — your internet connection and proximity to Western US affect throughput
- Subscription type — low-throughput subscriptions (e.g. metadata updates) can handle 100+ per connection
For high-volume subscriptions like launchpad events, consider using dedicated connections.
Reducing Usage
For best practices on batching requests, caching, managing subscription lifecycle, and other ways to minimize your request count, see Optimization.
Deactivating an API key does not automatically close active WebSocket connections. You must explicitly close your connections or they will continue to consume requests until they disconnect.