Get Rate Limits and Usage
curl --request GET \
--url https://api.swarms.world/v1/rate/limits \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.swarms.world/v1/rate/limits"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.swarms.world/v1/rate/limits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.swarms.world/v1/rate/limits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.swarms.world/v1/rate/limits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.swarms.world/v1/rate/limits")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swarms.world/v1/rate/limits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"rate_limits": {
"minute": {
"count": 123,
"limit": 123,
"exceeded": true,
"remaining": 123,
"reset_time": "<string>"
},
"hour": {
"count": 123,
"limit": 123,
"exceeded": true,
"remaining": 123,
"reset_time": "<string>"
},
"day": {
"count": 123,
"limit": 123,
"exceeded": true,
"remaining": 123,
"reset_time": "<string>"
}
},
"limits": {
"maximum_requests_per_minute": 123,
"maximum_requests_per_hour": 123,
"maximum_requests_per_day": 123,
"tokens_per_agent": 123
},
"tier": "<string>",
"timestamp": "<string>",
"success": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Rate Limiting
Get Rate Limits and Usage
Retrieve current rate limit status and usage statistics for the authenticated user across multiple time windows.
GET
/
v1
/
rate
/
limits
Get Rate Limits and Usage
curl --request GET \
--url https://api.swarms.world/v1/rate/limits \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.swarms.world/v1/rate/limits"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.swarms.world/v1/rate/limits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.swarms.world/v1/rate/limits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.swarms.world/v1/rate/limits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.swarms.world/v1/rate/limits")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swarms.world/v1/rate/limits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"rate_limits": {
"minute": {
"count": 123,
"limit": 123,
"exceeded": true,
"remaining": 123,
"reset_time": "<string>"
},
"hour": {
"count": 123,
"limit": 123,
"exceeded": true,
"remaining": 123,
"reset_time": "<string>"
},
"day": {
"count": 123,
"limit": 123,
"exceeded": true,
"remaining": 123,
"reset_time": "<string>"
}
},
"limits": {
"maximum_requests_per_minute": 123,
"maximum_requests_per_hour": 123,
"maximum_requests_per_day": 123,
"tokens_per_agent": 123
},
"tier": "<string>",
"timestamp": "<string>",
"success": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Response
Successful Response
Current rate limit usage information for different time windows.
Show child attributes
Show child attributes
The configured rate limits based on the user's subscription tier.
Show child attributes
Show child attributes
The user's current subscription tier (free or premium).
ISO timestamp when the rate limits information was retrieved.
Indicates whether the rate limits request was successful.
Was this page helpful?
⌘I