Developer & API Docs Checking edge API…

Stream verified debates in one HTTP call.

POST a question and source document to /api/debate. Receive structured NDJSON events with server-verified UTF-16 quote offsets, SHA-256 digests, rebuttals, and a calibrated verdict.

01 / Quickstart

Five-line integration.

Works with standard HTTP streaming, our zero-dependency Python client, or browser fetch. Every quote hash can be re-checked offline.

curl -N -sS -X POST https://bedirsavasi.com/api/debate \
  -H "content-type: application/json" \
  -d '{
    "lang": "en",
    "question": "Can the tenant end the lease early without paying the penalty?",
    "document": "Clause 7.2 ... Clause 12.1 ... Clause 15.3 ... (min 200 chars)"
  }'
02 / Live Console

Test the live edge endpoint.

Ping /api/health or fire a real streaming POST /api/debate request right from your browser and inspect every raw NDJSON frame as it arrives.

POST https://bedirsavasi.com/api/debate · NDJSON
Request payload (JSON)
{
  "lang": "en",
  "question": "Can the tenant end the lease early without paying the penalty?",
  "document": "COMMERCIAL LEASE EXTRACT (synthetic). Clause 7.1: Landlord keeps the roof in good repair. Clause 7.2: If a roof defect makes part of the Premises unusable and Landlord fails to repair within 30 days of written notice, Tenant may terminate without penalty. Clause 12.1: Early termination otherwise incurs 3 months' rent. Clause 15.3: Termination notice must be delivered by registered mail or by hand. File notes: 5 June written notice emailed; 2 July roof still leaks; 14 July surveyor confirms active leaks; 20 July Tenant emails termination with no registered mail on file."
}
Ready · zero payload retention
Live response stream
// Click 'Ping GET /api/health' or 'Send live POST /api/debate' to inspect raw output.
03 / Reference

Endpoints & event schema.

All API responses use UTF-8 JSON or NDJSON with no-store cache headers and open CORS for quick prototyping.

POST /api/debate

Runs the full 4-phase adversarial protocol (FOR/AGAINST openings, deterministic quote-hash gate, cross-examination rebuttals, blind judge verdict) and streams NDJSON events.

application/x-ndjson · 12 req/day/IP
GET /api/health

Returns edge runtime status, API version, active debater and judge model IDs, supported languages, and input limits.

application/json · no rate limit
POST /api/waitlist

Registers an email and role for API keys, design-partner pilots, or compute collaboration inquiries.

application/json · 10 req/day/IP

NDJSON stream events

startEmitted immediately with remaining daily quota and active debater/judge model identifiers.
sidesParallel FOR and AGAINST theses and claims, each annotated with verified (bool), UTF-16 start/end offsets and sha256.
rebuttalsTargeted cross-examination responses attacking the opponent's weakest verified claim, independently quote-checked.
verdictCalibrated probability p_for (0–100), two-sentence verdict, up to 3 cruxes, and the flip condition from the blind judge.
doneSummary telemetry: verified quote count, total quotes checked, elapsed ms, and remaining quota.
errorStructured error code if an upstream model or rate limit interrupts the stream.

Validation & limits

Question length8 to 300 characters (UTF-8)
Document length200 to 12,000 characters (40 KB max body)
Languagesen, tr, de (defaults to en)
Public demo quota12 debates / day per hashed IP (HTTP 429 when exceeded)
Error codes400 bad_json · 413 too_large · 422 input · 429 daily_limit
Zero-trust client verification Every verified claim carries exact UTF-16 start/end indices and sha256(document.slice(start, end)). Clients re-hash locally via WebCrypto or bedir/verify.py so no application has to trust the server.