DEV Community

Cover image for I Reallocated $100/mo From Claude Code to Zed + OpenRouter: What Nobody Tells You About Switching AI Tools
Juan Torchia
Juan Torchia

Posted on • Originally published at juanchi.dev

I Reallocated $100/mo From Claude Code to Zed + OpenRouter: What Nobody Tells You About Switching AI Tools

There's a belief baked into the dev community about AI tool subscriptions that is, with all due respect, pretty wrong: that the debate is purely economic.

"Claude Code costs $100/month, OpenRouter is cheaper, do the math." Sure. But that's like saying switching IDEs is about how heavy the executable is. The price is the trigger, not the actual decision.

The real decision is about mental architecture. And nobody wrote about that when the wave of "I left Claude Code" posts hit. I left too. But I took three extra weeks to publish this because I wanted to understand why I switched, not just that I switched.

Claude Code Alternatives and Cost: The Analysis Nobody's Done

Let's start with what's actually true: Claude Code is exceptionally good. If you ever doubted that, you either didn't use it seriously or used it wrong. The agentic integration, how it maintains project context, how it can execute commands and read output without you playing middleware — it's genuinely impressive.

And the $100/month price tag (Max plan) has a logic to it: you're paying for Sonnet 4 and Opus 4 tokens with generous rate limits and a UX that almost never makes you think about the underlying model.

That "almost" matters. We'll come back to it.

When I wrote about the month Anthropic support went dark on me, the core complaint was vendor lock-in and support. But what I left unresolved in that post was this: what happens cognitively when you know every prompt has an invisible cost?

The answer is: you self-censor. You start "saving" good prompts for important projects. You stop exploring. And exploring is exactly where AI delivers its highest value in development.

That's what broke the model for me.

Zed + OpenRouter: How I Actually Set It Up

Zed now supports any OpenAI-compatible provider. OpenRouter exposes exactly that. The setup is surprisingly straightforward:

// ~/.config/zed/settings.json
{
  "assistant": {
    "version": "2",
    "default_model": {
      "provider": "openai",  // Zed uses the OpenAI adapter for OpenRouter
      "model": "anthropic/claude-sonnet-4"  // Still have Sonnet, but now I choose when
    },
    "openai_api_url": "https://openrouter.ai/api/v1",  // This is the trick
    "api_key": "sk-or-v1-..."  // Your OpenRouter key
  }
}
Enter fullscreen mode Exit fullscreen mode

What this unlocks is something Claude Code doesn't have: model selection by task. And that changes everything.

# My current workflow in Zed
# For code review and explanations: Gemini 2.5 Flash
# For architecture and complex reasoning: Claude Sonnet 4 or DeepSeek R1
# For fast boilerplate generation: Qwen 2.5 Coder 32B (FREE on OpenRouter right now)
# For long log analysis: Gemini 2.5 Pro (massive context window)
Enter fullscreen mode Exit fullscreen mode

That Qwen 2.5 Coder I mentioned — nobody brings it up in "Claude Code alternatives" posts and that's a mistake. For generating TypeScript types, writing unit tests, doing mechanical refactors — it's surprisingly capable, and on OpenRouter you get free requests while the provider subsidizes it.

The weird models I found by actually exploring OpenRouter (models I never would have tried if every request felt like "real" money):

  • Mistral Codestral: code-specialized, blazing fast for short completions
  • DeepSeek R1: chain-of-thought reasoning, perfect when you have a bug you genuinely don't understand
  • Nous: Hermes 3: for complex system prompts and few-shot learning
  • Qwen 2.5 72B: multilingual, useful when you need to document in English something you thought through in Spanish

The psychological difference is massive: when cost is visible and per-use, you explore more, not less. Paradox of perceived abundance.

What I Lost When I Left Claude Code (No Romanticizing)

I'm going to be straight here, because if I'm not, this post is just propaganda.

I lost frictionless agenticity. Claude Code can run your test suite, read the output, iterate, commit. Zed + OpenRouter doesn't do that. You have to be the bridge. You copy output, paste it into the chat, ask for analysis. It's more work.

I lost persistent project context. Claude Code knows your project uses PostgreSQL, that your naming convention is camelCase, that you have a lib/utils.ts with common helpers. All of that you re-contextualize in Zed with a system prompt or an AI_CONTEXT.md file (I renamed it from CLAUDE.md), but it's manual setup every session.

I lost speed at peak load. When I'm in flow and sending 50 prompts in an hour, Claude Code doesn't blink. With OpenRouter, depending on the model, you hit rate limits from the underlying provider. Not always, but it happens.

I'm saying this because in Project Glasswing I argued that understanding what code you're running is your responsibility. Same applies here: understanding exactly what you're giving up when you optimize for cost is part of the decision. If your work is mostly agentic — builds, deployments, rapid iteration — stay in Claude Code. Seriously.

The Gotchas Nobody Warns You About

The silent rate limit gotcha: Some models on OpenRouter have rate limits that aren't clearly documented. Your request doesn't fail — it waits. And Zed doesn't always make it obvious that it's waiting. I lost 10 minutes thinking Zed had frozen.

// Tip: if you're using OpenRouter from your own code, always handle retries
async function completeWithOpenRouter(prompt: string, model: string) {
  const maxRetries = 3;

  for (let attempt = 0; attempt < maxRetries; attempt++) {
    try {
      const response = await fetch('https://openrouter.ai/api/v1/chat/completions', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${process.env.OPENROUTER_API_KEY}`,
          'HTTP-Referer': 'https://your-site.com',  // OpenRouter wants this for analytics
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({
          model: model,
          messages: [{ role: 'user', content: prompt }]
        })
      });

      // 429 = rate limit, wait with exponential backoff
      if (response.status === 429) {
        const wait = Math.pow(2, attempt) * 1000;
        console.log(`Rate limit on attempt ${attempt + 1}, waiting ${wait}ms`);
        await new Promise(r => setTimeout(r, wait));
        continue;
      }

      return await response.json();
    } catch (error) {
      if (attempt === maxRetries - 1) throw error;
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

The cross-model context gotcha: If you start a conversation with Sonnet 4 and continue it with Gemini Flash, context doesn't transfer magically in Zed. Zed does send the full conversation history, but the new model interprets it differently. For continuity work, stay on the same model for the entire session.

The real-time pricing gotcha: Model prices on OpenRouter fluctuate. Not dramatically, but they fluctuate. The same model that was $0.30/M input tokens last week might be $0.40 this week. I set up a basic alert to monitor this — the last thing I need is for my savings to silently evaporate.

The HTTP-Referer gotcha: OpenRouter technically requires you to send an HTTP-Referer header with your app's URL. If you skip it the request doesn't fail, but it affects their internal analytics and potentially your rate limits long-term. I learned this by actually reading the docs, not from any tutorial.

What I Gained That I Didn't Expect

Something I didn't anticipate: when you start thinking in terms of "what model is right for this task" instead of "I'll use whatever model I have," you start thinking more clearly about the task itself.

It's like what happened when I loaded the Linux git history into a database: the process of preparing the data for analysis taught me more about the kernel than the analysis itself did. The friction was the learning.

Now I have a documented workflow. I know when I use each model. I know how much I spend per task type. And that knowledge transfers: when a client asks me whether they should integrate AI into their product, I have concrete answers about real operational costs, not estimates pulled from thin air.

Separately, Zed as an editor has its own advantages that have nothing to do with AI: it's ridiculously fast, real-time collaboration works without server setup, and the Rust/WASM extension model is interesting territory for when I feel like digging in the way I did with HAProxy.

FAQ: Claude Code Alternatives, Zed, and OpenRouter

Does Zed + OpenRouter completely replace Claude Code?
No, and it's not trying to. It replaces the "chat with AI while I code" use case very well. It does not replace Claude Code's agenticity — running commands, iterating over output, automatically maintaining project context. If your workflow depends heavily on that, the savings aren't worth the friction.

How much am I actually spending on OpenRouter compared to $100/month on Claude Code?
My spend last month was $23. But I work on mid-sized Next.js/TypeScript projects, not agents running autonomously for hours. If you're working on ML training projects like the ones I described in the MegaTrain post, the numbers shift dramatically.

Why Zed and not Cursor or Windsurf, which also support multiple models?
Cursor and Windsurf add their own abstraction layer and price on top. Zed is more direct: editor + your API key. Less magic, more control. For the way I work — understanding what's happening at every layer — that matters.

Are OpenRouter models the same quality as going direct to Anthropic/Google?
Yes, they're the same models. OpenRouter is a router, not a fine-tune or a copy. You send a request to anthropic/claude-sonnet-4 on OpenRouter and it hits Anthropic's API. What OpenRouter adds is the routing layer, unified billing, and fallbacks. Output quality is identical.

How do I handle project context without Claude Code's automatic integration?
I have an AI_CONTEXT.md file at the root of every project. It describes the stack, code conventions, main modules, and what not to do (e.g., "don't use axios, this project uses native fetch"). When I start a new session in Zed, I paste that content as a system prompt. Takes 30 seconds and the model has enough context for 90% of tasks.

Does OpenRouter make sense if I already have direct API access to Anthropic and Google?
Depends on how many models you actively use. If you only use Claude, there's no real advantage — you're paying a markup for routing. If you're switching between Claude, Gemini, DeepSeek, and open-source models, OpenRouter saves you from managing 4 API keys, 4 billing dashboards, and 4 client implementations. For me, that overhead is worth the markup.

The Real Decision Isn't About Price

I'll repeat what I said at the top because it carries more weight now: this is not about $100/month. It's about what kind of relationship you want with your AI tools.

Claude Code abstracts away the model, the cost, the infrastructure. That abstraction has real value — it lets you focus on the problem. But it also strips away information. You don't know what your real workflow costs. You have no incentive to experiment with other models. And you never develop the judgment for when to use what.

I passed my second-year calculus final on the fourth attempt while working full-time, showing up in a dress shirt because I came straight from the office. Every failed attempt taught me something the first one never could have. I'm not romanticizing unnecessary suffering — if I'd passed on the first try, great. But I do believe the friction you choose consciously makes you stronger than the friction you avoid at any cost.

Blindly optimizing toward zero friction in your dev tools is choosing not to develop judgment. What I'd do differently: start with Claude Code to understand what you actually want, then migrate to OpenRouter once you have the criteria to choose models. In that order.

If you've already gone through the process of questioning what you trust in your code supply chain, this is the same process applied to your AI tools. It's not nihilism or minimalism — it's understanding exactly what you're paying for and why.

Top comments (0)