Nexus IA — AI platform with 620+ endpoints, multimodal and autonomous agent
- 620+
- REST endpoints
- 20+
- AI models
- 6
- Plans
Client
Nexus IA
Sector
Artificial intelligence and productivity
Timeline
Iteração contínua · 2026-08
Live product
Use nowResults
Client-reported results during rollout
Baseline: core API + /v1 gateway + backend-api
Fonte: Route handler count (Next.js)
Baseline: chat, reasoning, research and voice
Fonte: Production /api/models API
Baseline: Free, Go, Plus, Pro, Business, Enterprise
Fonte: lib/plans.ts
Baseline: OCR, caption, classify, compare and others
Fonte: API /api/vision
Baseline: PDF, DOCX, XLSX, PPTX and others
Fonte: API /api/documents
Baseline: with source-format citations
Fonte: API /api/search
Baseline: Stripe (international) + Mercado Pago (BR)
Fonte: API /api/billing
Baseline: RLS on all tables
Fonte: ExpoStacker architecture
Client-reported data
The challenge
The challenge
Nexus IA is an AI SaaS that centralizes multiple models and capabilities in a commercial platform. It offers Nexus Auto with automatic routing to the best available model, a catalog with 20+ models (chat, reasoning, research and voice), an OpenAI-compatible gateway for external integrations, chat with persistent context memory, code assistant, multimodal (documents in 20 formats, audio, image and video), workspace with terminal and autonomous agent capable of creating files and editing projects, BYOK and 6 commercial plans in BRL.
Equipes e profissionais desperdiçam tempo alternando entre múltiplas ferramentas de IA, corrigindo respostas com acentuação quebrada e lidando com limites de uso de APIs individuais, o que reduz produtividade e aumenta custos operacionais.
The approach
The approach
The architecture migrated from a legacy Python backend to Next.js 16 with 620+ route handlers covering core API, OpenAI-compatible gateway (/v1) and backend-api — all deployed to Cloudflare Workers via OpenNext. Persistence on Supabase (Postgres + Auth + RLS), Nexus Auto picks the best available model per task, BYOK lets users connect their own key and billing runs on Stripe + Mercado Pago.
The solution
The solution
- Nexus Auto — automatic routing to the best available model per task
- Catalog with 20+ public models (chat, reasoning, research, voice and realtime)
- OpenAI-compatible gateway (/v1): chat/completions, models, images, audio, realtime, assistants, threads, memories, embeddings, responses, containers, computer, videos, vision, canvas, skills and documents
- 620+ REST route handlers: core API, /v1 gateway and compatible backend-api
- Code assistant with generation, explanation, review and direct execution
- Complete workspace with terminal, editor, file tree and autonomous agent
- Autonomous agent capable of creating files, editing projects and running commands
- Multimodal: documents in 20 formats, audio (TTS/STT/realtime), image and video
- Web search with 6 configured engines (1 active without key) and source-format citations
- Persistent memory with RAG, deduplication, tags and per-user history
- Vision/OCR with 17 image analysis capabilities
- BYOK (Bring Your Own Key) — user connects their own AI key
- 6 commercial plans (Free, Go, Plus, Pro, Business, Enterprise) in BRL via Stripe + Mercado Pago
- JWT authentication + Supabase Auth, httpOnly cookies and rate limiting
- Per-island database: dedicated Supabase with RLS on all tables
Timeline
Como o projeto foi conduzido, do mapeamento ao deploy. How the project was conducted, from mapping to deploy.
Iteração 1
Fundação
- Migration from Python backend (legacy) to Next.js App Router
- Supabase (Postgres + Auth + RLS) as production database
- Nexus Auto — automatic model routing
- Deploy to Cloudflare Workers via OpenNext
Iteração 2
Produto
- 620+ route handlers: core API, /v1 gateway and backend-api
- Workspace with terminal, editor, file tree and autonomous agent
- Multimodal: documents (20 formats), audio, image and video
- Persistent memory with RAG and vision/OCR (17 modes)
Iteração 3
Comercial
- 6 plans in BRL (Free to Enterprise) with Stripe + Mercado Pago
- BYOK — user connects their own AI key
- Per-plan real-time cost and usage control
- Commercial landing with SEO and sitemap
Methodology
Como o projeto foi conduzido, do mapeamento ao deploy. How the project was conducted, from mapping to deploy.
Incremental migration from Python legacy to Next.js (API by API)
Routing and fallback tests across models/providers
SEO, accessibility and responsiveness audit
JWT auth + Supabase Auth + RLS validation
ExpoStacker component standards and design tokens
Architecture
- → Next.js 16 App Router with 620+ route handlers (Edge + Node.js runtime)
- → OpenAI-compatible gateway at /v1 for external integrations
- → Nexus Auto picks the best available model per task
- → Supabase (Postgres + Auth + RLS) as production database
- → React workspace with terminal, editor, file tree and autonomous agent
- → Multimodal: documents (20 formats), audio, image, video, vision/OCR
- → Stripe + Mercado Pago billing with 6 plans in BRL
- → Deploy on Cloudflare Workers via OpenNext (worker nexus-ai-bark)
- → BYOK and per-plan real-time cost control
Conceptual diagram — does not reflect real implementation
Tech stack
Technical choices and what was left out.
ai
Why: App Router with 620+ route handlers — front and API on the same edge runtime
Rejected alternative: Separate FastAPI (migration complete)
Why: End-to-end typing — model catalog, billing and API contracts
Rejected alternative: Plain JavaScript (less refactor safety)
Why: Postgres + Auth + RLS — dedicated database per product
Rejected alternative: Local SQLite (MVP, doesn't scale)
Why: Global edge deploy via OpenNext with managed secrets
Rejected alternative: Dedicated VPS (higher cost and ops)
ai
Why: Interactive workspace and SSE-streamed chat
Rejected alternative: Vanilla HTML (no rich state)
Why: Tokens consistent with ExpoStacker
Rejected alternative: Plain CSS (slower to prototype)
Why: Global chat/workspace state without boilerplate
Rejected alternative: Redux (more verbose)
ai
Why: Automatic routing + user's own key as alternative path
Rejected alternative: Single provider (single point of failure)
Why: Subscriptions and checkout for international customers
Rejected alternative: Manual payment (doesn't scale)
Why: PIX, boleto and card for the Brazilian market
Rejected alternative: Stripe alone (no native PIX/boleto)
ai
Why: Workspace with real terminal and code editor in the browser
Rejected alternative: No workspace (chat only)
Why: Persistent per-user context with deduplication and tags
Rejected alternative: No memory (session lost)
Why: Real-time token-by-token responses
Rejected alternative: Full request/response (slow UX)
Decision log
What I chose, what I rejected, and why.
Migration from FastAPI to Next.js
Why: Unifies front and back on the same edge runtime, removes the need to host two services and leverages Cloudflare Workers deploy with managed secrets.
Rejected alternatives: Keep separate FastAPI (more deploy complexity), serverless on another provider
Supabase instead of SQLite
Why: Supabase provides Postgres + Auth + RLS ready for production with row-level isolation — SQLite was fine for MVP but doesn't scale or offer native auth.
Rejected alternatives: Hosted Postgres (more ops), Firebase (greater lock-in)
OpenAI-compatible gateway at /v1
Why: Lets any tool that talks to the OpenAI API integrate with Nexus without customization — expanding product reach.
Rejected alternatives: Closed custom API (fewer integrations), GraphQL (unnecessary complexity)
Dual billing: Stripe + Mercado Pago
Why: Stripe covers international customers; Mercado Pago offers PIX and boleto — essential for the Brazilian market.
Rejected alternatives: Stripe only (no native PIX/boleto), Mercado Pago only (smaller international coverage)
AI Assistant
Intelligent routing pipeline
User sends the message and selects the model (or Nexus Auto)
System checks model availability and user plan
Router selects the provider with the best availability score
BYOK lets the user's own key be used when configured
Automatic fallback on failure, timeout or quota exceeded
Response is streamed via SSE, cost is calculated and recorded in Supabase
Engagement mechanics
Progressive plans
6 plans (Free to Enterprise) unlock more models, multimodal and higher limits — clear upgrade progression.
Active workspace
Projects, files, terminal and autonomous agent keep the user returning to the environment.
Nexus Auto
Automatic routing teaches the user to trust the platform to pick the best model per task.
Gamified multimodal
Documents, audio, image and video unlocked per tier — visual progression that drives upgrades.
BYOK
User connects their own AI key and expands limits without changing plans.
Security and access
Security and compliance
-
External API keys never exposed in the front-end — backend only
-
JWT authentication + Supabase Auth with httpOnly cookies
-
bcrypt password hashing, change via dedicated endpoint
-
RLS (Row-Level Security) on all Supabase tables
-
Rate limiting on routes per IP and per plan
-
CORS restricted to configured origins
-
Email verification, password recovery and usage reset
-
Plan validation in the backend from the JWT token
-
BYOK — user keys stored encrypted
Lessons learned
Not everything went as planned.
— Sharing global async HTTP clients between synchronous requests causes event loop errors — per-request clients solve timeouts and encoding. Migrating from FastAPI to Next.js centralized front and back on the same edge runtime, simplifying deploy. Per-island databases (dedicated Supabase per product) protect the rest of the ecosystem from local failures.
See also other products
StackPost — API Unificada de Redes Sociais
API unificada de redes sociais multi-tenant com 19 integrações, 114 endpoints REST, OAuth centralizado, agendamento, analytics e comentários.
View case →
VulnStrike
Scanner de vulnerabilidades SaaS: digite um domínio e receba nota de segurança A+–F com achados explicados e correção passo a passo — scan grátis sem cadastro.
View case →
NutriX
Plataforma de saúde adaptativa em produção: nutrição calculada, treino ao vivo, coach de IA, análise por foto e portal de profissionais.
View case →Want a product like this?
I can do the same for your business. Let's talk.