import React, { useState, useEffect, useRef } from 'react'; import { TerminalWindow } from './TerminalWindow'; import { TypingAnimation } from './TypingAnimation'; export const SmartRouting: React.FC = () => { const [activePath, setActivePath] = useState<0 | 1 | 2>(1); // Animation state for the bottom terminal const [actionStep, setActionStep] = useState(0); const scrollRef = useRef(null); // Loop for the diagram animation useEffect(() => { const interval = setInterval(() => { setActivePath(prev => (prev + 1) % 3 as 0 | 1 | 2); }, 3500); return () => clearInterval(interval); }, []); // Loop for the terminal sequence useEffect(() => { const timeline = [ { step: 1, delay: 1000 }, // Start typing cmd 1 { step: 2, delay: 3500 }, // Show output 1 { step: 3, delay: 6500 }, // Start typing cmd 2 (Free) { step: 4, delay: 9000 }, // Show output 2 { step: 5, delay: 12000 }, // Start typing cmd 3 { step: 6, delay: 14000 }, // Show output 3 { step: 7, delay: 17000 }, // Start typing cmd 4 { step: 8, delay: 20000 }, // Show output 4 { step: 9, delay: 24000 }, // Pause before reset ]; let timeouts: ReturnType[] = []; const runSequence = () => { setActionStep(0); let cumDelay = 0; timeline.forEach(({ step, delay }) => { timeouts.push(setTimeout(() => setActionStep(step), delay)); cumDelay = Math.max(cumDelay, delay); }); // Reset loop timeouts.push(setTimeout(runSequence, cumDelay + 1000)); }; runSequence(); return () => timeouts.forEach(clearTimeout); }, []); // Auto-scroll effect useEffect(() => { if (scrollRef.current) { scrollRef.current.scrollTo({ top: scrollRef.current.scrollHeight, behavior: 'smooth' }); } }, [actionStep]); const getPathColor = (pathIndex: number) => { if (pathIndex === 0) return '#d97757'; // Native (Orange) if (pathIndex === 1) return '#3fb950'; // Free (Green) return '#8b5cf6'; // Premium (Purple) }; return (
{/* Background Grid Texture */}
{/* Section Header */}
Dynamic Route Resolution

Free to Start. Native When You Need It.

Claudish intelligently routes your prompts based on the model you select.
Zero config. Zero friction.

{/* DIAGRAM CONTAINER */}
{/* SVG CIRCUIT LAYER (Absolute) */}
{/* Connection Lines */} {/* Center Start Point: 600, 120 (Bottom of Router) */} {/* Path 0: Left (Native) */} {/* Path 1: Center (Free) */} {/* Path 2: Right (Premium) */} {/* Moving Packets */} {activePath === 0 && ( )} {activePath === 1 && ( )} {activePath === 2 && ( )}
{/* --- TOP: ROUTER NODE --- */}
{/* Glow effect */}
{/* Port labels */}
CLAUDISH_ROUTER
{/* Dynamic Terminal Text */}
$ claudish routing-table --watch
{activePath === 0 && '>> DETECTED: opus-4.5 (NATIVE)'} {activePath === 1 && '>> DETECTED: grok-free (OPENROUTER)'} {activePath === 2 && '>> DETECTED: gpt-5.1 (PREMIUM)'}
{/* --- BOTTOM: 3 DESTINATIONS --- */}
{/* 1. NATIVE CARD */}
{/* Colored Top Bar */}

Your Subscription

NATIVE

Direct passthrough to Anthropic's API. Uses your existing credits or Pro plan.

  • opus-4.5
  • sonnet-4.5
  • haiku-4.5
0% MARKUP • DIRECT API
{/* 2. FREE CARD (Updated) */}

Top Models. Always Free.

OPENROUTER FREE TIER

OpenRouter consistently offers high-quality models at no cost. Not trials. Not limited versions. Real models from Google, xAI, DeepSeek, Meta, Microsoft, and more.

  • x-ai/grok-4.1-fast:free
  • gemini-2.0-flash
  • deepseek-r1
Google · xAI · DeepSeek · Meta · Microsoft
{/* 3. PREMIUM CARD */}

Pay As You Go

PREMIUM

Use top-tier reasoning models from other providers. Paid per token.

  • gpt-5.1
  • gemini-3-pro
  • deepseek-v3.1
PAY PER TOKEN • PREPAID
{/* TERMINAL EXAMPLE - SEE IT IN ACTION */}

See It In Action

Real-time CLI routing behavior

{/* 1. NATIVE SCENARIO */}
= 1 ? 'opacity-100' : 'opacity-0 hidden'}`}>
# Use your Claude Max subscription (native passthrough)
$
= 2 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-2 hidden'}`}>
Routing: Native Anthropic API
Subscription: Claude Max detected
Context: 1,000K available
Ready
{/* 2. FREE SCENARIO (Updated) */}
= 3 ? 'opacity-100' : 'opacity-0 hidden'}`}>
# OpenRouter's free tier — real top models, always available
$
= 4 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-2 hidden'}`}>
15 curated free models from trusted providers
Grok 4.1 Fast — 2M context
Gemini 2.0 Flash — 1M context
DeepSeek R1 — 164K context
Llama 3.3 70B — 131K context
These aren't trials. They're real models. Pick one and start coding.
{/* 3. PREMIUM SCENARIO */}
= 5 ? 'opacity-100' : 'opacity-0 hidden'}`}>
# Use premium models (pay per token)
$
= 6 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-2 hidden'}`}>
Routing: OpenRouter
Cost: $5.63 / 1M tokens
Context: 400K available
Ready
{/* 4. MIXED SCENARIO */}
= 7 ? 'opacity-100' : 'opacity-0 hidden'}`}>
# Mix models for cost optimization
$
claudish \
--model-opus anthropic/claude-opus-4.5 \ # Native Claude
--model-sonnet x-ai/grok-4 \ # Premium
--model-haiku x-ai/grok-4.1-fast:free # Free
= 8 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-2 hidden'}`}>
Opus: Native Anthropic (subscription)
Sonnet: OpenRouter ($9.00/1M)
Haiku: OpenRouter (free!)
Ready — 3 models collaborating
{/* Cursor at bottom */}
= 8 ? 'opacity-100' : 'opacity-0'}`}> $
); };