4 Production Batch Monitoring Presets
1 Workload Quota & Cadence Parameters
500 calls / run/v1/finance/tradingview/quotes)/v1/finance/tradingview/quotes, 500 symbols would amortize to 300 calls/mo (600 cr/mo at 2 cr/call).
2 Concurrency Slots, Latency & Payload Compression
10 slots · 850 msmode="summary" Payload Compression (Recommended)"mode": "summary" into generated Python & TypeScript templates.
3 Monthly Quota Burn & Best-Value Tier
Best Value: Credit Pack ($47 Once)4 All 4 EdgeData Pricing Tiers — Live Cost, $/1K Rate & Headroom Breakdown
| EdgeData Tier | Included Quota & SLA | Monthly Equiv. Cost | Effective $/1K Credits | Headroom / Overflow Plan |
|---|---|---|---|---|
| Free ($0/mo) | 100 credits / mo · Sandbox | Exceeds 100 cr/mo | N/A | Short by 14,900 cr/mo — use for PoC & schema validation only |
| Credit Pack ($47 Once)Best Value | 25,000 never-expiring credits | $28.20 / mo equiv | $1.88 / 1K cr | Covers 1.67 months ($47 upfront · 10,000 cr rollover after mo 1) |
| Pro ($49/mo) | 15,000 credits / mo · 60 RPM | $49.00 / mo | $3.27 / 1K cr | Exact 15,000 cr/mo fit (0 cr surplus · predictable monthly billing) |
| Scale ($149/mo) | 60,000 credits / mo · 200 RPM | $149.00 / mo | $9.93 / 1K eff. ($2.48/1K at 60k) | 45,000 cr/mo headroom · 200 RPM high-concurrency priority |
import asyncio
import os
import random
from typing import Any
import httpx
# EdgeData Batch Concurrency Worker (Preset: Amazon / Walmart 500 SKU Daily Pricing)
# Gateway: https://api.upp3.com/v1/amazon/products/detail
# Pricing guard: EdgeData HTTP 504/429 strictly charges 0 credits.
EDGEDATA_API_KEY = os.getenv("EDGEDATA_API_KEY", "ed_live_your_key_here")
API_ENDPOINT = "https://api.upp3.com/v1/amazon/products/detail"
TARGET_COUNT = 500
CONCURRENCY = 10
RESPONSE_MODE = "summary" # -81.3% avg LLM input token reduction
MAX_RETRIES = 4
RETRYABLE_STATUS_CODES = {429, 504}
async def run_target_with_backoff(
client: httpx.AsyncClient,
sem: asyncio.Semaphore,
target_id: str,
) -> dict[str, Any]:
payload = {
"asin": target_id,
"country": "US",
"mode": RESPONSE_MODE,
}
headers = {
"X-API-Key": EDGEDATA_API_KEY,
"Content-Type": "application/json",
}
async with sem:
for attempt in range(1, MAX_RETRIES + 1):
resp = await client.post(API_ENDPOINT, json=payload, headers=headers)
if resp.status_code == 200:
return resp.json()
if resp.status_code in RETRYABLE_STATUS_CODES and attempt < MAX_RETRIES:
# EdgeData HTTP 504/429 strictly charges 0 credits — safe exponential backoff
delay = (0.75 * (2 ** (attempt - 1))) + random.uniform(0.05, 0.35)
await asyncio.sleep(delay)
continue
resp.raise_for_status()
raise RuntimeError(f"Exhausted retries for target={target_id}")
async def run_batch_monitor() -> list[dict[str, Any]]:
targets = [f"B0DEMO{idx:04d}" for idx in range(1, TARGET_COUNT + 1)]
sem = asyncio.Semaphore(CONCURRENCY)
limits = httpx.Limits(max_connections=CONCURRENCY + 4, max_keepalive_connections=CONCURRENCY)
async with httpx.AsyncClient(timeout=30.0, limits=limits) as client:
tasks = [run_target_with_backoff(client, sem, item) for item in targets]
return await asyncio.gather(*tasks)
if __name__ == "__main__":
results = asyncio.run(run_batch_monitor())
print(f"Completed {len(results)} targets with CONCURRENCY={CONCURRENCY}, mode={RESPONSE_MODE}")