दर सीमाएँ
आपके संगठन पर उसके account level के आधार पर requests-per-minute सीमाएँ सेट हैं। ये संगठन के हर API key के साथ साझा की जाती हैं और एक मिनट की sliding window में गिनी जाती हैं। Upstream model providers भी अपने 429 Too Many Requests responses लौटा सकते हैं।
account level के अनुसार डिफ़ॉल्ट सीमाएँ
आपका level आपके सबसे बड़े एकल paid top-up के आधार पर सेट होता है, जैसा कि Concurrency limits में वर्णित है।
| Level | Single top-up | LLM requests / min | Image requests / min | Free models / min |
|---|---|---|---|---|
| Bronze | Default | 120 | 20 | 30 |
| Silver | $10 or more | 600 | 60 | 60 |
| Gold | $100 or more | 2,000 | 300 | 200 |
| Platinum | $500 or more | 5,000 | 1,000 | 500 |
| Diamond | Contact sales | Custom | Custom | Custom |
- LLM requests
POST /v1/chat/completions,POST /v1/responses,POST /v1/messages, और GeminigenerateContentतथाstreamGenerateContentendpoints को count करती हैं, जिसमें GeminigenerateContentके माध्यम से बुलाए गए image models भी शामिल हैं। - Image requests
POST /v1/run,POST /v1/chat/completions, और OpenAI Images endpoints (/v1/images/generations,/v1/images/edits) के माध्यम से सबमिट किए गए image models को count करती हैं। Chat Completions के माध्यम से बुलाया गया image model LLM और image limit दोनों में count होता है। GeminigenerateContentके माध्यम से बुलाए गए image models केवल LLM limit में count होते हैं। - Free models वे models हैं जिनका ID
:freeपर समाप्त होता है, जैसेdeepseek/deepseek-v4.1-flash:free। इन्हें LLM limit से अलग count किया जाता है, और दोनों लागू होते हैं। उसी ID वाला paid model, जिसमें से:freeहटा दिया गया हो, पर कोई free-model limit नहीं होती। - Diamond limits आपके workload के लिए SandBase sales के साथ सेट की जाती हैं। Platinum limits से अधिक के लिए Contact sales करें।
- SandBase द्वारा आपके संगठन के लिए सेट की गई limit डिफ़ॉल्ट LLM limit को, चाहे वह अधिक हो या कम, बदल देती है। यह
POST /v1/run,POST /v1/upload,POST /v1beta/interactions, और Volcengine तथा Tripo compatible task endpoints पर भी लागू होती है, जिनकी कोई डिफ़ॉल्ट LLM limit नहीं होती। संगठन का हर API key उन्हीं limits में count होता है, इसलिए और keys बनाने से वे नहीं बढ़तीं। - यदि आपके workload को अधिक limit की आवश्यकता है, तो संगठन, application, अपेक्षित steady rate, और अपेक्षित burst rate के साथ SandBase support से संपर्क करें।
GET /v1/run/{id}जैसे polling endpoints count नहीं किए जाते।
429 response को संभालें
Platform-generated /v1/* rate-limit responses एक flat error body का उपयोग करते हैं:
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
{"error":"organization rate limit exceeded"}Image और free-model limits एक ऐसा message लौटाते हैं जो Image rate limit reached या Free model rate limit reached से शुरू होता है और limit, उसे बढ़ाने वाला top-up, तथा (free models के लिए) स्विच करने के लिए paid model का नाम बताता है। Protocol-compatible endpoints अपने own error envelope में वही 429 लौटाते हैं, जैसे Anthropic या Google error shape। Provider-originated response compatible endpoint के error shape का उपयोग कर सकता है और provider rate-limit headers शामिल कर सकता है।
Retry-After और remaining-quota headers की गारंटी नहीं है। यदि Retry-After मौजूद हो, तो उसका पालन करें। अन्यथा, jitter के साथ exponential backoff और एक maximum attempt count का उपयोग करें।
import os
import random
import time
from openai import OpenAI, RateLimitError
client = OpenAI(
base_url="https://api.sandbase.ai/v1",
api_key=os.environ["SANDBASE_API_KEY"],
max_retries=0,
)
def create_with_backoff(**request):
for attempt in range(5):
try:
return client.chat.completions.create(**request)
except RateLimitError:
if attempt == 4:
raise
delay = min(2 ** attempt, 30) + random.random()
time.sleep(delay)OpenAI SDK max_retries के माध्यम से built-in retries का भी समर्थन करता है। SDK retries या application retry loop में से किसी एक को जानबूझकर चुनें ताकि retries layers के बीच multiply न हों।
केवल safe operations को retry करें
एक repeated inference request दूसरी generation बना सकती है और अतिरिक्त cost लगा सकती है। इसे केवल तब retry करें जब आपका application regeneration स्वीकार करता हो। किसी state-changing request को automatically retry न करें, जब तक कि operation idempotency document न करता हो या आपका application यह साबित न कर सके कि पहला attempt सफल नहीं हुआ था।
Streaming requests के लिए, 429 सामान्यतः stream शुरू होने से पहले आता है। एक बार bytes आ जाने के बाद, disconnect को rate-limit error मानने के बजाय interrupted generation मानें। Partial output को अपने product requirements के अनुसार preserve या discard करें; फिर से शुरू करने पर नई generation बनती है।
Throughput नियंत्रित करें
- एक unbounded batch को एक साथ छोड़ने के बजाय concurrency को सीमित करें।
- Bursty work को queue करें और send rate को smooth करें।
- Duplicate requests से बचें और privacy तथा freshness requirements अनुमति दें तो reusable results को cache करें।
- Ownership, spending controls, और revocation के लिए अलग keys का उपयोग करें—not platform limits को bypass करने के लिए।
- Troubleshooting के लिए endpoint, model, HTTP status, और sanitized error body रिकॉर्ड करें।
- जब किसी workload को उसके account level से अधिक limit की आवश्यकता हो, तो SandBase support से संपर्क करें।
import asyncio
semaphore = asyncio.Semaphore(8)
async def run_one(client, prompt):
async with semaphore:
return await client.chat.completions.create(
model="deepseek/deepseek-v4-flash",
messages=[{"role": "user", "content": prompt}],
)Concurrency requests per minute के समान नहीं है। Observed latency और आपके account level की limits के विरुद्ध दोनों को tune करें।
दैनिक free API calls
संगठन की प्रति UTC day 100 free data API calls एक billing allowance हैं, rate limit नहीं। इनके beyond calls reject होने के बजाय प्रति call billed होते हैं। देखें Daily free API calls।
Concurrency
Task submissions भी इस बात से सीमित हैं कि आपका संगठन एक समय में कितने tasks चला सकता है, उसके account level के आधार पर: Bronze और Silver पर POST /v1/run और /v1/api/* पर हर model type, तथा हर endpoint पर video tasks। वह 429 organization concurrency limit exceeded कहता है और जब कोई running task समाप्त होती है तब clear होता है, timer पर नहीं। देखें Concurrency limits।