AI Income LabJoin AI Income Lab ↗

Pi coding agent test: npm install, OpenRouter and models

Jump to video chapters

Watch on YouTube ↗ Subscribe on YouTube ↗

By · · 9:07 · 6,618 views

Written guide: Pi.dev Terminal Coding Agent: Install, OpenRouter and Costs

Install the open-source Pi terminal coding agent with one npm command, connect it to OpenRouter with an API key and run a site audit on a real project. The test runs into slow models, a negative OpenRouter balance and a rate limit error on Gemma 4.

Video summary

Need a fast open-source AI coding agent without a heavy IDE? Full Pi.dev setup below.

The video covers 11 parts: Introduction to Pi.dev: The Minimal Coding Harness, How to Install Pi via NPM, Setting Up Open Router & API Key Configuration, Choosing the Right Model (Gemma, Deepseek, Llama), Pi.dev vs. OpenCode: Initial Comparison, The Performance Advantage of Terminal Coding Agents, Running a Technical SEO & Schema Audit, Monitoring Session Tokens and Real-Time Costs, Connecting External Subscriptions (Claude Pro, Copilot), Integrating Google Claude Code Assist, and Final Verdict: Is Pi.dev Worth the Switch?.

What this video covers

What you build

Nothing is built from scratch. The video shows Pi installed, connected to OpenRouter and Google Cloud Code Assist, and used to start a technical SEO audit on an existing SaaS project.

Tools used

Compare pricing: OpenCode. Some ↗ links are affiliate links, so I may earn a commission or credit. See every tool I recommend →

Key steps

Not covered

Summary written from the video's transcript and chapters.

In this video

  1. 0:00 Introduction to Pi.dev: The Minimal Coding Harness
  2. 0:25 How to Install Pi via NPM
  3. 1:30 Setting Up Open Router & API Key Configuration
  4. 2:27 Choosing the Right Model (Gemma, Deepseek, Llama)
  5. 3:12 Pi.dev vs. OpenCode: Initial Comparison
  6. 4:40 The Performance Advantage of Terminal Coding Agents
  7. 5:29 Running a Technical SEO & Schema Audit
  8. 6:07 Monitoring Session Tokens and Real-Time Costs
  9. 6:44 Connecting External Subscriptions (Claude Pro, Copilot)
  10. 7:18 Integrating Google Claude Code Assist
  11. 8:31 Final Verdict: Is Pi.dev Worth the Switch?

Questions and answers

How do you install Pi?

Run the one-line npm install command from pi.dev in your terminal, then type pi to open the command line interface.

Can Pi use a Claude or Copilot subscription instead of API credits?

Yes. The login command has a use subscription option that lists Anthropic Claude Pro or Max, GitHub Copilot, Antigravity Gemini and Google Cloud Code Assist.

Does Pi work with free models on OpenRouter?

A free Gemma 4 model starts running, but it later returns a temporarily rate limited error, so Mike switches to a paid low-cost model.

Gemini Code Assist for individuals

Google has deprecated Gemini Code Assist for individuals. Google’s documentation says that starting June 18, 2026, Gemini Code Assist IDE extensions stopped serving requests for the Gemini Code Assist for individuals, Google AI Pro, and Google AI Ultra tiers. Login with Google no longer works for those IDE extensions or Gemini CLI. Read Google’s deprecation page.

Transcript

Hey there, welcome to the channel. In this video, I'm going to be showing you how to get started with an open-source AI coding agent called pie. The website's pie.dev. I've got it pulled up here. They currently have around 35,000 stars over here on GitHub. And in this tutorial, I'm just going to be showing you how to get started using it. So, to get started, all you have to do is run this one-line npm install command. So, I'm going to come over to my terminal.

We're just going to run that, and it will install pie. While that's running, we can read through the website. Pie is a minimal terminal coding harness. You can adapt pie to your workflows, not the other way around. You can extend it with TypeScript extension skills, prompts, templates, and themes. You can also bundle them as pie packages and share them. Pie ships with powerful defaults, but skips features like sub-agents and plan mode in order to keep it more lightweight.

Read the rest of the transcript

And you can ask pie to build what you want or install a package that does it your way. Includes 15 plus providers, hundreds of models, Anthropic, which is Claude, OpenAI ChatGPT, Google Gemini, Azure Bedrock, Mistral, Grok, and a whole bunch of other ones, including OpenRouter. So, now that this is installed over here in the terminal, I'm just going to run pie. And it will open up the command line interface. This is what it looks like. Honestly, I definitely prefer OpenCode.

Just looks a bit more clean, but we'll see what this can do. I'm just going to go ahead and type login here, and then we can use an API key. This is OpenRouter. And in order to get started with this, all you need to do is grab your API key. So, I'm just going to go ahead and create a new API key here, and we'll copy and paste that. I'm just going to paste it in over here.

So, that saved the API key, and it selected a model. In this case, we're using Kimi 2.6. Not exactly sure how well you can read that because of my terminal settings. But now, if we go ahead and select a model, we can choose any of the models from here. So, in this case, it's using Kimi 2.6. We can also use Alibaba, Amazon, Nova has a model. We've got Anthropic in here, which I would like to avoid using because I'm constantly hitting rate limits on this one.

But if we did want to use that through OpenRouter, we could do that as well. ByteDance, which is the company that makes TikTok, they have a model. DeepSeek, which is Chinese company, they have a model in here. Gemini, uh we've got over 252 models, including Meta Llama, Mini Max, we've got Mistral in here. Uh Nvidia has a model as well. OpenAI, you can add that model.

And now, we can say, "Run a full site audit." And since I'm already in my working directory for my software as a service, it's just going to go ahead and run a full site audit. You can also extend this with skills. As you can see, I already have a lot of my skills in here already. So, if I wanted to, let's say, optimize my website for search engine visibility, I could just go ahead and run that skill, and we'll see how fast this works because it

does seem a bit slow. It's taking quite a while to actually get these things executed. Whereas, if I come over here to OpenCode, I can just do this quickly and easily. Come over to skills, search for SEO, and then we can run that plan. All I'm going to do is type in my URL right here. So, overall, I'm really, really happy with OpenCode, but I did just want to try to test out pie. I could go ahead and switch the model.

So, if I wanted to switch over to, like, you know, OpenAI Codex, for example, and we'll see if this is a bit faster. Yeah, it definitely seems faster. So, I was limited by the model that I was on, which was very slow. And I'm just going to go ahead. Well, it looks like I actually ran out of credits over here on OpenRouter, unfortunately. So, if I come over to credits here, yeah, my balance is currently negative, so I would need to add credits to this.

But I would rather just stick with one of the free models. We've got a whole bunch of them to choose from. We could also use Gemma as well, which is built into OpenRouter. So, if I wanted to use that one, we could just select the 31 byte model, and just say continue. We'll see if this actually works. Ah, so that's definitely encouraging. I've been having a lot of issues with running Gemma 4 through OpenRouter. For some reason, it's in Spanish right now, or some other language.

I'm not exactly sure why. So, I may have selected the wrong model, but it is running. So, that's definitely encouraging. We'll see if we can do this site audit. And one of the really nice things about running these in the terminal versus something like VS Code or Google Antigravity or Cursor is that it uses a lot less resources. So, you can see my console is running right here.

And if I were running this in VS Code, it would be using a lot more memory and a lot more CPU. So, I really just prefer to run this in the terminal. And now, we're just going to continue running that, and you can see it is just going ahead and fixing up some of these things right now. So, right now, it's reading the layout.tsx file, and it's going to optimize some of these things real quickly as well.

Now, this is the first time that I've actually run Gemma 4. I've had issues with with it before through OpenRouter, but it looks like now in pie.dev, it's running no issue whatsoever. Now, you can see it's starting its execution plan. It's going to perform the following specific edits to optimize site. It will optimize the landing page copy. It's going to enhance image components, audit in the platform showcase, and this is what it's going to do step by step.

In this particular case, I don't think I'm going to continue doing that because it's already really, really well optimized for SEO. But if I did want to do, like, a schema markup on the site and audit the schema, I could also do that as well using one of the built-in skills that I've already installed across all my IDEs and coding agents, including pie is built in directly. And we can also see some of the other commands that we can run as well.

So, if we want to run a session command, we can do that. Just session, and that will show the number of messages that I've sent, the number of tokens I've used, and the total cost, which is currently only .1 in pie. So, it's really, really cost-effective, and that's just through the OpenRouter model. Uh if I wanted to change to a different model, I could obviously just come over to models here, and we could also use my Claude Sonnet 4.6 as well. That would be through OpenRouter.

It wouldn't be the one through my subscription. If I did want to connect a model using one of my subscriptions, I could do login, and then I could select use subscription right here. So, that would allow me to connect my Anthropic Claude Pro or Max account. I could also use Antigravity Gemini 3, GitHub Copilot in here as well. Or I could use something called Google Claude Code Assist, which is like a Gemini command line interface.

So, if I want to do that, I could just click on this, and that's going to authenticate it over here in the browser. Just going to sign in right here, and it says authentication successful. So, now we've also got the Google Claude Code Assist built into this as well, and it's just going ahead and doing everything for me. And again, we're using a very, very small amount of credits. Looks like it is actually dipping down.

So, I would need to add some more credits, which I could just do right here. I'm just going to add, let's say, five bucks of credits, and that way I'm not negative. So, we'll just purchase that with my PayPal debit card. And that should go through right away. Payment processing, and now I've got $4.83 of credits. So, again, Gemma is a very, very efficient model. If I wanted to switch over to the Gemma 4 free plan, I could go ahead and do that.

And then now, I can just read what it wants to do over here for the technical SEO audit. This is going to fix up some of my schema. If I wanted to do that, I could just say continue, and hopefully this model will be able to go through no issue whatsoever. But again, I am getting this error right here. The provider returned an error, and it says "Temporarily rate limited." So, that's the issue that I've been having before with Gemma.

I'm just going to switch once again over to this model, which is also very affordable, and we can do continue, and I shouldn't hit any rate limits this time. Should go through right away. And now, it does have some credits to pull from over here as well. And I can also turn on auto top up if I just want to make it top up automatically, which I'm going to go ahead and do.

And then then, it will just automatically top up anytime I run out of credits. So, overall, I'm pretty impressed by pie.dev, and that's pretty much all there is to it for this video. Please go ahead, subscribe to the channel if you haven't already, and we'll let this run. I will see you in the next tutorial. Take care, stay safe. Peace from Thailand, signing off.

Not ready to join? Get the weekly build notes: new guides and tested builds in one short email.

You may also like