Skip to content

Repository files navigation

NexusProxy

Pool free search API tiers so they last all month — not 10 days.

NexusProxy is a tiny local sidecar that combines multiple free-tier API accounts into one normalized search endpoint. Three Brave Search accounts (one per Google login) + Tavily + Serper = free search all month.

One binary. No Docker required. Built for students, indie devs, and AI agents.

Why

Brave Search gives you $5/month free credit. One account runs out in about 10 days. But most developers have 2-3 Google accounts. Each can open its own Brave Search API key — each with its own free monthly credit.

Combine 3× Brave accounts, Tavily's free tier, and Serper's free tier, and you get $20+/month in free search credits. NexusProxy pools them all behind one API and routes intelligently to make them last.

Quick Start

curl -fsSL https://github.com/ghraw/mananxrobin/NexusProxy/main/scripts/install.sh | sh
nexusproxy setup
nexusproxy run

The setup wizard guides you through adding keys. When it asks "Add another Brave Search key?" — say yes and paste your second account's key. Repeat for as many accounts as you have.

nexusproxy budget   # see how many free queries you have pooled

Then point your agent or RAG pipeline at http://127.0.0.1:8787/v1/search.

Commands

Command What it does
nexusproxy setup Save provider API keys interactively
nexusproxy run Start in the background
nexusproxy budget Show free-tier pool health, estimated days remaining
nexusproxy kill Stop the background process
nexusproxy update Update the binary from GitHub Releases
nexusproxy uninstall Remove binary, keep config and keys
nexusproxy uninstall --purge Remove everything
nexusproxy serve Run in foreground (Docker/systemd/launchd)

Multi-Account Setup

The killer feature. Create multiple free-tier accounts for the same provider:

nexusproxy setup
# Enter your first Brave Search key
# When asked "Add another Brave Search key?" — yes
# Paste your second Brave Search key (different Google login)
# Repeat for a third, fourth...

NexusProxy saves them as numbered env vars:

BRAVE_API_KEY=BSA-account1-xxx
BRAVE_API_KEY_2=BSA-account2-yyy
BRAVE_API_KEY_3=BSA-account3-zzz
TAVILY_API_KEY=tvly-xxx
SERPER_API_KEY=xxx

Each becomes a separate routeable provider slot. The exhaustion-aware router spreads traffic across all accounts, prioritizing ones resetting soon so no free credit goes to waste.

Dashboard

Open http://127.0.0.1:8787/dashboard to see:

  • Free Tier Pool — total queries remaining, estimated days left, per-provider budget
  • Gateway metrics — total/succeeded/failed requests
  • Provider table — per-account status, quota, cooldowns, last errors
  • Key management — add/save keys without touching .env files
  • Health refresh — probe all providers to update real quota headers

Search

curl -sS http://127.0.0.1:8787/v1/search \
  -H 'Authorization: Bearer local-dev-token' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "best vector databases for rag",
    "max_results": 5,
    "country": "US",
    "language": "en",
    "freshness": "month"
  }'

Response:

{
  "query": "best vector databases for rag",
  "provider": "brave-primary-2",
  "results": [
    {
      "title": "Example result",
      "url": "https://example.com",
      "snippet": "Normalized snippet",
      "published_at": "2026-06-01",
      "source": "example.com",
      "rank": 1,
      "provider": "brave-primary-2"
    }
  ],
  "attempts": [
    {"provider": "brave-primary-2", "type": "brave", "status": 200, "ok": true}
  ],
  "meta": {
    "result_count": 1,
    "routing_policy": "exhaustion_aware"
  }
}

Compatible Endpoints

Tavily-compatible (agents that support TAVILY_BASE_URL):

curl -sS http://127.0.0.1:8787/search \
  -H 'Authorization: Bearer local-dev-token' \
  -H 'Content-Type: application/json' \
  -d '{"query": "best vector databases for rag", "max_results": 5}'

Brave-compatible (agents that support BRAVE_BASE_URL):

curl -sS 'http://127.0.0.1:8787/res/v1/web/search?q=vector+databases&count=5' \
  -H 'X-Subscription-Token: local-dev-token'

Endpoints

Endpoint Description
POST /v1/search Normalized search
POST /search Tavily-compatible
GET /res/v1/web/search Brave-compatible
GET /v1/status JSON status with budget
GET /dashboard HTML dashboard with pool health
GET /playground Visual search test page
GET /healthz Liveness probe

Routing Policies

Policy Behavior
exhaustion_aware Prefer accounts resetting soon — use it or lose it. Best for free-tier pools.
quota_aware Alias for exhaustion_aware.
priority Highest priority first.
round_robin Rotate across ready providers.

Set in config.json: "routing": {"policy": "exhaustion_aware"}

When a provider returns 429, it enters cooldown and NexusProxy falls back to the next ready account. No request is wasted if another account can serve it.

Providers

Built-in adapters with free tiers:

Provider Free tier Adapter
Brave Search $5/month credit per account brave
Tavily 1,000 queries/month tavily
Serper 2,500 queries/month serper

Each adapter is ~100 lines. Add custom providers via type, endpoint, and apiKeyEnv in config.

Config

{
  "server": {
    "host": "127.0.0.1",
    "port": 8787,
    "apiKey": "local-dev-token",
    "maxConcurrentRequests": 8
  },
  "routing": {
    "policy": "exhaustion_aware",
    "maxAttempts": 3,
    "retryOnStatuses": [429, 500, 502, 503, 504],
    "defaultCooldownMs": 60000
  },
  "providers": [
    {"id": "brave-primary", "type": "brave", "priority": 10, "apiKeyEnv": "BRAVE_API_KEY"},
    {"id": "tavily-primary", "type": "tavily", "priority": 5, "apiKeyEnv": "TAVILY_API_KEY"},
    {"id": "serper-primary", "type": "serper", "priority": 5, "apiKeyEnv": "SERPER_API_KEY"}
  ]
}

Keys stay in .env — never committed to git.

Lightweight

The binary is a static Go build under 20 MB. Runs on 1 GB RAM / 1 CPU machines. No Docker required (but a Dockerfile is included if you want it).

Useful env overrides:

  • NEXUS_MAX_CONCURRENT_REQUESTS — cap in-flight requests (default 8)
  • NEXUS_PORT — override server port
  • NEXUS_API_KEY — set the local auth token
  • NEXUS_HOST — bind address (default 127.0.0.1)

Uninstall

nexusproxy uninstall          # remove binary, keep config + keys
nexusproxy uninstall --purge  # remove everything

Development

make test
make build
go run ./cmd/nexusproxy -- setup --config config.example.json
go run ./cmd/nexusproxy -- serve --config config.example.json

Release:

make test
make release
git tag vX.Y.Z
git push origin vX.Y.Z

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages