Source: https://seerepo.com/compare/chaitin/SafeLine/vs/Wei-Shaw/sub2api
Markdown source: https://seerepo.com/compare/chaitin/SafeLine/vs/Wei-Shaw/sub2api.md
Description: SafeLine and sub2api share 3 technologies: Gin, Postgres, and MCP. Both are written in Go.

# SafeLine vs sub2api

SafeLine and sub2api share 3 technologies: Gin, Postgres, and MCP. Both are written in Go.

- [chaitin/SafeLine](https://seerepo.com/r/chaitin/SafeLine): SafeLine is a self-hosted WAF(Web Application Firewall) / reverse proxy to protect your web apps from attacks and exploits.
- [Wei-Shaw/sub2api](https://seerepo.com/r/Wei-Shaw/sub2api): Sub2API 一站式开源中转服务，让 Claude、Openai 、Gemini、Grok订阅统一接入，支持拼车共享，更高效分摊成本，原生工具无缝使用。

## What they share and what sets them apart

- In common: Gin, Postgres, MCP
- Only in SafeLine: gorm.io/gorm, github.com/pquerna/otp, github.com/sirupsen/logrus, go.uber.org/zap
- Only in sub2api: Vue, Vite, Redis, Stripe

## Side by side

| | SafeLine | sub2api |
|---|---|---|
| Size | 14,197 lines written, 109 code files | 1,182,759 lines written, 1,683 code files |
| Who writes it | 0.4% of its commits signed by AI. With Codex | 17.7% of its commits signed by AI. With Codex, Claude Code, Cursor, Gemini CLI, GitHub Copilot, and Factory |
| Activity | Last push October 22, 2026, 783 commits, 23,167 stars | Last push October 30, 2026, 5,448 commits, 45,171 stars |
| Tests | 12 test files. 12.8% of its code files have a test that imports them | 2,018 test files. 79.3% of its code files have a test that imports them |

- Size: Lines written by people and agents, without generated ones; code files, without tests.
- Who writes it: A commit counts as AI's when it carries its signature: a Co-Authored-By line, its author name or the merge of its branch.
- Activity: From GitHub and its history, on the day SeeRepo read it.
- Tests: The files that test the code, and the share of code files a test imports.

## Frequently asked questions

### Which is bigger, SafeLine or sub2api?

sub2api, with 1,182,759 lines written; SafeLine has 14,197.

The proof: [Wei-Shaw/sub2api's code at commit d851a38](https://github.com/Wei-Shaw/sub2api/tree/d851a38477597157e78450d30af2d8504764d085)

### Which has more GitHub stars, SafeLine or sub2api?

sub2api, with 45,171 stars; SafeLine has 23,167.

The proof: [Wei-Shaw/sub2api on GitHub](https://github.com/Wei-Shaw/sub2api)

### Which has more tests, SafeLine or sub2api?

sub2api, with 2,018 test files; SafeLine has 12.

The proof: [Wei-Shaw/sub2api's code at commit d851a38](https://github.com/Wei-Shaw/sub2api/tree/d851a38477597157e78450d30af2d8504764d085)

### Which was updated more recently, SafeLine or sub2api?

sub2api: its last push was on October 30, 2026, and SafeLine's on October 22, 2026.

The proof: [Wei-Shaw/sub2api's commits on GitHub](https://github.com/Wei-Shaw/sub2api/commits)

### Which has more commits signed by AI, SafeLine or sub2api?

sub2api: an AI signed 17.7% of its commits, with Codex, Claude Code, Cursor, Gemini CLI, GitHub Copilot, and Factory; in SafeLine, 0.4%.

The proof: [the commits each tool signed in Wei-Shaw/sub2api](https://seerepo.com/r/Wei-Shaw/sub2api/ai)

## Sources

- chaitin/SafeLine: Read on November 4, 2026, at commit 9b72ba6 (https://github.com/chaitin/SafeLine/tree/9b72ba6ad4d7e042e7a79ee2e062305179312c98)
- Wei-Shaw/sub2api: Read on October 31, 2026, at commit d851a38 (https://github.com/Wei-Shaw/sub2api/tree/d851a38477597157e78450d30af2d8504764d085)

## What is your repo built with?

Any public repo, with no account: https://seerepo.com/r/owner/repo/built, with the owner and name it has on GitHub.
