An open source stack, zero subscription, zero cents: coding with AI without paying is possible today. Here’s how, and to what extent.
8, 20, 100, often 200 dollars: the price of subscriptions to agentsartificial intelligence has been soaring in recent months. In the United States, some developers can exceed the threshold of a thousand dollars per month by combining all the solutions. Uber had to limit its employees’ AI spending to $1,500 per employee per month. However, there are solutions for having a relatively good code agent, at lower cost or even completely free. This is neither a local code agent (hardware capabilities are still limited) nor stealing API keys from vibecoded GitHub repositories (this is a growing practice!). Explanations.
A code agent = a model and a harness
A code agent, whether Claude Code, Gemini CLI or Codex, is made up of two major blocks: the model and the harness, the software brick. Currently, 100% of the cost of subscriptions comes from the model. The harness is just a software component that does not generate any costs for the publisher. On the other hand, the latter is often the owner and does not legally allow you to connect any model. To have a completely free code agent, we will therefore need a harness open source and a free template. The open source code agent harnesses are legion: Pip, Cline, Aider, OpenHands… But here is the one that interests us today: OpenCode. It is the most popular and most complete open source code agent, modeled on the operation of proprietary agents (Claude Code and others). The harness is used by more than 7.5 million developers worldwide each month.
Natively, OpenCode offers free templates for the general public. Currently, we find in particular Big Pickle, DeepSeek V4 Flash Free, MiMo-V2.5 Free, Nemotron 3 Super Free… And that’s it. Most of these models do not have exceptional code performance. The real alternative is to use the OpenRouter provider, which makes several completely free models available to the public. The counterpart? The majority of publishers of these free models collect input and output data for training the next family. The risk is therefore quite significant, particularly for proprietary code.
Finally, the other big obstacle, and we have observed it many times in our tests: latency. Depending on peak times, free models seem to have a lower priority (and this is normal) than paid models. This results in very slow use of the model (sometimes less than 20 tokens per second) and often API call errors.
The recommended use mainly concerns personal projects that do not use any commercial or private data. In this case, having a completely free code agent allows you to move forward without any cost on your projects. We recommend using this solution combining OpenCode and free models via OpenRouter in two scenarios: developing an MVP at no cost and editing a pre-existing code base. Generating a complete project from A to Z is possible, but taking into account the pitfalls mentioned above.
Which free model to choose on OpenRouter?
At the time of writing these lines, at the beginning of June 2026, OpenRouter offers 8 free models that can be used as a code agent engine model. Namely: Owl Alpha, Poolside Laguna XS.2, Poolside Laguna M.1, Kimi K2.6, Nemotron 3 Super, GPT-oss-120b, GPT-oss-20b and GLM 4.5 Air. We retain the trio Nemotron 3 Ultra, Kimi K2.6 and GPT-oss-120b as the three “best” free code models, due to their tool use capacity and their overall results on code benchmarks. However, we advise you to use Kimi K2.6, which offers the best performance/latency ratio with an average output of 107 tokens per second.
Check the list of free templates available on OpenRouter regularly: some templates are deprecated quickly and other opportunities may arise. OpenRouter also offers an endpoint (openrouter/free) allowing you to automatically select the best model suited to your request. We do not advise you to use it with OpenCode: the selection of models is sometimes random, you may come across a model without tool calling and therefore, as a result, more errors on your code agent. The endpoint, on the other hand, is ideal for a developer wishing to use theGenerative AI in a basic application, at no cost and without any hassle.
How to install OpenCode with OpenRouter and Kimi K2.6?
Installing OpenCode is very simple: just open a terminal on your computer and enter the command:
curl -fsSL https://opencode.ai/install | bash
The agent is then installed on your device via the installation script. To launch OpenCode, the command is simply: opencode
To connect OpenRouter to OpenCode, create an account on OpenRouter and retrieve your API token from: https://openrouter.ai/workspaces/default/keys
In OpenCode, then type /connect and choose OpenRouter as provider. Then press Enter and enter your API key.

To choose the right model, enter the /model command and choose the free model of your choice, Kimi K2.6 in our case. Be careful that the word “free” appears next to the model name: certain models are offered in free and paid versions on OpenRouter (several providers behind).
Your completely free code agent is now set up.
For the test, we ask the vibe-coder code agent for a very simple game of Snake. The prompt is deliberately minimalist: “Creates an independent index.html file (HTML, CSS and JS in the same file, without external dependencies): the Snake game playable on the keyboard.”
The game is created in less than a minute. The interface is sober to say the least but everything is functional: the points counter, direction management, snake length management… Everything is quite tasty because it was created for free.

Coding without a subscription, still impossible?
This OpenCode plus OpenRouter stack therefore keeps its promise: to code with AI, without subscription and without paying a cent. This OpenCode plus OpenRouter stack therefore keeps its promise: to code with AI, without subscription and without paying a cent. But the limits detailed above (variable latency, recovery of input and output data by editors, rapid depreciation of models) confine the use to a role of complement rather than replacement. This is the solution to use when your owner agent’s token quota is exhausted, for quick editing or a personal project without sensitive data. It is also a response to the particular case of Claude Code, whose closed harness does not legally authorize the connection of a third-party model. For commercial or confidential code, on the other hand, the calculation remains unfavorable with regard to the confidentiality risk.
The real shift will take place elsewhere: the day when a model of the caliber of Claude Opus will run entirely locally, on the developer’s machine, without going through a third-party supplier. We are still a long way from this, with consumer hardware capabilities remaining the main obstacle. But the trajectory is encouraging. The latest results from small open models, like the recent Gemma 4 12B, show that a gap long considered insurmountable is narrowing at a pace that deserves to be closely monitored. It remains to be seen whether this dynamic will keep its promises on real agentic code tasks, where tool use and consistency over long sequences still make the difference.