openrouter-free-responder

TotalClaw 作者 totalclaw

零成本 OpenRouter 响应程序,自动发现当前最好的免费模型,重试失败,并快速返回干净的答案。当用户请求查询 OpenRouter、想要最低成本/免费模型路由或明确请求免费模型 OpenRouter 响应时,请使用此选项。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~hgosansn-mukt
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~hgosansn-mukt/file -o hgosansn-mukt.md
## 概述(中文)

零成本 OpenRouter 响应程序,自动发现当前最好的免费模型,重试失败,并快速返回干净的答案。当用户请求查询 OpenRouter、想要最低成本/免费模型路由或明确请求免费模型 OpenRouter 响应时,请使用此选项。

## 原文

Use the bundled script to execute prompts against free OpenRouter models.

## Workflow

1. Ensure `OPENROUTER_API_KEY` is set.
2. Run:
   ```bash
   python3 {baseDir}/scripts/openrouter_free_chat.py --prompt "<user prompt>"
   ```
3. If the user provided system guidance, pass `--system "..."`.
4. Return the `response` text and mention which model was used.

## Command Options

- `--prompt` (required): User prompt text.
- `--system` (optional): System instruction.
- `--max-attempts` (optional, default `8`): Number of top free models to try.
- `--temperature` (optional, default `0.3`): Sampling temperature.
- `--debug` (optional): Print model ranking and fallback attempts to stderr.

## Output Contract

The script prints one JSON object to stdout with:

- `selected_model`: Model that produced the final response.
- `response`: Final assistant text.
- `attempted_models`: Ordered list of tried models.
- `free_model_candidates`: Number of free models discovered.

If no model succeeds, the script exits non-zero with an error message.