Skip to content

StanleyChanH/OpenRouter-Free-Catcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenRouter Free Catcher

OpenRouter Free Catcher

Web UI + OpenAI-compatible API proxy for OpenRouter free models, auto-selected by Top Weekly ranking.

Features

  • Auto model selection — Picks the highest-ranked free model from OpenRouter's weekly leaderboard
  • OpenAI-compatible API — Drop-in replacement for /v1/chat/completions and /v1/models
  • Web UI — Browse free models, configure API key, test chat in browser
  • Streaming support — SSE streaming for real-time responses
  • 5-min cache — Model list cached to reduce API calls

Quick Start

pip install -e .

Set your OpenRouter API key:

export OPENROUTER_API_KEY="sk-or-..."

Start the server:

python -m catcher

Open http://localhost:8000

API Usage

List free models

curl http://localhost:8000/v1/models

Chat completion (auto model)

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Hello!"}]}'

Chat completion (specific model)

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -d '{"model":"qwen/qwen3.6-plus:free","messages":[{"role":"user","content":"Hello!"}]}'

Streaming

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Hello!"}],"stream":true}'

Endpoints

Endpoint Description
GET / Web UI
GET /api/models Free models with full details (ranked)
GET /v1/models OpenAI-compatible model list
POST /v1/chat/completions OpenAI-compatible chat proxy

Configuration

Variable Description Default
OPENROUTER_API_KEY OpenRouter API key (or pass via Authorization header)

Tech Stack

  • FastAPI — async web framework
  • httpx — async HTTP client
  • uvicorn — ASGI server

License

MIT

About

OpenAI-compatible API proxy for OpenRouter free models. Auto-selects the top-ranked free model each week. Includes web UI.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors