const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.decart.ai/v1/realtime/quota', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.decart.ai/v1/realtime/quota"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://api.decart.ai/v1/realtime/quota")
.header("x-api-key", "<api-key>")
.asString();val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.decart.ai/v1/realtime/quota")
.get()
.addHeader("x-api-key", "<api-key>")
.build()
val response = client.newCall(request).execute()import Foundation
let url = URL(string: "https://api.decart.ai/v1/realtime/quota")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["x-api-key": "<api-key>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))curl --request GET \
--url https://api.decart.ai/v1/realtime/quota \
--header 'x-api-key: <api-key>'{
"limit": 123,
"active": 123,
"remaining": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get Realtime Quota
Current concurrent realtime session quota state for the authenticated account.
For org-scoped keys the count is org-wide (shared across the org’s keys/users).
active is a live counter, not a periodic aggregate: a session is counted the moment its connection is authenticated and released the moment it closes, so a read reflects a connect or disconnect within about a second. If one of our gateway instances crashes mid-session, its sessions can stay counted for up to 45 seconds before they expire.
Use this endpoint for coarse pre-flight checks and dashboards: poll at most once per second and stay under 10 requests per second per API key. remaining is advisory, since other sessions can start between your read and your connect, so always handle the connect-time rejection (WebSocket close code 1013, “Concurrent session limit reached.”).
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.decart.ai/v1/realtime/quota', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.decart.ai/v1/realtime/quota"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://api.decart.ai/v1/realtime/quota")
.header("x-api-key", "<api-key>")
.asString();val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.decart.ai/v1/realtime/quota")
.get()
.addHeader("x-api-key", "<api-key>")
.build()
val response = client.newCall(request).execute()import Foundation
let url = URL(string: "https://api.decart.ai/v1/realtime/quota")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["x-api-key": "<api-key>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))curl --request GET \
--url https://api.decart.ai/v1/realtime/quota \
--header 'x-api-key: <api-key>'{
"limit": 123,
"active": 123,
"remaining": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
API key for authentication
Response
Successful Response
Configured concurrent-session cap. null means the account has no limit.
Live concurrent sessions. null when the account has no limit or the counter is temporarily unavailable; treat it as unknown and attempt the connect.
limit - active, floored at 0. null whenever active is null.
Was this page helpful?