AGENT-01 // REFACTOR
AGENT-02 // MIGRATE
AGENT-03 // TEST-GEN
AGENT-04 // DEPLOY
CHAIRMAN LLM // JUDGE
SYSTEM // MONITOR
AGENT-05 // REVIEW
AGENT-06 // DOCS
AGENT-07 // SECURITY
AGENT-08 // PERF
SYSTEM // EVENT LOG
SYSTEM // TASK QUEUE
AGENT-09 // SCAFFOLD
AGENT-10 // TRANSLATE
AGENT-11 // ROLLBACK
SYSTEM // NETWORK
AGENT-12 // LINT-FIX
AGENT-13 // CANARY
AGENT-14 // SCHEMA
SYSTEM // HEARTBEAT
Blackbox AI

Agents
that never sleep.

Enterprise-grade AI agents with frontier and open-source model access.Ship faster with autonomous multi-agent execution through one API.

Teams at Fortune 500 companies that depend on BLACKBOX.AI

Deloitte
Microsoft
Intel
Accenture
IBM
Apple
Amazon
Salesforce
Google
Infosys
Oracle
Capgemini
GitHub
ByteDance
Cisco
PwC
SAP
Cognizant
Deloitte
Microsoft
Intel
Accenture
IBM
Apple
Amazon
Salesforce
Google
Infosys
Oracle
Capgemini
GitHub
ByteDance
Cisco
PwC
SAP
Cognizant
Chairman LLM

Run Agents in Parallel.

Dispatch the same task to multiple AI agents, then let Chairman LLM evaluate every candidate on correctness, performance, risk, and complexity. Best output wins.

Task

Implement rate limiting middleware with Redis backend for the API gateway

Claude Codewinner

I'll use a sliding window algorithm with Redis MULTI/EXEC for atomicity. The middleware checks req count per IP in a 60s window, returns 429 when exceeded.

Codex

Implementing token bucket via Redis INCR + EXPIRE. Each request decrements the bucket; refill rate is configurable per route. Includes retry-after header.

Gemini

I recommend a distributed rate limiter using Redis sorted sets for precise sliding windows. Supports per-user and per-endpoint limits with graceful degradation.

Winner Selected

claude code

confidence: 0.94

TESTS: 46/46correctness: 0.97
PR #218 opened
src/middleware/rate-limit.ts+47 -12
src/config/redis.ts+18 -3
tests/rate-limit.test.ts+94 -0
3 files changed+159 -15

Parallel Dispatch

Same task, multiple agents. Blackbox, Claude Code, Codex, and Gemini work simultaneously — each producing an independent solution.

Weighted Evaluation

Chairman LLM scores every candidate across correctness, performance, risk, and complexity — fully configurable per task.

Ship Automatically

The winning solution is packaged into a PR with test results, evaluation breakdown, and diff — ready to merge in one click.

Multi-Harness

Every agent harness. One platform.

Claude Code, Codex, Gemini — access every coding agent through a single API. Compare harnesses side by side and ship the best result.

src/middleware/rate-limiter.ts+35-8
1 import { Redis } from '@upstash/redis';
2 import type { NextRequest } from 'next/server';
3
4-const RATE_LIMIT = 100;
5-const WINDOW_MS = 60_000;
6+interface SlidingWindowConfig {
7+ maxRequests: number;
8+ windowMs: number;
9+ keyPrefix?: string;
10+}
11+
12+const DEFAULT_CONFIG: SlidingWindowConfig = {
13+ maxRequests: 100,
14+ windowMs: 60_000,
15+ keyPrefix: 'rl:sw',
16+};
17
18-export async function rateLimit(req) {
19- const ip = req.headers.get('x-forwarded-for');
20- const count = await redis.incr(ip);
21- if (count === 1) await redis.expire(ip, 60);
22- return count <= RATE_LIMIT;
23-}
24+export async function rateLimit(
25+ req: NextRequest,
26+ config = DEFAULT_CONFIG
27+) {
28+ const ip = req.headers.get('x-forwarded-for') ?? '127.0.0.1';
29+ const now = Date.now();
30+ const windowStart = now - config.windowMs;
31+ const key = `${config.keyPrefix}:${ip}`;
32+
33+ // Atomic sliding window via MULTI
34+ const pipeline = redis.multi();
35+ pipeline.zremrangebyscore(key, 0, windowStart);
36+ pipeline.zadd(key, { score: now, member: crypto.randomUUID() });
37+ pipeline.zcard(key);
38+ pipeline.expire(key, Math.ceil(config.windowMs / 1000));
39+ const results = await pipeline.exec();
40+
41+ const count = results[2] as number;
42+ return {
43+ allowed: count <= config.maxRequests,
44+ remaining: Math.max(0, config.maxRequests - count),
45+ resetAt: now + config.windowMs,
46+ };
47+}

Start building with
BLACKBOX AI.

Multi-agent execution, AI-native IDE, CLI, API, and mobile — all free to start.