FR version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
78% Positive
Analyzed from 8597 words in the discussion.
Trending Topics
#claude#openrouter#code#models#more#api#using#don#usage#model

Discussion (233 Comments)Read Original on HackerNews
Having access to dozens of models through a single API key, tracking cost of each request, being able to run the same request on different models and comparing their results next to each other, separating usages through different API keys, adding your own presets, setting your routing rules...
And once you start using an account with multiple users, it's even more useful to have all those features!
Not relying on a subscription and having the right to do exactly what you want with your API key (using it with any tool/harness...) is also a big plus to me.
For general use, I personally don’t see much justification as to why I would want to pay a per-token fee just to not create a few accounts with my trusted providers and add them to an instance for users. It is transparent to users beyond them having a single internal API key (or multiple if you want to track specific app usage) for all the models they have access to, with limits and logging. They wouldn’t even need to know what provider is hosting the model and the underlying provider could be swapped without users knowing.
It is certainly easier to pay a fee per token on a small scale and not have to run an instance, so less technical users could definitely find advantage in just sticking with OpenRouter.
1. The LLM provider doesn't know it's you (unless you have personally identifiable information in your queries). If N people are accessing GPT-5.x using OpenRouter, OpenAI can't distinguish the people. It doesn't know if 1 person made all those requests, or N.
2. The ability to ensure your traffic is routed only to providers that claim not to log your inputs (not even for security purposes): https://openrouter.ai/docs/guides/routing/provider-selection...
It's been forever since I played with LiteLLM. Can I get these with it?
FWIW this is highly unlikely to be true.
It's true that the upstream provider won't know it's _you_ per se, but most LLM providers strongly encourage proxies like OpenRouter to distinguish between downstream clients for security and performance reasons.
For example:
- https://developers.openai.com/api/docs/guides/safety-best-pr...
- https://developers.openai.com/api/docs/guides/prompt-caching...
As for LiteLLM, the company you would pay for inference is going to know it is “you” — the account — but LiteLLM would also have the same effect of appearing to be a single source to that provider. That said, a uniqueness for a user may be passed (as is often with OpenRouter also) for security. Only you know who the users are, that never has to leave your network if you don’t want.
2 - well, you select the providers, so that’s pretty much on you? :-) basically, you are establishing accounts with the inference providers you trust. Bedrock has ZDR, SOC, HIPPA, etc available, even for token inference, as an example. Cost is higher without cache, but you can’t have true ZDR and Cache (that I know of), because a cache would have to be stored between requests. The closest you could get there is maybe a secure inference container but that piles on the cost. Still, plenty of providers with ZDR policies.
LiteLLM is effectively just a proxy for whatever supported (or OpenAI, Anthropic, etc compatible api provider) you choose.
If you're only using flagship model providers then openrouter's value add is a lot more limited
The minus is that context caching is only moderately working at best, rendering all savings nearly useless.
Not true in any non startup where there is an actual finance department
But if OpenRouter does better (even though it's the same sort of API layer) maybe it's worth it?
LiteLLM proxy also adds quite some overhead as well.
I have personally settled on a mix of Bifrost as my router which connects to OpenRouter or some other providers that I deem more privacy friendly.
well worth the 5% they take
My coding is done with OpenCode with an OpenRouter API Key.
Going with KiloCode would be doing the same, but with some more layers.
And given that I can't see the on-demand API pricing, I'm really not convinced on how it would be an improvement.
if that wasn't the reason, hey that's actually a great way to launder money (not financial advice).
Eg: Ctrl+P "Open Fol.." in Zed does not surface "Opening a Folder". Zed doesn't call them folders. You have to know that's called "Workspace". And even then, if you type "Open Work..." it doesn't surface! You have to purposefully start with "work..."
They are blowing their "weirdness budget" on nonsense.
I have actually ditched PyCharm for the snappiness of Zed. But the paper cuts are really adding up.
Spent a couple of hours trying to make the Svelte extension ignore a particular type of false positive CSS error, failed, and returned to VS Code
Will definitely give it another chance when the extension system is more mature though!
Just the floating and ephemeral "Search in files" modal in Jetbrain IDEs would convince me to switch from any other IDE.
But their tab complete situation is abysmal, and Supermaven got macrophaged by Cursor
I opened just one of the typescript projects inside VSCode and I see something like 1gb (combining the helpers usage). I'm not using it actively, so no extra plugins and so on.
That's on mac, so I guess it may vary on other systems.
I don’t have any extensions installed and I’m basically leaving it open, idle, as a note scratch space. I do have projects open with many files but not many actual files are open
Anyway idk
I'd like to give the new GLM models a try for personal stuff.
And I'm seeing the same thing in my sphere- everyone is bailing Anthropic the past few weeks. I figure that's why we're seeing more posts like this.
I hope they're paying attention.
It seems Cursor somehow builds a better contextual description of the workspace, so the model knows what I'm actually trying to achieve.
The problem is that with Cursor I'm paying per-token, so as GP suggested you can easily spend $100+ per month vs $20 on Claude Code.
Could it be related to this?: https://news.ycombinator.com/item?id=47660925
If you're trying to minimize cost then having one of the inexpensive models do exploratory work and simple tasks while going back to Opus for the serious thinking and review is a good hybrid model. Having the $20/month Claude plan available is a good idea even if you're primarily using OpenRouter available models.
I think trying to use anything other than the best available SOTA model for important work is not a good tradeoff, though.
Do you think this would be a decent approach?
Also, which client would I use for this? OpenCode? I don't think Claude Code supports using other models. Thoughts?
I use claude to build requirements.md -> implementation.md -> todo.md. Then I tell opencode + openrouter to read those files and follow the todo using a cheap (many times free) model.
It works 90% of the time. The other 10% it will get stuck, in which case I revert to claude.
That has allowed me to stay on the $20/month claude subscription as opposed to the $100.
And people keep claiming the token providers are running inference at a profit.
Not everyone gets $1K of usage, and you don't know how fat the per-token margins are. It's like saying the local buffet place is losing money because you eat $100 worth of takeout for $30.
Well, we're going to find out sooner rather than later. Right now you don't know how thin (or negative) the margins are, either, after all.
All we know for certain is how much VC cash they got. Revenue, spend, profit, etc calculated according to GAAP are still a secret.
$1K is not actual cost, just API pricing being compared to subscription pricing. It is quite possible that API has a large operating margins, and say costs only $100 to deliver $1K worth of API credits.
Extrapolating that out, the subscription pricing is HEAVILY subsidized. For similar work in Claude Code, I use a Pro plan for $20/month, and rarely bang up against the limits.
It's obviously capital-subsidized and so I have zero expectation of that lasting, but it's pretty anti-competitive to Cursor and others that rely on API keys.
That being said, they can't stop launching new models, so training is not a one time task. Therefore one might argue that it is part of the marginal cost.
Any insights / suggestions / best practices?
> Run <other harness> in tmux and interrogate it how feature X works, then build me the equivalent as a pi extension.
Maybe in a few years there will be obvious patterns with harnesses having built really optimal flows, but right now it works so much better to experiment and try new approaches and prompts and flows, and pi is the easiest one to tweak and make it your own.
That’s what really appeals to me. I’ve been fighting Claude Code’s attempts to put everything in memory lately (which is fine for personal preferences), when I prefer the repo to contain all the actual knowledge and learnings. Made me realise how these micro-improvements could ultimately, some day, lead to lock-in.
> Run <other harness> in tmux and interrogate it how feature X works, then build me the equivalent as a pi extension.
I’ll give it a try!
No need for database MCP, I use postgres and tell it to use psql.
Occasionally I use prettier to remove indentation - the LLM makes a lot less edit errors that way. Just add the indent back before you commit. Or tell pi to do it.
With the anthropic billing change (not being able to use the max credits for pi) I think I have to cancel - as I'm whirring through credits now.
Going to move to the $250/mo OpenAI codex plan for now.
Is OpenAI codex not also charging by usage instead of subscription when using pi?
It's designed to be a small simple core with a rich API which you can use for extensions (providing skills, tools, or just modifying/extending the agent's behaviour).
It's likely that you'll eventually need to find extensions for some extended functionality, but for each feature you can pick the one that fits your need exactly (or just use Pi to hack a new extension).
I am only doing single project workflows, but with Z.ai I feel like it opens a whole new door to parallel workflows without hitting usage limits.
I tested one of the other models that everyone is raving about yesterday (Qwen 3.6 plus) and within minutes found myself arguing with it even over a very simple task. After about 30 minutes (in which token usage never went over 50k because it was just me rewinding to give it more and more explicit instructions which it kept ignoring), I reverted everything and did it with Opus in literally about 4 minutes, after intentionally giving Opus a much more vague prompt.
at first i thought i was goring to build lots of extra plugins and commands but what ended up working for me is:
- i have a simpel command that pulls context from a linear issue
- simple review command
- project specific skills for common tasks
He went on an "OSS vacation", which is perfectly reasonable and said he'd be back on a certain date. I had a PR open for a trivial fix, someone asked when it would land. I shared he was still away. After his return I politely asked, "@badlogic hey, what can we do to progress this? Thanks x"
I then got what I would consider an abusive reply, because he confused me with someone else. In the meantime he extended his vacation. Didn't even think his shitty attitude was worthy of an apology, that HE confused me with someone else.
https://github.com/badlogic/pi-mono/discussions/1475#discuss...
And another other thing I fixed with no attribution, just landed it himself separately. https://github.com/badlogic/pi-mono/discussions/1080
and
https://github.com/badlogic/pi-mono/issues/1079#event-223896...
Now he's seemingly marked anything with my name on as a "clanker", despite all my changes being by hand.
I've been around open source enough to have a thick skin, but when i'm doing something "for fun" and someone treats you like that, i'd rather avoid it as far as possible. I certainly could not in good faith use this project for anything work related.
Honestly, it seems like both of you were feeling a bit "grumpy" at the moment, but sending passive aggressiveness towards the maintainer you are trying to get to merge your code (or not your code, someone else's code?) seems like a very bold strategy regardless.
But that doesn't negate the maintainer talking to people like that (and taking contributions without attribution).. and the net result is I don't want to use the software, and frankly they probably won't miss me.. so the end result is neutral.. I just find it sad.
As someone else pointed out cooler heads and less passive aggressive responses would've resolved this issue easily.
OpenCode picked up my CLAUDE.md files and skills straight away, and I got similar performance to Opus 4.6.
I'm pretty conservative when it comes to clearing the context, and I also tend to provide the right files to work on (or at least the right starting point).
I had seen prior to using the model that it starts producing much worse results when the context used is larger, so my usage style probably helps getting better results. I work like this with Claude Code anyway, so it wasn't a big change.
Many of us got the annual Lite plan when they had the $28 discount. But even at $120 I think it's a good deal.
I have been wanting to subscribe but based on how awful the experience is for most people, I just can’t pull the trigger
Z.ai seems crazy expensive in comparisons, although I wonder if inference speeds have a noticeable difference.
I am in a situation where every sub-folder has its own language server settings, lint settings, etc. VSCode (and forks) can handle this by creating a workspace, adding each folder to the workspace, and having a separate .vscode per-folder. I haven't figured out how to do the same with Zed.
I would love to stop using VSCode forks
Because GH is accessing the API behind the scenes, you should face less degradation when using Sonnet/Opus models compared to a Claude subscription.
Keep a ChatGPT $20 subscription alongside for back-and-forth conversations and you'll get great bang for buck.
I like the VSCode integration and the MCP/LSP usage surprised me sometimes over the dumb grep from CC. Ironically VSCode is becoming my terminal emulator of choice for all the CLI agents - SSH/container access and the automatic port mapping, etc. - it's more convenient than tmux sessions for me. So Copilot would be ideal for me but yeah it's just tweaked for being budget/broad scope tool rather than a tool for professionals that would pay to get work done.
It turns it into a very good value for money, as far as I'm concerned.
GHCP at least is transparent about the pricing: hit enter on a prompt= one request. CC/Codex use some opaque quota scheme, where you never really know if a request will be 1,2,10% of your hourly max, let alone weekly max.
I've never seen much difference with context ostensibly being shorter in GHCP, all of the models (in any provider) lose the thread well before their window is full, and it seems that aggressive autocompaction is a pretty standard way to help with that, and CC/Codex do it frequently.
Then we've had wildly different results. Running CC and GH copilot with Opus 4.6 on same task and the results out of CC were just better, likewise for Codex and GPT 5.4. I have to assume it's the aggressive context compaction/limited context loading because tracking what copilot does it seems to read way less context and then misses out on stuff other agents pick up automatically.
https://www.techradar.com/pro/bad-news-skeptics-github-says-...
We are not allowed to use anything other than our company provided GHCP credentials due to the data retention clause in our contracts. Ie. they are not allowed to use our data.
The worst I saw - multiple parallel agents (opencode & pi-coding agents), with Kimi and glm, almost non stop development during the work day - 15-20% session consumption (I think it’s 2h bucket) max. Never hit the limit.
In contrast, 20$ Claude in the similar mode I consumed after just few hours of work.
For several models like Kimi and glm they have b300 and performance really good. At launch I got closer to 90-100 tps. Nowadays it’s around 60 tps stable across most models I used (utility models < 120B almost instant)
The new gimped claude code limits means my claude code spend the last month is $131. It cost me $20. I did an additional spend $5 on extra usage which cost me $5.
While VC's are setting fire to money I am going to warm my hands.
85% discount is actually a bit lower than I remember. I think it used to be closer to 90-95%. They're getting stingy ;)
No parallel running; I would very consistently get tokens for over 3 hours then take a walk around the block and come back and be ready to go again.
If anything I would consider switching to OpenAI subscription (if I didn't despise them even more than Anthropic as a company), but converting to API use seems completely infeasible to me. I'd have to severely cut back on my use for not much benefit, other than having maybe an agent thats a little less jank than CC.
But at that point we are just min/maxing the details, and all I can say is if you are on a $100/$200 a month subscription to any of these services and not using them regularly then you shouldn't be on a $200 subscription any more than you should be on a $700 a month gym membership when you go every 3 months for 15 minutes.
I deffo get more perceived value out of it than the 100$ I pay. Could I get MORE value with the same 100$? imo only through OpenAI (no harness lock in and more lenient limits), but I deeply dislike the way their company is evolving. Admittedly, recent launches from Anthropic like managed agents and Mythos Preview don't make me very hopeful the individual developer pricing is here to stay, but I'll use what I can get while I can get it.
Could I get my required value with less than 100$? Mayyybe I could get by with like, three Anthropic 20$ plans? or 2x20$ and an OAI 20$? but this is so min-maxy that I just don't really want to bother. Pay by token would kill my workflow instantly. I'd have to add so many steps for model selection alone. I'll cross that bridge when Anthropic cuts me off.
I agree though most people on the $200 plans are either just not using them or in some deep AI psychosis. I'd like to exclude myself from these groups, but the pipeline to AI psychosis seems very wishy washy to begin with (the thread the other day about iTunes charts being AI dominated had a surprising amount of people defending AI music, imo).
Imo this is the premium I pay right now to just not have to worry about this. The project where I burned 50$ in a day was using superpowers plugin (A set of skills that makes Claude meticulously plan out design and implementation, interview for details, use subagents for subtasks and review them independently, etc.) - it burns tokens like crazy, but it has super good results for me for custom software tools for myself.
I would probably change my approach if I a) was creating software for customers where I had to actually worry about the implementation details or b) if I was forced to switch to API and couldn't just throw Opus at a 28-task plan for an hour. But this works for me right now so meh. I feel like I'm in some rare Goldilocks zone where Anthropic is not super ripping me off (I use CC quite heavily and generate real value for myself) but I also don't go crazy if I go 2 days without building the next SaaS startup.
I switched to OpenCode Zen + GitHub Copilot. For some reason, Claude Code burns through my quota really quickly.
https://opencode.ai/zen
Honesty as a marketing strategy is really undervalued in cases like this
Due to the quota changes, I actually find myself using Claude less and less
If I just let opencode zen run claude opus to plan and execute, I'd spend $20 in like 5 minutes lol
I might be paranoid but I feel that access to models will become more constraint in the future as the industry gets more regulated.
We are not the only one. I found other people online experiencing the same issue. It is hard to tell how wide-spread this is but it is strange to say the least.
He uses $70 for remaining credit and says that's a good thing because it rolls over
But spending $70 on an API (he says he still prefers Opus) is far less cost effective than a Max plan on Anthropic.
The article seems to be nudging us to setup OpenRouter but the premise isn't fully true. A bit of diversity is excellent, but the costs are going to (largely) prohibit it in reality?
I find that a lot of my Claude usage goes unused and then when I'm coding or leaning on agents I hit a limit and have to wait. I don't like that dynamic. I do have Extra Usage enabled (with a cap) but then I'm spending more than the $100 I already do.
I'm learning that a lot of people seem to consistently stay within limits and that works for them but I was looking for something different for myself.
The real pain is that Anthropic don't easily quantify usage (which can now change over the day). How many tokens is it? Minimum? Maximum? I tried to quantify this with OpenTelemetry for a while but have decided to move to this more flexible setup.
The liabilities are completely offset by prepayments from your customers though. Even better, you can earn interest on the deposits without paying any out.
If you just dont want the liabilities on the books, issue refunds. Expiring credits feels like a cash grab.
My backup has been Opencode + Kimi K2. It's definitely not as strong as even Sonnet but it's pretty fast and is serviceable for basic web app work like the above.
It's nice that it works for the author, though, and OpenRouter is pretty nice for trying out models or interacting with multiple ones through a unified platform!
It’s not just Zed, CoPilot also reduces the capabilities and options available when using models directly.
No thanks, definitely agree with the Open Router approach or native harness to keep full functionality.
I’ve always wondered what’s the business case for spending more as I personally feel I am getting so much done.
So yes obviously you can do what you want as long as you abide by terms of service, but the terms of service does NOT allow you to resell the API.
> TOS says: access the Site or Service for purposes of reselling API access to AI Models or otherwise developing a competing service;
I think what you meant is "you aren't allowed to expose the access to the API to end users", which is a fair condition IMHO.
You're still allowed to expose the functionality (ie. build a SaaS or AI assistant powered by OpenRouter API), just don't build a proxy.
OpenRouter recently started enforcing account-level regional restrictions for providers that enforce it (OpenAI, Anthropic, Google) - ie blocking accounts that look like they are being used by users in China. The regional restriction used to be based on the Cloudflare edge worker IP's geolocation and enforced upstream, so a proxy/server running inside of supported regions would get around the geoblocks, but now OpenRouter are using (unspecified) signals like your billing address to geoblock. People say "banned" because the error message says "Author <provider> is banned", which really should be read as "Unable to use models from provider due to upstream ban".
Sadly Zed seems to add 10% so it's still more worthwhile to use OpenRouter.
OpenRouter is a valuable service but I’ll probably try to run my own router going forward.
https://openrouter.ai/docs/guides/overview/auth/byok
1. What do you use the hooks for?
2. Do you use an editor alongside the CLI to review code or only examine the diffs?
I use hooks to automate decisionmaking (i.e. stronger permissions than a regex by parsing the bash) and similarly automate guidance. Our tooling is open source so here is an example: https://github.com/Devleaps/agent-policies-server/blob/maste...
Another example is I whitelist dependencies based on the dependency age, for example a library needs to have been around for a year, then it can do `uv add {dependency}`.
As a third example, hooks tell Claude not to write out *_test|debug.py at the root of a project, which for some reason it very often does when it wants to fix some issue. The hooks tell it to write a proper test case using the test framework in place. So instead of having random debug and test scripts everywhere after a long session, I have more test coverage.
This is all in the agent-policies-server project linked above. Mainly it reduces interruptions and I don't have to worry about it doing something particularly stupid. (It is not a replacement for sandboxing)
> Do you use an editor alongside the CLI to review code or only examine the diffs?
I do have the file tree open alongside the CLI, and that is both in Zed. How much of the code I review depends on who owns the code, meaning a client, employer or me. In most cases I review it myself, as for many clients code goes through a peer review process. In some cases the organization uses automated quality metrics and has agents looking at code instead. If agents don't have any more comments, and the quality metrics also approve, it's good enough for them. As for my own personal projects, I look at the code when I feel like it, which is practically never.
Also ditching Claude Code is mistake. It is quite capable model, and still great value. I would keep it, even if it's just for code reviews and planning. Anthropic allows pro plans use in Zed.
OpenCode Go has the simplest plan at the highest rate limits for any subscription plan with multiple model families, and it's $10/month ($5/month for first month). With the cheapest model in the plan (MiniMax M2.5), it is a 13x higher rate than Claude Max, at 1/10th the price. The most expensive model (GLM 5.1) gives you a rate of 880 per 5h, which is more than any other $10 plan. I don't expect this price to last, it makes no sense. OpenCode also has a very generous free tier with higher rates than some paid plans, but the free models do collect data.
The cheapest plan of all is free and unlimited - GitHub Copilot. They offer 3 models for free with (supposedly) no limit - GPT-4o, GPT-4.1, and GPT-5-mini. I would not suggest coding with them, but for really basic stuff, you can't get better than free. I would not recommend their paid plans, they actually have the lowest limits of any provider. They also have the most obtuse per-token pricing of any provider. (FYI, GitHub Copilot OAuth is officially supported in OpenCode)
The next cheapest unlimited plan is BlackBox Pro. Their $10/month Pro plan provides unlimited access to MiniMax M2.5. This model is good enough for coding, and the unlimited number of requests means you can keep churning with subagents long after other providers have hit a limit.
The next cheapest is MiniMax Max, a plan from the makers of MiniMax. For $50/month, you get 15,000 requests per 5-hours to MiniMax M2.7. This is not as cheap as OpenCode Go, which gives you 20,000 requests of MiniMax M2.5 for $10, but you are getting the newer model.
If you don't want to use MiniMax, the next cheapest is Chutes Pro. For $20/month, you get a monthly limit of 5,000 requests.
I'll be adding more of these as I find them to this spreadsheet: https://codeberg.org/mutablecc/calculate-ai-cost/src/branch/...
Note: This calculation is inaccurate, for multiple reasons. For one, it's entirely predicated on working 8 hours a day, 22 days a month; I'll recalculate at some point to find cheapest if you wanted to churn 24/7. For another, some providers (coughANTHROPIC) don't actually tell you what their limits are, so we have to guess and use an average. But based on my research, the calculations seems to match up with the per-request API cost reported at OpenRouter. Happy to take suggestions on improvements.
I have had the chance to test the main Chinese models through OpenRouter but the Pay-as-you-go model is expensive compared to a subscription model, but I don't want to marry to a single provider.
Thanks for bringing OpenCode Go to my attention. Your comparison is the research I didn't know I needed, and I will be cancelling my Copilot subscription to replace it with OpenCode Go right away.
opencode go gives about 14x the requests of copilot pro. I was like, there must be something not right.
Then I compared the best model GLM5.1 on opencode go, and antropic opus 4.6, yes opus is better on most benchmarks, but glm 5.1 is not too far behind.
It’s mad for sure, but I’d bet 99.9% of people spending money on AI aren’t spending their own hard earned sooo… “YOLO it’s a business expense/investment”…
Money is relative. I retired at less than the average professor salary (all ages) at a not-rich school. I would have made more in tech. I still have weeks where the market goes up 2000x my AI budget, just the retirement savings from my salary. Anyone who isn't living in a van and eating peanut butter if they must, to save the max toward retirement, isn't recognizing how profoundly our system is rigged to favor saving.
Now I'm happy with agents as the models and harnesses have improved significantly but the token usage comes at a cost.
It easily pays for itself 10x over.