lza6

Tryingopen 2api — Development skill for Claude Code

Development community

Tryingopen的免费网页对话能力转为本地网关,供给Claude code、codex等使用.

How to install Tryingopen 2api

This entry records only its repository, not the path inside it, so there is no exact command to give. Open lza6/Tryingopen-2api and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Tryingopen 2api does

Tryingopen的免费网页对话能力转为本地网关,供给Claude code、codex等使用.

Alternatives in Development

  • Auto Update — Pull the latest ECC repo changes and reinstall the current managed targets 243.5k ★
  • Sharing Skills — skill for guidance 115.1k ★
  • Template Skill — Minimal skeleton for a new skill project structure 97.5k ★

README

TryingOpen2API

Rust(axum) 版。上游协议逆向笔记: [docs/PROTOCOL.md](docs/PROTOCOL.md)

TryingOpen2API 把 [tryingopen.com](https://www.tryingopen.com) 免费层的开源模型(内置 12 个 + 动态目录)逆向为 **OpenAI 兼容**与 **Anthropic 兼容** 的本地 API 网关。单二进制、零外部依赖,可在任意 OpenAI/Claude 客户端(Claude Code、Codex、Cursor、LobeChat、NextChat 等)中使用 TryingOpen 免费模型。

**完全匿名**:tryingopen.com 的所有对话端点不需要 Cookie / 登录 / API Key。站点按「每 IP 每日约 20 次」限流(代理池轮换出口缓解),网关内置 **代理池自动故障轮换**(住宅代理文件 + 免费代理抓取双源,429 自动冷却换出口,指数退避重试,直连兜底)。

本项目是把 `imagefree-2ai` 里的 tryingopen 提供商 + 代理池单独抽出,按 `tokenharbor-2api` 的架构重写的独立网关。抓包与站点 JS 已随附在 `源代码、网络数据包/`。

**v0.1.17(面板轮询合并 + 移动端 + 压测基线 + 安全加固)**:面板状态轮询合并(消除双刷新闪烁)、移动端粘性表头/≥44px 触摸目标、动态目录保留静态 messageLimit/cheaperFallback 兜底、面板 key 注入 XSS 修复、限流归属防嫁祸、日志脱敏覆盖连字符 key、压测基线刷新 + lto thin/fat 对比。此前已含:模型能力字段透传(思考/消息数上限/降级建议)、429 按上游建议模型自动降级、每 key 用量统计(/api/usage)、请求日志结构化 JSON、config.local.json 局部覆盖、代理池 44 源(免费源抓取,单轮预检注入上限 4500)、低延迟优先 + 并发门控、工具调用转换、思考解析、effort 透传、多模态、模型下线自动降级、UI 容量实时显示。


一、快速开始(3 步)

第 1 步:编译

# Windows
build.bat

# 或手动
cargo build --release
./target/release/tryingopen2api.exe --config config.json

默认监听 `http://127.0.0.1:47831`(与 tokenharbor2api 的 47830 错开)。

第 2 步:可选配置代理池

编辑 `config.json`:

{
  "proxy_file": "data/proxies.txt",        // 住宅/自备代理,每行 http://user:pass@host:port
  "free_proxy_enabled": true,              // 开启免费代理抓取(默认 true,44 源)
  "hourly_per_ip": 20,                     // tryingopen 单 IP 每日限流
  "max_attempts": 3,                       // 每请求最多换几个出口
  "direct_fallback": true                  // 全部代理失败后直连兜底
}

不配代理也能直接用(本机 IP 每日 20 次额度)。

第 3 步:接入客户端

**OpenAI SDK(Python)**

from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:47831/v1", api_key="sk-local")
resp = client.chat.completions.create(
    model="qwen/qwen3.8-27b",
    messages=[{"role": "user", "content": "你好"}],
)
print(resp.choices[0].message.content)

**Claude Code**(Anthropic 协议)

export ANTHROPIC_BASE_URL=http://127.0.0.1:47831