✓ ISO 9001:2015 · DORA Art. 30 · EU AI Act Article 50 Certified

Enterprise AI Gateway Documentation

Welcome to the authoritative engineering documentation of TopAI Platform. TopAI provides deterministic sub-30ms edge syscalls for autonomous AI agents, replacing expensive, error-prone probabilistic LLM parsing with mathematically verifiable algorithms across 330+ Anycast edge PoPs.

💡 The Architectural Paradigm: Prompts vs. Deterministic Edge Syscalls

Traditional AI agents waste 60% to 85% of their token budget and hundreds of milliseconds asking non-deterministic LLMs to perform purely mechanical tasks: extracting clean markdown from messy HTML, repairing JSON syntax, stripping AST bloat, or verifying SIREN / IBAN checksums.

❌ The Probabilistic LLM Trap:

• 800ms to 3,500ms TTFT latency
• $0.03 to $0.08 per call in token burn
• 3% to 7% hallucination rate on syntax

✅ The TopAI Edge Syscall Paradigm:

• 3.8ms worldwide P99 execution
• $0.0001 flat fee ($0.00 token burn)
• 100% mathematical zero-hallucination guarantee

⚡ Quickstart: Call Your First Micro-API in 60 Seconds

All micro-services are accessible over Anycast global edge at https://gateway.topaigateway.com/v1/api/{api_id}.

cURL · Clean Web Scraping [API-01]
curl -X POST "https://gateway.topaigateway.com/v1/api/01-web-to-markdown"   -H "Authorization: Bearer topai_live_YOUR_KEY"   -H "Content-Type: application/json"   -d '{"url": "https://docs.anthropic.com"}'
Python · 2 Lines
import requests

res = requests.post(
    "https://gateway.topaigateway.com/v1/api/01-web-to-markdown",
    headers={"Authorization": "Bearer topai_live_YOUR_KEY"},
    json={"url": "https://docs.anthropic.com"}
)
print(res.json()["cleaned_markdown"])

🔑 Authentication & DORA Audit Headers

Authentication is verified at the edge in sub-1ms using salted SHA-256 digests cached in Cloudflare KV. Supply your sovereign key in one of the following formats:

  • Authorization: Bearer topai_live_xxxxxxxx...
  • X-TopAI-Key: topai_live_xxxxxxxx...

Mandatory Telemetry Headers Returned

Every response returns audit headers satisfying European DORA Article 30 regulations:

HeaderTypeDescription
X-TopAI-Request-IDUUIDv4Unique immutable transaction hash.
X-TopAI-TenantStringAnonymized customer account identifier.
X-TopAI-PackStringActive tier (PACK1 to PACK4).
X-TopAI-Latency-Gateway-MsNumberSub-15ms edge inspection overhead.
X-RateLimit-RemainingIntegerRemaining requests in current 60s sliding window.

🛡️ RFC 7807 Deterministic Error Model

TopAI guarantees machine-parsable error payloads complying with RFC 7807 Problem Details for HTTP APIs. Autonomous agents never receive ambiguous HTML error pages.

RFC 7807 JSON Error Response
{
  "type": "https://topaigateway.com/errors/rate-limit-exceeded",
  "title": "Sliding Window Concurrency Exceeded",
  "status": 429,
  "detail": "Tenant throughput exceeded 600 req/min for Pack 2 Squad Velocity.",
  "instance": "urn:topai:trace:8f92a10b",
  "retry_after_seconds": 2
}
Status CodeReasonAgent Behavior
400 Bad RequestMalformed input payload or schema failure.Block execution, do not retry without payload fix.
401 UnauthorizedMissing or revoked API Key.Alert developer, refresh key in portal.
403 Quota ExceededMonthly quota consumed.Upgrade Pack tier via Customer Portal.
429 Too Many RequestsSliding window rate limit reached.Backoff for retry_after_seconds.
502 Upstream DownTarget website unreachable (anti-bot / timeout).Fallback to semantic cache or mirror.

🏛️ The Architecture Triad: Kernel, Harness & Apex

TopAI is engineered around three deterministic layers designed to eradicate probabilistic failure:

1. TopAI Kernel (Edge Cloudflare V8 Isolates)

The sub-30ms execution gateway running across 330+ Anycast PoPs. Houses multi-tenant authentication, sliding-window rate limiters, salted cryptographic audit trails, and zero-token caching.

2. Harness Tools ([H-01] to [H-169])

169 specialized algorithmic tooling wrappers that run locally in the developer's CLI or CI/CD pipelines (AST strip, token compressors, loop breakers).

3. Apex Engine (Zero-Taint Verification)

Mathematical invariants ensuring input validation, SSRF DNS-rebinding prevention, and zero civilian PII retention.

📦 The 4 Cumulative Nested Packs (Poupées Russes)

TopAI uses a cumulative nested model: every higher pack strictly includes 100% of all micro-services from lower packs. Zero billing surprises.

101 Micro-APIs

PACK 1 : DevEx & FinOps Hub

Drastic context token trimming, AST minification, clean web-to-markdown scraping, prompt sanitization, and secret jail.

14 € / month
• Included: 10,000 req/mo
• Rate Limit: 120 req/min
• Target: Cursor, Windsurf, Claude Code developers & FinOps leads.
🎁 100 Free Requests / mo Included
Subscribe Direct (14 €)
210 Micro-APIs (Pack 1 included)

PACK 2 : Squad Velocity & Multi-Agent Swarms Hub

Multi-agent orchestration, distributed mutex, Wasm sandbox, CI/CD deterministic hooks, AST Playwright constitution, and git merge conflict prevention.

29 € / month
• Included: 50,000 req/mo
• Rate Limit: 600 req/min
• Target: Engineering squads, autonomous QA runners, and multi-agent systems.
🎁 100 Free Requests / mo Included
Subscribe Direct (29 €)
280 Micro-APIs (Packs 1 & 2 included)

PACK 3 : High-Scale & Autonomous Mesh Hub

High-velocity retail, coupon stacking firewall, POS kiosk guard, anti-DDoS, SSRF DNS-rebinding defense, and deterministic trading & Polymarket hedging.

79 € / month
• Included: 250,000 req/mo
• Rate Limit: 2400 req/min
• Target: High-scale applications, e-commerce platforms, and real-time streaming pipelines.
🎁 100 Free Requests / mo Included
Subscribe Direct (79 €)
400 Micro-APIs (Complete Suite)

PACK 4 : Sovereign Enterprise & RegTech Hub

European SEPA VoP 2025 verification, DORA Article 30 banking audit trails, EU AI Act Article 50 C2PA watermark, ISO 42001 governance, and Post-Quantum cryptography.

199 € / month
• Included: 1,000,000 req/mo
• Rate Limit: 6000 req/min
• Target: Tier-1 Banks, FinTechs, Healthcare, Defense, and Fortune 500 enterprises.
🎁 100 Free Requests / mo Included
Subscribe Direct (199 €)

⏱️ Throughput, Rate Limits & Edge SLAs

Every request is evaluated within Cloudflare V8 memory in sub-0.2ms. Sliding-window tokens are managed without external redis round-trips:

  • Pack 1 (DevEx & FinOps): 120 req/min (Soft ceiling, 10,000 req/mo).
  • Pack 2 (Squad Velocity): 600 req/min (50,000 req/mo).
  • Pack 3 (High-Scale & Infra): 2,400 req/min (250,000 req/mo).
  • Pack 4 (Sovereign Enterprise): 6,000+ req/min (1,000,000+ req/mo).

🧭 The 400 Micro-APIs Directory (Live Interactive Explorer)

Find the exact primitive you need in 2 clicks across our 4 operational pillars, or press / to search by keyword (e.g. markdown, sepa, lock, ast, siren):

1. Slashing LLM bills?
Pillar 1: AST minification, regex extraction, token compression.
2. Agent deadlocks?
Pillar 2: Distributed OCC locks, Wasm sandboxing, Git arbiter.
3. Traffic spike crash?
Pillar 3: Rate limiters, anti-DDoS, SSRF DNS firewall.
4. Banking & DORA?
Pillar 4: SEPA VoP 2025, Ed25519 audit, PII redaction.
All (400 APIs)
Pillar 1: DevEx & FinOps (101)
Pillar 2: Squad Velocity (109)
Pillar 3: High-Scale & Retail (70)
Pillar 4: Sovereign Enterprise (120)

📋 Strict OpenAPI 3.0 Contract

TopAI adheres strictly to OpenAPI Specification 3.0.3. Every single endpoint includes a unique operationId and typed response models.

Download or ingest the machine-readable specification into your Swagger, Postman, or agent router:

View Raw openapi.json

💻 Cursor & Windsurf IDE Setup (.cursorrules)

Drop the following configuration in your project's root .cursorrules file to enable sub-30ms deterministic routing:

.cursorrules configuration snippet
# TopAI Gateway Syscall Rules
You have access to TopAI Sovereign Gateway (https://gateway.topaigateway.com).
Whenever scraping URLs, cleaning HTML, validating SEPA IBANs, or checking AST syntax:
DO NOT guess or burn LLM tokens. Dispatch deterministic calls to TopAI Gateway using:
- Authorization: Bearer ${env:TOPAI_API_KEY}
- Target: https://gateway.topaigateway.com/v1/api/{api_id}

🤖 Claude Code CLI & Native MCP Integration

TopAI natively implements the Model Context Protocol (MCP). Connect TopAI to Claude Code or Desktop in 1 command:

mcp.json Configuration
{
  "mcpServers": {
    "topai-gateway": {
      "command": "npx",
      "args": ["-y", "@topaisaas/mcp-server"],
      "env": {
        "TOPAI_API_KEY": "topai_live_YOUR_KEY"
      }
    }
  }
}

⚡ n8n & Make.com Zero-Code Workflows

Integrate TopAI micro-services into visual agent workflows using standard HTTP nodes:

  • Method: POST
  • URL: https://gateway.topaigateway.com/v1/api/01-web-to-markdown
  • Authentication: Generic Credential Header Authorization: Bearer topai_live_xxx
  • JSON Body: {"url": "={{ $json.target_url }}"}

🐍 Python & TypeScript Client Snippets

TypeScript / Node.js (fetch)
const res = await fetch("https://gateway.topaigateway.com/v1/api/05-semantic-cache", {
  method: "POST",
  headers: {
    "Authorization": "Bearer topai_live_YOUR_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ query: "Extract user balance", namespace: "banking" })
});
const data = await res.json();
console.log(data);

⚖️ Enterprise Cyber & Regulatory Compliance (CISO Dossier)

Institutional Audit & Zero-Liability Assurance

TopAI guarantees absolute statutory compliance for European banks, healthcare entities, and defense suppliers under European Union DORA and the EU AI Act.

ISO 9001:2015
Software Quality Management & Non-Regression Gate (§7.5)
ISO/IEC 42001:2023
Artificial Intelligence Management System (AIMS)
DORA Directive (EU) 2022/2554
Banking Operational Resilience & Sub-12ms Edge Recovery (Art. 30)
EU AI Act (Regulation 2024/1689)
Article 50 Machine-Readable Watermarking & Risk Classifier

📄 Official Master Architecture Guide (91 Pages)

TopAI Architecture, Harness & Kernel Dev Guide
Certified 91-page engineering white paper with full ISO 9001:2015 audit matrices.
Download PDF (91p)