import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import Layout from '@theme/Layout'; import Heading from '@theme/Heading'; function HomepageHeader() { const {siteConfig, i18n} = useDocusaurusContext(); const currentLocale = i18n.currentLocale; const content = { en: { title: 'Route Claude Code', highlight: 'to Any LLM', subtitle: 'Use Claude Code without an Anthropic account. Connect to DeepSeek, Gemini, Groq, and more.', getStarted: 'Get Started', github: 'View on GitHub', }, 'zh-CN': { title: '将 Claude Code', highlight: '路由到任何 LLM', subtitle: '无需 Anthropic 账户即可使用 Claude Code。支持连接 DeepSeek、Gemini、Groq 等提供商。', getStarted: '开始使用', github: '查看 GitHub', } }; const t = content[currentLocale as keyof typeof content] || content.en; return (
{/* Background Elements */}
{/* Hero Content */}
{/* Badge */}
{currentLocale === 'zh-CN' ? '开源免费' : 'Open Source'}
{/* Title */} Route Claude Code
{t.highlight}
{/* Subtitle */}

{t.subtitle}

{/* CTA Buttons */}
{t.getStarted} {t.github}
{/* Install Command */}
{/* Terminal Header */}
terminal
{/* Copy Button */}
{/* Terminal Body */}
{/* Prompt */}
$ npm install -g @musistudio/claude-code-router
{/* Scroll Indicator */}
); } function FeatureSection() { const {i18n} = useDocusaurusContext(); const currentLocale = i18n.currentLocale; const content = { en: { title: 'Why Claude Code Router?', features: [ { emoji: '⚡', title: 'Lightning Fast', description: 'Get started in minutes with just one command. No complicated configuration required.' }, { emoji: '🎯', title: 'Smart Routing', description: 'Automatically route requests to the best model based on context length, task type, and custom rules.' }, { emoji: '🔌', title: 'Multi-Provider', description: 'Support for DeepSeek, Gemini, Groq, OpenRouter, and more. Easy to extend with custom transformers.' }, { emoji: '💰', title: 'Cost Effective', description: 'Use more affordable models for routine tasks while reserving Claude for complex scenarios.' }, { emoji: '🛠️', title: 'Agent System', description: 'Extendable agent architecture for custom tools and workflows. Built-in support for image tasks.' }, { emoji: '🔧', title: 'Highly Customizable', description: 'Configure routing per project, set up transformers, and fine-tune every aspect of your workflow.' } ] }, 'zh-CN': { title: '为什么选择 Claude Code Router?', features: [ { emoji: '⚡', title: '快速上手', description: '只需一条命令即可开始使用,无需复杂配置。' }, { emoji: '🎯', title: '智能路由', description: '基于上下文长度、任务类型和自定义规则,自动将请求路由到最佳模型。' }, { emoji: '🔌', title: '多提供商支持', description: '支持 DeepSeek、Gemini、Groq、OpenRouter 等多个提供商,易于扩展。' }, { emoji: '💰', title: '节省成本', description: '常规任务使用更经济的模型,复杂场景再使用 Claude。' }, { emoji: '🛠️', title: 'Agent 系统', description: '可扩展的 agent 架构,支持自定义工具和工作流。内置图像任务支持。' }, { emoji: '🔧', title: '高度可定制', description: '按项目配置路由、设置转换器,微调工作流的每个细节。' } ] } }; const t = content[currentLocale as keyof typeof content] || content.en; return (
{t.title}
{t.features.map((feature, idx) => (
{feature.emoji}
{feature.title}

{feature.description}

))}
); } function CodeDemo() { const {i18n} = useDocusaurusContext(); const currentLocale = i18n.currentLocale; const content = { en: { title: 'Simple Configuration', subtitle: 'Configure your providers and routing logic with a single JSON file.' }, 'zh-CN': { title: '简单配置', subtitle: '使用单个 JSON 文件配置提供商和路由逻辑。' } }; const t = content[currentLocale as keyof typeof content] || content.en; return (
{t.title}

{t.subtitle}

config.json
              
                {'{'}
                
                  {'\n  '}
                  "Providers"
                  : 
                  [
                  {'\n    '}
                  {'{'}
                  {'\n      '}
                  "NAME"
                  : 
                  "deepseek"
                  ,
                  {'\n      '}
                  "HOST"
                  : 
                  "https://api.deepseek.com"
                  ,
                  {'\n      '}
                  "APIKEY"
                  : 
                  "your-api-key"
                  ,
                  {'\n      '}
                  "MODELS"
                  : 
                  [
                  "deepseek-chat"
                  , 
                  "deepseek-coder"
                  ]
                  {'\n    '}
                  {'}'}
                  ,
                  {'\n    '}
                  {'{'}
                  {'\n      '}
                  "NAME"
                  : 
                  "groq"
                  ,
                  {'\n      '}
                  "HOST"
                  : 
                  "https://api.groq.com/openai/v1"
                  ,
                  {'\n      '}
                  "APIKEY"
                  : 
                  "your-groq-key"
                  ,
                  {'\n      '}
                  "MODELS"
                  : 
                  [
                  "llama-3.3-70b-versatile"
                  ]
                  {'\n    '}
                  {'}'}
                  {'\n  '}
                  ]
                  ,
                  {'\n  '}
                  "Router"
                  : 
                  {'{'}
                  {'\n    '}
                  "default"
                  : 
                  "deepseek,deepseek-chat"
                  ,
                  {'\n    '}
                  "background"
                  : 
                  "groq,llama-3.3-70b-versatile"
                  {'\n  '}
                  {'}'}
                  {'\n'}
                  {'}'}
                
              
            
); } function UseCases() { const {i18n} = useDocusaurusContext(); const currentLocale = i18n.currentLocale; const content = { en: { title: 'Perfect For', subtitle: 'See how Claude Code Router fits your workflow', cases: [ { icon: '💰', title: 'Cost-Conscious Developers', description: 'Reduce API costs by 10x while maintaining quality for most tasks' }, { icon: '🔒', title: 'Privacy-Focused Teams', description: 'Keep code local with self-hosted models while using Claude when needed' }, { icon: '🔄', title: 'Multi-Model Workflows', description: 'Use different models for different tasks without switching tools' }, { icon: '⚡', title: 'Claude Code Power Users', description: 'Extend Claude Code with custom providers and routing strategies' } ] }, 'zh-CN': { title: '适用场景', subtitle: '看看 Claude Code Router 如何融入您的工作流程', cases: [ { icon: '💰', title: '注重成本的开发者', description: '在大多数任务上保持质量的同时,将 API 成本降低 10 倍' }, { icon: '🔒', title: '注重隐私的团队', description: '使用自托管模型保持代码本地化,需要时再使用 Claude' }, { icon: '🔄', title: '多模型工作流', description: '为不同任务使用不同模型,无需切换工具' }, { icon: '⚡', title: 'Claude Code 高级用户', description: '使用自定义提供商和路由策略扩展 Claude Code' } ] } }; const t = content[currentLocale as keyof typeof content] || content.en; return (
{t.title}

{t.subtitle}

{t.cases.map((useCase, idx) => (
{/* Background decoration */}
{/* Number badge */}
{idx + 1}
{/* Icon */}
{useCase.icon}
{/* Content */}
{useCase.title}

{useCase.description}

{/* Hover accent line */}
))}
); } function CTASection() { const {i18n} = useDocusaurusContext(); const currentLocale = i18n.currentLocale; const content = { en: { title: 'Ready to Get Started?', subtitle: 'Join thousands of developers using Claude Code Router to build better software.', getStarted: 'Get Started', docs: 'Read the Docs', github: 'Star on GitHub', community: 'Join Community' }, 'zh-CN': { title: '准备开始了吗?', subtitle: '加入数千名使用 Claude Code Router 的开发者,构建更好的软件。', getStarted: '开始使用', docs: '阅读文档', github: '在 GitHub 上点赞', community: '加入社区' } }; const t = content[currentLocale as keyof typeof content] || content.en; return (
{/* Animated background */}
{/* Pattern overlay */}
{/* Floating orbs */}
{/* Main title */} {t.title} {/* Subtitle */}

{t.subtitle}

{/* Primary CTA buttons */}
{t.getStarted} {t.docs}
{/* Secondary links */}
{t.github}
{t.community}
); } export default function Home() { return (
); }