← 回總覽

Sub2API:自建 Claude Code 中转站教程

📅 2026-03-14 10:13 向阳乔木 人工智能 3 分鐘 3227 字 評分: 82
Sub2API Claude Code API 中转 OpenAI 开发者工具
📌 一句话摘要 介绍如何通过 Sub2API 将 OpenAI 等订阅转换为 Claude Code 可用的 API 并自建中转站。 📝 详细摘要 该推文提供了一个实用的技术方案,通过 Sub2API 项目搭建 Claude Code 的 API 中转站。作者详细列出了安装步骤,包括服务器环境配置(Redis、PostgreSQL)、脚本安装、Web 界面配置以及如何将 OpenAI/Gemini 订阅导入并生成可供 Claude Code 使用的 API Key。这为希望在 Claude Code 中使用非原生 API 的开发者提供了便捷的路径。 📊 文章信息 AI 评分:82 来源:
Skip to main content ![Image 1: LogoBestBlogs](https://www.bestblogs.dev/ "BestBlogs.dev")Toggle navigation menu Toggle navigation menuArticlesPodcastsVideosTweetsSourcesNewsletters

⌘K

Change language Switch ThemeSign In

Narrow Mode

Sub2API: A Guide to Building Your Own Claude Code Proxy =======================================================

Sub2API: A Guide to Building Your Own Claude Code Proxy ======================================================= ![Image 2: 向阳乔木](https://www.bestblogs.dev/en/tweets?sourceId=SOURCE_50f62a) ### 向阳乔木

@vista8

Sub2API自建Claude Code中转站,原来这么简单!

甚至能把OpenAI订阅转成Claude Code可用API。

  • 服务器安装好 Redis 和 PostgreSQL,终端执行
curl -sSL raw.githubusercontent.com/Wei-Shaw/sub2a… | sudo bash

安装后会有Web界面,一步步配置数据库、账户等信息。

  • 账户管理->添加自己的OpenAI订阅、Gemini订阅等。
  • 用户管理->给自己账户加足够的钱(否则用不了)
  • API密钥-> 创建API key,导入CC Switch就能用。Show More
!Image 3: 媒体 1

!Image 4: 媒体 2

!Image 5: 媒体 3

!Image 6: 媒体 4

Mar 14, 2026, 2:13 AM View on X

9 Replies

10 Retweets

113 Likes

12.4K Views ![Image 7: 向阳乔木](https://www.bestblogs.dev/en/tweets?sourceid=50f62a) 向阳乔木 @vista8

One Sentence Summary

Learn how to use Sub2API to convert subscriptions from OpenAI and others into Claude Code-compatible APIs and set up your own proxy.

Summary

This tweet presents a practical technical solution for setting up a Claude Code API proxy using the Sub2API project. The author details the installation steps, including server environment configuration (Redis, PostgreSQL), script installation, web interface setup, and how to import OpenAI/Gemini subscriptions to generate API Keys usable with Claude Code. This offers a convenient path for developers looking to use non-native APIs with Claude Code.

AI Score

82

Influence Score 54

Published At Today

Language

Chinese

Tags

Sub2API

Claude Code

API Proxy

OpenAI

Developer Tools HomeArticlesPodcastsVideosTweets

Sub2API: A Guide to Building Your Own Claude Code Proxy |... ===============

查看原文 → 發佈: 2026-03-14 10:13:56 收錄: 2026-03-14 14:00:53

🤖 問 AI

針對這篇文章提問,AI 會根據文章內容回答。按 Ctrl+Enter 送出。