Rate Limits, Credits & Atomic Billing
Understand request concurrency limits, HTTP 429 backoff strategies, and our atomic pre-authorization credit lock architecture.
Direct System Definition: Rate Limits & Credits
RSFlowHub operates on a high-throughput, Pay-As-You-Go (PAYG) credit model with no restrictive subscription lock-in. Default accounts are allocated 60 requests per minute per endpoint key. Billing is governed by atomic pre-authorization locks: the gateway verifies base credits before invoking AI models, ensuring zero charges if a request fails parameter validation (422) or malformed syntax (400).
Rate Limits & Concurrency Thresholds
To protect platform infrastructure and maintain consistent sub-150ms latency across all tenants, rate limits are enforced on a per-endpoint basis using in-memory token bucket tracking.
| Account Tier | Standard Rate Limit | Burst Concurrency | Over-Limit Behavior |
|---|---|---|---|
| Developer / Standard | 60 requests / minute (per endpoint) | 10 concurrent requests | Returns HTTP 429 rate_limit_exceeded |
| High-Volume / Enterprise | Custom (e.g., 500 to 2,000+ RPM) | Dedicated worker pool | Custom SLA + Priority Queue |
Handling 429 Responses with Exponential Backoff & Jitter
When rate limits are exceeded, RSFlowHub returns an HTTP 429 status with a Retry-After response header indicating the mandatory wait time in seconds. In high-throughput distributed architectures, retries must include randomized jitter to prevent the "thundering herd" problem:
import time
import random
import requests
def call_rsflowhub_with_retry(url, headers, payload, max_retries=4, base_delay=1.0, max_delay=16.0):
for attempt in range(max_retries):
response = requests.post(url, headers=headers, json=payload, timeout=5.0)
if response.status_code != 429:
return response
# Inspect Retry-After header or calculate exponential backoff with full jitter
retry_after = response.headers.get("Retry-After")
if retry_after and retry_after.isdigit():
sleep_duration = float(retry_after)
else:
# Full jitter formula: random.uniform(0, min(max_delay, base_delay * 2 ** attempt))
sleep_duration = random.uniform(0, min(max_delay, base_delay * (2 ** attempt)))
time.sleep(sleep_duration)
raise Exception("Max retries exceeded for RSFlowHub API")
Atomic Credit Pre-Authorization & Billing Flow
RSFlowHub uses an atomic 3-Phase Pre-Authorization Lock lifecycle to guarantee that developers are charged only for valid computations down to the exact token count:
1. Pre-Flight Lock
Before model invocation, the gateway checks that your wallet contains at least the base_credits for that endpoint. If balance < base, an immediate 402 insufficient_credits is returned.
2. Model Processing
The specialized neural network or LLM processes the input payload. If schema validation fails (422) or upstream connection drops (500), the pre-auth lock is released with zero deductions.
3. Atomic Deduction
Upon generation completion, the total charge is calculated (Base Credit + Character Processing Credit) and settled via an atomic decrement. Your live balance updates in real-time.
4. Zero Latency Impact
Credit settlements occur asynchronously through high-performance in-memory cache locks, delivering instant API responses without waiting for relational database locks.
Processing Cost Calculation
Because heavier natural language processing requires increased compute power, an incremental Processing Cost is added based on input character volume:
| Input Character Length | Processing Tier | Additional Credits Charged |
|---|---|---|
| Up to 500 characters | Small | +1 Credit |
| 501 to 2,000 characters | Medium | +2 Credits |
| 2,001 to 5,000 characters | Large | +4 Credits |
| 5,001+ characters | Extra Large | +4 Credits plus +1 Credit per 1,000 additional characters |
If you invoke an endpoint with a Base Credit of 2 and send a prompt of 1,400 characters (Medium tier):
Total Deducted = Base (2) + Processing (2) = 4 Credits.
Endpoint Base Credits Reference
| Category | API Endpoint | Base Credits (Pre-Flight) |
|---|---|---|
| Text & Language | /api/v1/ai/intent-detection |
1 Credit |
| Text & Language | /api/v1/ai/translation |
1 Credit |
| Conversational AI | /api/v1/ai/chat |
1 Credit |
/api/v1/ai/email-reply |
2 Credits | |
| Content Generation | /api/v1/ai/content-generation |
2 Credits |
| Image & Vision | /api/v1/ai/image-generation |
5 Credits |
| Account & Usage | /api/v1/account/usage |
0 Credit |
| Account & Usage | /api/v1/account/usage-summary |
0 Credit |
| Account & Usage | /api/v1/account/api-key/current |
0 Credit |
| Data & Extraction | /api/v1/ai/json-extractor |
2 Credits |
/api/v1/ai/email-analyze |
2 Credits | |
/api/v1/ai/email-workflow |
2 Credits | |
| Text & Language | /api/v1/ai/sentiment-analysis |
1 Credit |
| Safety & Moderation | /api/v1/ai/spam-detection |
2 Credits |
| Text & Language | /api/v1/ai/text-summarize |
1 Credit |
| Text & Language | /api/v1/ai/grammar-fix |
1 Credit |
| Safety & Moderation | /api/v1/ai/pii-redaction |
1 Credit |
| FAQ & Knowledge Base | /api/v1/ai/faq-collections |
0 Credit |
| FAQ & Knowledge Base | /api/v1/ai/faq-match |
2 Credits |
| Reviews | /api/v1/ai/review-analyze |
3 Credits |
| Reviews | /api/v1/ai/review-summary |
3 Credits |
| Reviews | /api/v1/ai/review-reply |
2 Credits |
| Reviews | /api/v1/ai/review-insights |
4 Credits |
| Social & Comments | /api/v1/ai/comment-analyze |
2 Credits |
| Social & Comments | /api/v1/ai/comment-reply |
2 Credits |
| Social & Comments | /api/v1/ai/comment-moderate |
3 Credits |
| Customer Support | /api/v1/ai/ticket-analyze |
3 Credits |
| Customer Support | /api/v1/ai/ticket-reply |
2 Credits |
| Customer Support | /api/v1/ai/ticket-workflow |
3 Credits |
| Data & Extraction | /api/v1/ai/search-query-parse |
3 Credits |
| Conversational AI | /api/v1/knowledge-bases |
1 Credit |
| Conversational AI | /api/v1/chatbots |
4 Credits |