Video: 9Router 3-tier fallback, OAuth and Tailscale
Watch on YouTube ↗ Subscribe on YouTube ↗
Install commands, port 20128 and skip-update are in the 9Router setup guide. This page is the recorded walkthrough.
Set up 9Router, connect a provider, and check that requests reach the gateway. Build notes cover model selection, usage verification, and fallback limits.
Video summary
9Router tutorial: set up the open-source AI gateway that auto-routes across 60+ providers (Claude Code, Codex, Gemini, DeepSeek) by cost, speed, and availability. How to use 9Router — install, web dashboard, OAuth providers, API keys, Tailscale tunnel, and live fallback routing.
Want free Claude Code / cheaper AI credits with automatic provider fallbacks? Full 9Router setup walkthrough below.
The video covers 11 parts: Claude Fable 5 updates and credit limitations, Overview of 9Router Gateway, How the 3-tier automatic fallback routing works, Installing 9Router via terminal command line, Initializing the 9Router web interface server dashboard, Connecting free tier and OAuth providers (OpenCode, Claude Code), Authenticating OpenAI Codex and adding model API keys, Activating Caveman Skill and Ponytail features to save context credits, Installing Tailscale to configure local tunnel access, Configuring the .json files and testing live routing changes, and Tracking live token usage, fallback routing, and cost analytics.
What this video covers
What you build
A local 9Router gateway between coding tools and 60 or more model providers, with three-tier fallback from paid subscriptions to cheap models to free ones, plus a dashboard for token and cost tracking.
Tools used
Key steps
- 0:30 - See what 9Router is and how requests are routed.
- 1:19 - Understand the three-tier automatic fallback.
- 2:14 - Install 9Router from the command line and open its dashboard.
- 3:24 - Connect free tier and OAuth providers, then Codex and API keys.
- 6:08 - Turn on the Caveman and Ponytail skills to save context credits.
- 7:22 - Install Tailscale for tunnel access.
- 9:55 - Track live token usage, fallbacks and costs.
Not covered
- A measured saving. Costs are only shown live in the dashboard.
- Provider prices, which change often.
In this video
- 0:00 Claude Fable 5 updates and credit limitations
- 0:30 Overview of 9Router Gateway
- 1:19 How the 3-tier automatic fallback routing works
- 2:14 Installing 9Router via terminal command line
- 2:38 Initializing the 9Router web interface server dashboard
- 3:24 Connecting free tier and OAuth providers (OpenCode, Claude Code)
- 4:44 Authenticating OpenAI Codex and adding model API keys
- 6:08 Activating Caveman Skill and Ponytail features to save context credits
- 7:22 Installing Tailscale to configure local tunnel access
- 8:46 Configuring the .json files and testing live routing changes
- 9:55 Tracking live token usage, fallback routing, and cost analytics
Questions and answers
What does 9Router do?
It sits between your coding tools and providers and picks a model by cost, speed and availability, falling back automatically when one runs out of credits.
What are the three tiers?
Paid subscriptions first, cheap models second and free or low-cost options third, as described in my walkthrough.
How is it installed?
With a terminal command, after which a web dashboard opens where providers are connected.
Keep learning
Build notes: verify your first routed request
This walkthrough connects coding tools to a local 9Router gateway. The useful checkpoint is a request appearing in the gateway’s usage dashboard: a connected provider alone does not prove that your client is routing through it.
Before you start
Have Node.js/npm, a coding client, and access to the provider you intend to use. Follow the project’s current installation instructions. Provider availability, authentication methods, quotas, and prices can change. Keep the first test local and configure your own dashboard password.
Follow the setup
- Start 9Router and open its local dashboard. Connect one provider using the authentication method that provider supports.
- Select a model exposed by that connection. In this walkthrough, the client initially uses a different model from the ones configured in the gateway.
- Set the client’s base URL to the gateway endpoint and copy the gateway’s model identifier and client API key. Keep upstream provider credentials in the gateway rather than confusing them with the client key.
- Send one small request, then inspect the usage tab for the selected model, input/output tokens, and any reported cost. If nothing appears, check the endpoint and model mapping before adding more providers.
What the walkthrough establishes
After updating the client configuration and model selection, Mike reports that token usage and cost entries appear in the 9Router dashboard. That is the demonstrated integration checkpoint. The walkthrough discusses fallback routing, but does not establish a controlled outage test across every tier or a measured cost saving.
Tailscale and tunneling are explored in the video; they are not part of the local request exercise here. Only add remote access when your project needs it.
Try the prerequisite, then test your gateway
The first API request guide includes a free local mock that exercises success, authentication, and unknown-model responses. It does not call 9Router or an AI provider. After that exercise, repeat a small request against your actual gateway and verify its logs.
Transcript
Looks like we have good news coming out of Enthropic. I've got the official tweet pulled up here. It says they're extending access to Claude Fable 5 on all paid plans, including Pro, through July 12th. So, you're going to have another 4 days to play around with it before you're going to have to start using API usage credits. This post currently has 9 million views. My credit usage is going to reset on July 11th, so potentially I have about a day to play around with Fable 5.
And I got to thinking, why not find a solution to automatically switch between different coding models and I found a solution over here. It's called 9Router. And essentially what this is is a smart gateway between your tools. So it could be cursor, Claude Code, Codex, client, copilot, and 60 plus other AI providers. And it provides a three tier system. So when you run out of models on the paid subscription like Claude Code, Codex, Gemini, or Copilot, it'll automatically roll down to tier 2.
Read the rest of the transcript
So that would be the cheap models like GLM 5.2, Miniax, M3, Kimi code, which is only $9 a month. And then when you run out of credits on those, it will automatically switch down to tier three, which could be like Quinn code, curo, OpenCode, which I use very, very often. This basically just explaining how 9Router works. You issue your request via the 9Router API which we're going to set up in this tutorial.
It will then automatically kick in the smart routing to analyze the cost, speed, reliability, and availability in real time. And then the request is routed to the best model you get and then you get the response. If we scroll down, you can see here's all of the free models that are built in to 9Router. And then you've got your OOS subscriptions. So again, that's Claude Code, Codex, copilot, cursor, KiloCode, client. There's a bunch of different options to choose from.
And then you've also got your models with API keys as well. That could be DeepSeek, uh, Grok, Kimi, GLM, whatever. And it will automatically route between these models. And this is really good for AI startups that want to build faster, more reliable, cost-effective AI model access, as well as developers, enterprises, and AI agents and apps. Basically, all you need to do is run this npm install command over here. So, I'm just going to come over to the terminal. We're going to run npm install 9 routouter.
And then from there, we pretty much just have to run it. And we can start connecting up our providers. So, I'm just going to start it up over here. We'll start up 9Router. That's just going to start it up. And now we've got access to our interface. This is the server. So, if I want to go ahead and open this up, we can take a look. And it's just asking me to log in. So I would need to create a password.
Uh I'll just use the default password for now. We can go ahead and log in. And check it out. We're already in here. This is where we're going to set up our providers. We could also use the terminal to do this as well. If we want to use the terminal, you can set up your providers over here. But I kind of like the web interface. So we're just going to be using this. And it looks like I can turn on the tunnel.
If I want to turn on a tunnel, I can start that. And then I can turn something else on called tail scale. I'm not exactly sure what that is. Uh but we'll just create the tunnel. And then from there, we can start connecting up our providers. So over here, you can see we've got access to the OOTH providers, the free tier providers, as well as the a API key providers. Um in this case, I just want to set up OpenCode.
And it looks like it's already connected. No authentication required because I've already got it installed on my computer. And then from here, I can also set the model. So, I'm going to set Big Pickle, which is completely free. We've also got DeepSeek V4 Flash, which is also free. Neotron 3 Ultra free. Uh, we could put MIMO in there as well. And then I also want to connect up KiloCode over here as well. This one has a lot of free models built into it.
So, once again, we can just set those here. And then we can also add the connection. And since KiloCode is already installed on my computer, we should be good to go. Looks like it's authenticated. And then from there, we can also add in any of the models over here. It looks like they're already applied. Uh I can also connect Claude Code from here as well. So I want to make sure to do this. There we go. Authorization successful. So now Claude code is connected up.
I can also ping it from here as well. And we've got access to all the models. So that's Claude Fable 5, which I haven't really been using all that often cuz it just like I say, it blows through credits really quickly. So I'm mostly using Sonnet 5 and Opus 4.8. Those are included in here. And then if we want to add any others, we also have the option to do that. I also want to connect up Codex as well, which is OpenAI's coding platform.
So I'm just going to authenticate with that one as well. There we go. Authorization successful. So now Codex is connected to 9Router. We've got access to all of the models over here. You pretty much just have to configure your command line interface tools. So I've already got Codex connected. Next, I'm going to do Claude Code and then we've also got OpenCode over here. So pretty much all you have to do is grab your API key.
So in this case for OpenCode, I would just go to open codes website and then come on down to API keys and then I could just copy this API key right here. And we're going to paste it in over here. And so now we've got open Codex connected. And next I want to do Claude Code. So we just need to get the API key for Claude Code. We would just come over to platform.cloud.com. And from here we can create the API key.
And then I'm going to enter in the API key for KiloCode. And then we can also select our model as well. So come on down here. In this case, I'm just going to use one of the free models, uh, like Gemini 2.5 Flash. That should be fine. And there we go. So, now we pretty much got all of our, uh, AI coding harnesses connected. And I'd also want to do that for Hermes agent as well, but we can do that later.
Then we can also compress LM output. So, that's using the caveman skill, which is quite useful in order to just save on credits. They have a GitHub over here. It currently has 86,000 stars and you can install it for all the different coding agents. So, this one basically just saves on context and so I definitely want to turn that on. Let's go ahead and turn that on. And then there's something else which you could build in here called ponytail as well.
This one I haven't heard of before. Basically, just like another thing to save on credits. So, we'll go ahead and turn that on. And we can also see our different credit usage over here as well based on you know five five hour weekly session all that stuff from over here. And that looks like exactly what I'm seeing over here in Codex. You can see 21% 5hour limit and then 78% for weekly. So that's looking good.
You can also take a look at your usage within nine route over here as well. So, if I want to test this out and see if it's actually working, I could just come over here and do like a test in OpenCode and we can see if it's actually using N router just by taking a look at the credit usage over here. So, I'll just go ahead and refresh this and see if it's actually using OpenCode in 9Router.
I haven't seen anything yet, but we should start seeing the tokens coming in over here. And then also maybe we need to enable tail scale as well. That's something that I would need to install. Uh, looks like we just have to run this curl command right here. So, I'm just going to run that and then we should be able to install tail scale on my computer. That's what we're doing now. Just go going to go ahead and install tail scale.
And then from there, we should be able to connect it up over here inside the ter inside the browser. Tail scale is now installed. We're just going to go ahead and connect it up. It's already running in my terminal over here and running in the background. So, it's just going to connect up Tailscale and then we should have the tunnel configured. And that's pretty much all there is to it. Now, you've got all of your OOTH providers, your free tier providers, and your API providers connected.
And it will automatically start switching between them. This is the config file for OpenCode. We can see we've got 9Router built in here. And then it's auto it's already pointing to localhost. So basically it needs to be using the models that I've selected over here inside the dashboard. So when you come to providers you can set your different models. So in this case for OpenCode free I would need to be using one of these models in order for it to route through 9Router.
So that's exactly what we need to set up. So basically I would just need to set my model. I'm currently on DeepSeek V4 Pro. I would want to switch over to big pickle. Then I do also want to set up OpenCode go over here as well because that's how you get access to the paid models. And then again I would just need to grab my API key. Going to paste that in.
So now we've also got OpenCode Go connected so it can automatically switch to that model which would be one of the cheap models not the free model. Um so that's good to go. I could also add extra models to this now as well. So, I could use DeepSeek V4 Pro, which is one of my favorites. And we've got GM 5.2 in here. Uh, we could also add like Miniax as well as Miniax 2.7.
All of these, you can just add as many of these as you want. Uh, Deepseek V4 Flash as well. You can see over here, I just set those up and it configured my open.json file over here as well. So, now anytime we use these models, it should be going through 9Router. You can see right here, here's all the different 9Router models I have connected. And I can easily switch between those.
And then if I come over here to usage tab, we can see we are now getting the number of credits that we're using, the ins and outs, and it's all being tracked over here inside 9Router. So that's pretty cool. It's automatically updating the number of usage credits we're running. And you can also see the cost over here as well. We can see everything coming in over here. and it's running deep v4 flash free. Then I could do the exact same thing with codecs as well.
That's pretty much all there is to it. Have fun playing around with 9Router. And also go ahead and check out my Skool community. We've currently got almost 3,000 members over here. It's growing fast. I'm offering a 7-day free trial and then it's $29 per month to start. After that, you can take a look around the classroom with all of the courses, tutorials, and resources. And then also go ahead and introduce yourself inside the community tab. And also check out my website Automoic.
You feel free to book a free consultation call over here and you can just schedule a call and we can talk about how AI can be used to save time and money for your business. So with that being said, thank you so much for watching this video. Please go ahead subscribe to the channel. Take care, stay safe. Peace from Thailand. We'll see you in the next one. Signing off.



