This tutorial demonstrates how to install and configure OpenAI Codex CLI tool to work with OpenRouter's free AI models, enabling users to access coding assistance without using OpenAI's paid services. The process involves installing Codex from the official OpenAI developers page, creating an OpenRouter account to obtain an API key, configuring the Codex config.toml file to use OpenRouter as the model provider, and setting the API key as an environment variable. Users can then run Codex commands in their project directory to interact with free AI models like minimax M2.5 for coding queries.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
OpenAI Codex with OpenRouter Free Coding AIAdded:
Hello everyone. In this video, I will show you how to use the Gordex PLI tool room for free with open router AI models. You know the open router is a unified interface or LLMs. It provide us the AI and we will get API key from open router and we will use codex. So first of all we need to install codex on our AC. The codex is a coding agent like as you know like the code. So let's first of all install Cordix. To install Cordix simply let's search bar Cordix installation an browser then open the first one cordex cli open this link which is developers openai.com come down in this page you will see here the cli setup and here we can copy this command let's copy this command and open powershell our command and prompt right click and install codex on your machine.
After the codeex installation completed, now we will verify it. So to verify it, simply let's once again run PowerShell write codeex hail and we will see a list of ammar. It means that the codeex installed successfully and correctly. Look at you will see a list of commands. That's it.
The second step to use it with open router or let's simply search here Cordex with open router and you will see the open router website which is the title is integration with Cordex CLI. Let's click on this link and we will move down. Here you can see the steps like the first step is install kuric clivo installed. Second one is to create a open router account and get api key. So let's create open router account. Come here to the open router website and create your account here.
After getting your account we can get API key from here. Get API key or we can move here to the dashboard. Simply here we can generate a new API key. So we generate it later. From here back to the steps and configure cordex for open router. So to configure a cordex per open router it says create or use config toml file in it which is located in codex folder. So for support we will find the codex on Linux and Mac you can check in the route uh in the root folder find codex codeex folder and config if this file was not existed you can create your let's copy this now we can move to the C drive users your username find codex folder after finding the codeex folder if this uh config file was not existed you can create by your own but the extension will be eoml so let's come here and open it with v is code editor whatever was here just remove that okay who already configured that copy your new copied code look at the model provider is open router and paper is high and model so instead of using this model we will use our own model from open router work. So let's copy the name app model. I made to the open router and the models.
Now we will search here for free because it provide us lots of free models. You can see the list of these premodel but we will use the best one which is open router. I will do R21.
Find the open router.
Let's see not exit are free and use.
So we will use one of these models like which one do you prefer? So just simply use that like let's copy this miniax M2.5. Copy this name. Just copy. Look at this name. Here you can see the copy button. Copy that name in paste that here and see the model is minimax miniax M2.5.
Save it. Now let's name open router base URL. It's this. Yeah, by default that's okay. But now we need environment key.
So for the environment key, let's move back to the step four and the integration p. You can set up your API key. So on Mac uh Linux, you can use this export. But on uh Windows, we will use set. So simply let's first I'll copy API key. Let's come to the dashboard with the API key on left side and here we will create a new API key that is testing.
I will put the expiration 1 hour because one after 1 hour it will expire.
Let's now copy this API key. So after copying the API key now let's open PowerShell our command prompt.
After opening the command prompt, let who's set our sit expert permanent and copy this open router AI key and paste it here. Now we will paste here the API key. Just come here and copy this API key and here is that command prompt. Right click and close the quotation. So it was all about this. Press enter. If you don't want like this, you can move to the environment variable. Look at edit system environment variable. Environment variable. Simply come here a new environment variable like open router.
Let's edit it. The name will be open router API key and the value will be your API uh video. That's it. Okay.
Okay. And okay, that's it. The whole setting is like this. Now we will use cortex. We have done everything. We have completed the four steps here to start codex. So to start codex, move to your project and write codeex command. So let's open a folder.
Oh, this is an empty folder. Right click here in open in terminal or here you can write m at the address bar.
Oh, simply now let's write cordex command. Press enter. So it says do you trust and directory to access directory?
Yes. So you might face with the setup.
So just select the first one on that and box is ready. Now what else we need to just simply ask from this if you paste with sign in or something like put your API key at the first time you install codex just quit that. Okay, we don't need to sign in and use the GPT account or API key from GPT uh open AI because you want to set up with open router. So do whatever I implemented in this video. Simply let's write now.
Hey, how are you? Hey, what is what is JavaScript? Simple like that. So now look at it is using Minia the model at the top. You can see minimax M2.5B and it's working. Now it will just run our query.
You can see the response JavaScript is a programming language that is primarily used for making pages interactive like something like this. And see that is how you can use Kodic CLI parfree with open router AI models. Uh whatever you want know you can create your project uh Xbox using open router with codec cla like button and also leave a comment if you have any issues with this and subscribe to our YouTube channel for more videos like this AI and web. See you in the next video.
Related Videos
VALORANT's Latest 'Exclusive' Tier Bundle is Rough...
KangaValorant
17K views•2026-05-28
Flight Attendant Mocks Poor Looking Black Woman — Mid Air Announcement Exposes Her Real Power
SkyboundStories-b4r
184 views•2026-05-28
I FIXED My Friend’s Blown Turbo RX-8… Then Sold It
Cameron-RX8
134 views•2026-05-28
NewsWatch 12 at 5: Top Stories
NewsWatch12
1K views•2026-05-28
Simon Jordan & Danny Murphy deliver PREDICTIONS for Arsenal's Champions League FINAL with PSG
talkSPORTArsenal
6K views•2026-05-28
Botting is OUT OF CONTROL in Classic WoW (Again)...
SolheimGaming
108 views•2026-05-28
The "AI Job Apocalypse" is CANCELLED!
WesRoth
9K views•2026-05-28
STREET FIGHTER 6 - INGRID Story Walkthrough @ 4K 60ᶠᵖˢ ✔
RajmanGamingHD
12K views•2026-05-28











