How to Build an AI Token Relay Station in 30 Minutes Using AI

@libapi_
SIMPLIFIED CHINESE2 months ago · May 03, 2026
203K
595
107
33
1.1K

TL;DR

This tutorial demonstrates how to bypass OpenAI authentication hurdles by setting up a Sub2API relay station. It covers server deployment, Cloudflare integration, and using residential proxies to share API access.

Today while using Codex, it kept popping up real-name authentication, and the task would break as soon as it appeared.

This account was given to me for free by my good friend Beibei. It doesn't have a card bound, so I can't use the API key directly.

I can only use authorized login, so I wanted to try using a relay station to share it with my good friends using Hermes.

Step 1:

Buy a server, or if you have an existing service, I just used my VPN server to build it.

It's like killing two birds with one stone. (Server selection) https://www.dmit.io/aff.php?aff=20440

After getting the service, download the SSH Keys and save them; this is your credential to connect to the server. Copy the server IP address.

Open any of your agents, send the file you just downloaded and your server IP to connect to the server.

libapi - inline image

Step 2:

After successfully connecting to the server, find the open-source relay station link you want to install—usually a GitHub link.

I installed Subapi here, which is really powerful because I installed everything on the market today.

Send to the agent: Help me install this service https://github.com/Wei-Shaw/sub2api

github.com (If you don't have a domain, you can stop reading here) - and deploy it to the xxxxsss.com domain. If you don't know how to resolve it, AI will handle the certificates and traffic protection for you.

There's also a secret weapon: let the AI act as a full proxy.

Log in to your cloudflare.com, click the avatar in the top right - click Profile - then click API Tokens.

Find the Global API Key at the bottom and click view; it requires an email verification code.

Get your Global API Key + your email and send them together to your agent.

libapi - inline image

Content sent to the agent:

libapi - inline image

Step 3:

Check your desktop after coming back from dinner; a .md instruction file will appear. Follow the installation instructions to set up the website login. This relay station even has a novice guide; the human-centric design is top-notch, unlike others.

libapi - inline image

Step 4: The most important part

How to bind your OpenAI OAuth authorized login. Log in to your panel and click Account Management.

Follow the steps to select the next step. At this point, it will give you an authorization link; copy and open it on your computer.

Log in to your OpenAI account for authorized login. It depends on your luck; if the authorization fails:

Send the following text to your AI.

  1. Ensure the SSH tunnel is running in the terminal.
  2. Switch the browser to the SwitchyOmega proxy.
  3. Open your panel address.com management panel.
  4. Go to Account ManagementAdd OpenAI Account.
  5. The browser will jump to the OpenAI login page.
  6. Enter the OpenAI account and password to complete the login.
  7. After successful login, the browser jumps to localhost:1455/auth/callback.
  8. Sub2API automatically handles the callback, and the account is added successfully.
  9. Switch back to direct connection and close the SSH tunnel in the terminal.

Gost Proxy

/etc/systemd/system/gost-proxy.service

HTTP Proxy Forwarding Service

Residential Proxy List

/opt/sub2api/residential-proxies.txt

Webshare Residential Proxy

https://www.webshare.io/?referral_code=n0oy56txwyim

libapi - inline image
libapi - inline image

Now you should be able to bind it. Let your agent help you test it. There might be two possibilities:

One is that your agent can call it, but you can't.

Fifth: Possible issues

Sub2API needs to access OpenAI through a proxy, but your Webshare proxies are all blocked by Cloudflare. In this case, go buy residential IPs.

https://www.webshare.io/?referral_code=n0oy56txwyim (Buy 1GB)

Then download and send the file to your agent; it will call the IPs itself.

libapi - inline image

Sixth: Find a panel to import your API key

Share the API key and base URL with your friends. Recommended panel: https://github.com/EKKOLearnAI/hermes-web-ui I've been using it.

libapi - inline image
libapi - inline image
One-click save

Use YouMind for AI deep reading of viral articles

Save the source, ask focused questions, summarize the argument, and turn a viral article into reusable notes in one AI workspace.

Explore YouMind
For creators

Turn your Markdown into a clean 𝕏 article

When you publish your own long-form writing, images, tables, and code blocks make 𝕏 formatting painful. YouMind turns a full Markdown draft into a clean, ready-to-post 𝕏 article.

Try Markdown to 𝕏

More patterns to decode

Recent viral articles

Explore more viral articles