convez.ai
MCP ServerIntegração & APIsIntermediário
rahlplx

ZeroAI — Proxy de IA Gratuita para Terminal

rahlplx/zeroai

Proxy transparente que transforma ferramentas pagas em acesso IA grátis via roteamento inteligente

Ver no GitHub
InicialPluginScore · de 0 a 100

MCP server que funciona como proxy transparente local, interceptando chamadas de ferramentas como Claude Code e Cursor para roteiá-las automaticamente através de 10+ provedores de IA gratuitos. Oferece roteamento inteligente, fallback automático entre providers e acesso a ~100M tokens/dia sem custo, eliminando a necessidade de APIs pagadas.

Instalação

$npx convez-ai rahlplx/zeroai

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 3 meses
Versão
—
Issues abertas
1
Contribuidores
1

Casos de uso

  • Eliminar custos de API de Claude, OpenAI e Anthropic redirecionando para providers gratuitos
  • Maximizar capacidade de tokens combinando rate limits de múltiplos provedores livres
  • Manter continuidade de serviço com fallback automático quando um provider cai

Veredito

Solução engenhosa e tecnicamente sofisticada para eliminar custos de IA, mas requer setup local complexo e dependência de múltiplos provedores gratuitos (sujeitos a mudanças de políticas). Ideal para desenvolvedores que buscam economia radical aceitando complexidade operacional.

README

A tradução para o português deste README ainda está na fila.

ZeroAI — Zero-Cost AI From Your Terminal

Never pay for AI again. Stack 10+ free providers. Smart routing. Auto-fallback. Transparent proxy for Claude Code/Codex/Cursor. ~100M tokens/day for $0.

ZeroAI is a universal CLI + MCP server + transparent proxy that gives you free access to the latest AI models — no credit card, no browser automation, no wasted tokens. It intelligently routes your requests to the best free provider, automatically falls back on failure, and stacks rate limits across providers for virtually unlimited capacity.

The Magic Trick: Transparent Proxy

ZeroAI runs a local proxy that makes AI tools think they're talking to their official APIs, while secretly routing everything through free providers. Zero official tokens consumed.

Claude Code ──→ thinks it's api.anthropic.com ──→ localhost:2016 ──→ Gemini 2.5 Pro (free)
Codex ────────→ thinks it's api.openai.com ──────→ localhost:2016 ──→ Groq Llama 70B (free)
Cursor ───────→ thinks it's api.openai.com ──────→ localhost:2016 ──→ DeepSeek V3 (free)

Your AI tools see their own API format, their own model names, everything looks normal — but not a single token hits the official APIs. All traffic goes through ZeroAI's free provider stack.

Model Mapping (Automatic)

When your tool asks for a model, ZeroAI silently swaps it to the best free equivalent:

Requested ModelZeroAI Routes ToWhy
claude-sonnet-4Gemini 2.5 ProBest free reasoning/code
claude-3.5-sonnetGemini 2.5 ProBest free coding
claude-3-haikuGroq Llama 70BUltra-fast, free
gpt-4oGemini 2.5 ProBest free alternative
gpt-4o-miniGroq Llama 70BFast, free
o3 / o3-miniDeepSeek R1Best free reasoner
gpt-3.5-turboGroq Llama 8BUltra-fast, free

Quick Start

Step 1: Start the Proxy

# Install
npm install -g zeroai

# Get free API keys (one-time)
zeroai init

# Start the transparent proxy
zeroai proxy

Step 2: Inject Environment Variables

# Print the export commands
zeroai inject

# Or set them directly:
export ANTHROPIC_BASE_URL=http://localhost:2016/anthropic
export ANTHROPIC_API_KEY=sk-zeroai-local
export OPENAI_BASE_URL=http://localhost:2016/v1
export OPENAI_API_KEY=sk-zeroai-local

Step 3: Use Your Tools Normally

# Claude Code — will use free Gemini/Groq instead of Anthropic
claude

# Codex — will use free Gemini/Groq instead of OpenAI
codex

# Cursor — set base_url in settings to http://localhost:2016/v1

# Any OpenAI-compatible tool — just point base_url to localhost:2016

That's it. Your tools work exactly as before, but all API calls are free.

Why ZeroAI?

ProblemZeroAI Solution
Claude Code costs $20-100/mo$0 — proxy routes to free providers
OpenAI API costs $30-600/mo$0 — transparent proxy intercepts all calls
Rate limits block you~100M tokens/day by rotating 10 providers
One provider goes downAuto-fallback chain — never stop working
Browser AI wastes tokensDirect API — no headless browser needed
Privacy concerns with cloudOllama local — unlimited, private fallback

The Free AI Stack (All $0, No Credit Card)

ProviderFree ModelsRate LimitSignup
Google AI StudioGemini 2.5 Flash, 2.5 Pro, Flash-Lite15 RPM / 1,500 RPDaistudio.google.com
GroqLlama 3.3 70B, Qwen3 32B, Kimi K230 RPM / 14,400 RPDconsole.groq.com
MistralMistral Large, Codestral, Small~1B tokens/monthconsole.mistral.ai
CerebrasLlama 3.3 70B, Qwen 2.5 32B1.5M tokens/daycloud.cerebras.ai
OpenRouter27+ free models (DeepSeek, Llama, Qwen)20 RPM / 50 RPDopenrouter.ai
DeepSeekDeepSeek V3, R15M free signup tokensplatform.deepseek.com
CohereCommand R+ (128K ctx)1,000 calls/monthdashboard.cohere.com
OllamaAny model, unlimitedUnlimited (your hardware)ollama.com

Combined free capacity: ~100M tokens/day

CLI Commands

zeroai init          # Setup wizard — get free API keys
zeroai proxy         # Start transparent proxy for Claude Code/Codex/Cursor
zeroai inject        # Print env vars to redirect tools to the proxy
zeroai chat "Hello"  # Chat with best free model directly
zeroai serve         # Run as MCP server
zeroai models        # List available free models
zeroai compare "Hi"  # Compare providers side-by-side
zeroai doctor        # Health check your configuration

Transparent Proxy Setup

For Claude Code (Anthropic API)

# 1. Start proxy
zeroai proxy

# 2. Set environment variables
export ANTHROPIC_BASE_URL=http://localhost:2016/anthropic
export ANTHROPIC_API_KEY=sk-zeroai-local

# 3. Use Claude Code normally — all calls go through free providers
claude

For Codex / OpenAI Tools

# 1. Start proxy
zeroai proxy

# 2. Set environment variables
export OPENAI_BASE_URL=http://localhost:2016/v1
export OPENAI_API_KEY=sk-zeroai-local

# 3. Use Codex normally
codex

For Cursor / Continue / Any Tool

In the tool's settings, configure:

base_url = http://localhost:2016/v1
api_key  = sk-zeroai-local

Persistent Setup (Add to ~/.bashrc or ~/.zshrc)

# ZeroAI Transparent Proxy — zero official tokens
export ANTHROPIC_BASE_URL=http://localhost:2016/anthropic
export ANTHROPIC_API_KEY=sk-zeroai-local
export OPENAI_BASE_URL=http://localhost:2016/v1
export OPENAI_API_KEY=sk-zeroai-local

How It Works

  1. Your AI tool (Claude Code, Codex, etc.) sends a request to localhost:2016
  2. ZeroAI receives the request in Anthropic or OpenAI format
  3. It maps the requested model to the best free equivalent (e.g., claude-sonnet-4 → gemini-2.5-pro)
  4. It converts the message format if needed (Anthropic ↔ OpenAI ↔ Gemini)
  5. It routes the request through the free provider fallback chain
  6. It converts the response back to the original format
  7. Your tool receives a perfectly formatted response — it never knows the difference

Supports streaming (SSE) for both Anthropic and OpenAI formats.

Smart Routing

ZeroAI automatically routes to the best free provider based on your task:

TaskPrimaryFallback 1Fallback 2Fallback 3
CodingGroq (Llama 70B)Mistral (Codestral)Gemini (2.5 Pro)Ollama
ReasoningGemini (2.5 Pro)DeepSeek (R1)OpenRouter (Qwen3 235B)Ollama
Fast chatGroq (500+ tok/s)CerebrasGroq (Qwen3)Ollama
Long contextGemini (1M ctx)OpenRouter (Llama 4 Scout)Mistral (256K)Ollama
VisionGemini (2.5 Flash)Ollama (Llama Vision)——
Image genGemini (2.5 Flash Image)———
Tool callingGroq (Llama 70B)Gemini (2.5 Flash)Cohere (R+)Ollama
PrivacyOllama (local)———

MCP Server (Claude Code / Cursor / VS Code)

Add to your MCP config:

{
  "mcpServers": {
    "zeroai": {
      "command": "npx",
      "args": ["zeroai", "serve"],
      "env": {
        "GOOGLE_AI_API_KEY": "...",
        "GROQ_API_KEY": "...",
        "MISTRAL_API_KEY": "..."
      }
    }
  }
}

8 MCP Tools

ToolDescription
chatSmart chat with auto-routing to best free provider
code_reviewCode review with coding-optimized model
reasonDeep reasoning for complex problems (DeepSeek R1, Gemini Pro)
quickFast response (Groq/Cerebras — 500+ tok/sec)
compareCompare responses across multiple free providers
list_modelsShow all available free models and capabilities
consensusMulti-model consensus answer (query 3+ models, synthesize)
generate_imageImage generation via Gemini free tier

Environment Variables

# Free provider API keys (all optional)
GOOGLE_AI_API_KEY=        # Gemini (free @ aistudio.google.com)
GROQ_API_KEY=             # Groq (free @ console.groq.com)
MISTRAL_API_KEY=          # Mistral (free @ console.mistral.ai)
CEREBRAS_API_KEY=         # Cerebras (free @ cloud.cerebras.ai)
OPENROUTER_API_KEY=       # OpenRouter (free @ openrouter.ai)
DEEPSEEK_API_KEY=         # DeepSeek (free @ platform.deepseek.com)
COHERE_API_KEY=           # Cohere (free @ dashboard.cohere.com)

Rate Limit Multiplication

Combined StackEffective Rate LimitTotal Daily Tokens
Google + Groq + Mistral55 RPM / 500K+ RPD~50M tokens/day
+ Cerebras + OpenRouter105 RPM / 510K+ RPD~75M tokens/day
+ DeepSeek + Cohere225 RPM / 540K+ RPD~100M tokens/day
+ Ollama (local)Unlimited fallback∞

Cost Comparison

Usage LevelZeroAI (Free Stack)OpenAI APIAnthropic API
1K messages/day$0~$30-60/mo~$40-80/mo
10K messages/day$0~$300-600/mo~$400-800/mo
100K messages/day$0 (rotate)~$3,000-6,000/mo~$4,000-8,000/mo
Unlimited$0 (Ollama)~$10,000+/mo~$15,000+/mo

Annual savings: $360 — $180,000+

Architecture

Claude Code / Codex / Cursor / Any Tool
            │
    (thinks it's official API)
            │
            ▼
    ┌──────────────────┐
    │  ZeroAI Proxy    │
    │  localhost:2016  │
    │                  │
    │  • Anthropic API │  ← Claude Code talks here
    │  • OpenAI API    │  ← Codex/Cursor talk here
    │  • Model mapping │  ← claude-sonnet-4 → gemini-2.5-pro
    │  • Format conv.  │  ← Anthropic ↔ OpenAI ↔ Gemini
    │  • Auto-fallback │  ← provider fails? try next
    │  • Streaming SSE │  ← real-time token streaming
    └────────┬─────────┘
             │
    ┌────────┼──────┬───────┬───────┬───────┐
    ▼        ▼      ▼       ▼       ▼       ▼
 Google   Groq  Mistral  Cerebras  ...  Ollama
 (1.5K    (14K   (1B tok  (1.5M    ...  (∞ local
  RPD)     RPD)   /mo)     /day)         free)

Important Notes

  1. Free tier data may be used for training — Don't send sensitive data to Google/Groq/OpenRouter free tiers.
  2. Use Ollama for sensitive work — Completely private, no data leaves your machine.
  3. DeepSeek is based in China — Consider data privacy implications.
  4. Google free tier not available in EU/EEA — Use VPN or other providers.
  5. Stack multiple providers — Never depend on a single free provider. Rotate for resilience.
  6. Proxy is local only — The proxy only listens on localhost. Your API keys never leave your machine.

License

MIT

Ver o original no GitHub

Bom para

Relacionados