diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 5cd7ef38..9bae23a1 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -368,9 +368,10 @@ nav: - Swarms API Rust Client: "swarms_cloud/rust_client.md" - Pricing: - - Swarms API Pricing: "swarms_cloud/api_pricing.md" - - Swarms API Pricing in Chinese: "swarms_cloud/chinese_api_pricing.md" - - Swarms Cloud Subscription Tiers: "swarms_cloud/subscription_tiers.md" + - Pricing: "swarms_cloud/api_pricing.md" + - Pricing in Chinese: "swarms_cloud/chinese_api_pricing.md" + - Subscription Tiers: "swarms_cloud/subscription_tiers.md" + - Rate Limits: "swarms_cloud/rate_limits.md" - Guides: - Swarms API Best Practices: "swarms_cloud/best_practices.md" diff --git a/docs/swarms_cloud/rate_limits.md b/docs/swarms_cloud/rate_limits.md new file mode 100644 index 00000000..d0fb9759 --- /dev/null +++ b/docs/swarms_cloud/rate_limits.md @@ -0,0 +1,59 @@ +# Swarms API Rate Limits + +The Swarms API implements rate limiting to ensure fair usage and system stability. Here are the current limits: + +## Standard Rate Limits + +- **General API Requests**: 100 requests per minute +- **Batch Operations**: Maximum 10 requests per batch for agent/swarm batch operations + +## Rate Limit Response + +When you exceed the rate limit, the API will return a 429 (Too Many Requests) status code with the following message: +```json +{ + "detail": "Rate limit exceeded. Please try again later." +} +``` + +## Batch Operation Limits + +For batch operations (`/v1/agent/batch/completions` and `/v1/swarm/batch/completions`): + +- Maximum 10 concurrent requests per batch + +- Exceeding this limit will result in a 400 (Bad Request) error + +## Increasing Your Rate Limits + +Need higher rate limits for your application? You can increase your limits by subscribing to a higher tier plan at [swarms.world/pricing](https://swarms.world/pricing). + +Higher tier plans offer: + +- Increased rate limits + +- Higher batch operation limits + +- Priority processing + +- Dedicated support + +## Best Practices + +To make the most of your rate limits: + +1. Implement proper error handling for rate limit responses + +2. Use batch operations when processing multiple requests + +3. Add appropriate retry logic with exponential backoff + +4. Monitor your API usage to stay within limits + +## Rate Limit Headers + +The API does not currently expose rate limit headers. We recommend implementing your own request tracking to stay within the limits. + +--- + +For questions about rate limits or to request a custom plan for higher limits, please contact our support team or visit [swarms.world/pricing](https://swarms.world/pricing). \ No newline at end of file