An AI code generator produces code from a natural-language description or a formal spec in a single pass, without running it. There are four kinds: inline completion, chat to snippet, prompt to app builders, and deterministic scaffolding from a schema. A generator is enough whenever you can verify the output by reading it. Anything that has to pass a test needs an agent, which is a generator wrapped in a loop.
- A generator produces code in one pass. It never runs what it wrote.
- Four shapes: completion, chat, app builder, and schema scaffolding.
- The oldest and most reliable generators are not AI at all.
- Free is a real option: Copilot Free, v0 Free, Gemini CLI, Cursor Hobby.
- The test: can it read the result of running its own output? If not, it is a generator.
What an AI code generator actually is
An AI code generator takes a description of what you want, in English or as a formal schema, and emits code. One request, one answer. It does not compile the result, run your tests, read the error, or try again. If the output is wrong, you find out, not the tool.
That is the whole definition, and it is worth being precise about because the market uses "code generator", "AI coding assistant", and "AI coding agent" interchangeably for products that behave very differently and cost between nothing and $200 a month.
GENERATOR AGENT
you describe an outcome you describe an outcome
model emits code model reads your files
you read it model writes code
you run it model runs the tests
you fix it model reads the failure
model tries again
you review a diff
The four shapes
Every AI code generator is one of these.
| Shape | You give it | You get back | Examples |
|---|---|---|---|
| Inline completion | A cursor position and some context | The next lines | Copilot, Cursor Tab |
| Chat to snippet | A question in prose | A block you paste | ChatGPT, Claude, Gemini |
| Prompt to app | A description of a product | A running project and a URL | v0, Lovable, Bolt, Replit |
| Schema scaffolding | A spec or a data model | Exactly correct code, every time | OpenAPI Generator, Prisma, protoc |
1. Inline completion
The highest-volume form by a wide margin, and the one most people mean by "AI writes my code". It predicts the next few lines where your cursor is, and you accept or reject with a keystroke. It is the cheapest to run and the easiest to verify, because you are looking at it as it appears.
2. Chat to snippet
You ask a general assistant for a function, a regex, a config block, or a migration, and paste the result. Underrated for how much it gets used: an enormous amount of real code enters real repositories through a clipboard. The risk is also highest here, because the model has no view of your codebase at all and no way to know what conventions it is violating.
3. Prompt to app builders
Describe a product, get a working project with a UI, a database, authentication, and a deploy URL. These blur the line, because most of them now iterate on their own output, which makes them agents wearing a generator interface. Judge them on whether you get the code, and on what happens on the second change rather than the first.
4. Schema scaffolding, which is not AI
The oldest category and still the most reliable. openapi-generator from an OpenAPI document, a Prisma client from a schema, gRPC stubs from a .proto, rails generate, create-next-app. These are deterministic: the same input produces the same output, forever, and it is correct by construction rather than by review.
The landscape, priced
Checked against vendor pricing pages, August 2026.
| Tool | Shape | Free tier | Paid from |
|---|---|---|---|
| GitHub Copilot | Completion | 2,000 completions and 50 chat requests a month | $10/mo Pro |
| Cursor | Completion and agent | Hobby, limited | $20/mo Pro |
| Gemini CLI | Terminal agent | 60 requests/min, 1,000/day | API key or Vertex |
| ChatGPT | Chat to snippet | Yes, limited | $20/mo Plus |
| Claude | Chat to snippet | Yes, limited | $20/mo Pro |
| v0 | Prompt to app | $5 of credits, 7 messages a day | $30/user/mo Plus |
| Replit | Prompt to app | Starter, daily agent credits | $25/mo Core |
| Lovable, Bolt | Prompt to app | Yes, credit-based | Credit tiers |
| OpenAPI Generator, Prisma | Schema scaffolding | Free, open source | n/a |
Prompt-to-app builders price in credits rather than seats, which behaves differently from a subscription: the first version of an app is cheap and the twentieth revision of it is not. Budget for iteration, because that is where the credits go.
When a generator is enough
The rule is simple and it holds up: a generator is enough whenever you can verify the output by reading it. If reading it is not sufficient proof, you need something that can run it.
| Task | Generator is enough | Why |
|---|---|---|
| A regex you will test with three examples | Yes | Verification is seconds |
| Boilerplate in a framework you know | Yes | You will spot anything wrong |
| A one-file utility script | Yes | Small enough to read entirely |
| A UI component from a description | Yes | You can see whether it looks right |
| Learning an unfamiliar API | Yes | You wanted the shape, not the code |
| A SQL migration | Careful | Readable, but the blast radius is large |
| A change that must pass an existing test | No | Nothing in the loop runs the test |
| A refactor across twelve files | No | Nothing holds the whole change |
| Anything in an unfamiliar codebase | No | It cannot read what it is not shown |
| A bug you cannot yet reproduce | No | Reproduction is the work |
When you need an agent instead
An agent is a generator wrapped in a loop with tools. It reads files, writes changes, runs commands, reads the output, and decides what to do next. That single addition is what lets it finish a task rather than produce a first draft.
| Generator | Agent | |
|---|---|---|
| Reads your files | Only what you paste | Yes, on its own |
| Runs your tests | No | Yes |
| Fixes its own mistakes | No | Yes, within a session |
| Multi-file changes | You assemble them | Native |
| Cost per task | Low, one pass | High, context re-sent every turn |
| What you review | A snippet | A diff |
| Works unattended | No | Yes |
The cost row is the one people are surprised by. A generator sends your context once. An agent re-sends the accumulated conversation on every turn so it can decide what to do next, so cost grows closer to the square of the turn count than to a straight line. Caching flattens the curve substantially but does not change its shape. That is why generators are priced per seat and agents are priced in usage windows and credit pools.
Read this before you ship generated code
Generated code fails in a narrower and more predictable set of ways than human code. Checking for exactly these takes a couple of minutes and catches nearly all of it.
- Do the imports exist? Models invent package names that sound right. The invented names are repeatable, which means someone can register them, so an unfamiliar dependency in generated code deserves a look at the registry before you install it.
- Are the versions current? Generated code reflects the ecosystem the model was trained on, which routinely means a deprecated API or an option that was removed two releases ago.
- Where does it fail? Happy paths are the strength of this category. Error handling, empty inputs, and timeouts are consistently the weakness.
- Any credentials in it? Placeholder keys, connection strings, and example tokens get pasted along with everything else.
- Does it match the codebase, or a generic one? A generator that cannot read your repository writes idiomatic code for nobody in particular. That is how a second logging pattern and a third HTTP client get in.
- Is anything licensed? Large generated blocks can closely resemble training material. It matters more the larger and more distinctive the block is.
Picking one
| If you are | Start with | Cost |
|---|---|---|
| Learning to code | A chat assistant, and read every line | Free |
| Writing code you already know how to write | Inline completion | Free, then $10 |
| Building a prototype to show someone | A prompt-to-app builder | Free tier, then credits |
| Working in an existing codebase | An agent, not a generator | $20 |
| Generating a client from a spec | The deterministic generator | Free |
| Deciding whether any of this suits you | Gemini CLI, free tier | Free |
The honest order is: try the free tiers first, because they are genuinely capable and there are several; add a paid completion tool if you spend your day typing; and only reach for a paid agent when you find yourself describing whole tasks rather than lines. Buying the agent first is the most common way to pay $20 a month for something used like a chatbot.
Questions people ask
A tool that turns a description, in prose or as a formal schema, into code in a single pass. It does not run the result, so verification is your job. That is what separates it from an AI coding agent, which runs a loop and can check its own work.
Several are genuinely free as of August 2026. GitHub Copilot Free gives 2,000 completions and 50 chat requests a month, Gemini CLI gives 60 requests a minute and 1,000 a day on a personal Google account, and v0 gives $5 of credits with 7 messages a day. Cursor and the chat assistants have limited free tiers too.
The loop. A generator emits code once. An agent reads your files, runs commands, reads the output, and iterates until it thinks it is done. Ask whether the tool can observe the result of running its own output; if it cannot, it is a generator.
It is as safe as your review. The predictable failures are hallucinated dependencies, outdated API versions, missing error handling, pasted credentials, and code that ignores your codebase conventions. Checking those five takes minutes and catches most of it.
Prompt-to-app builders such as v0, Lovable, Bolt, and Replit will produce a running project with a UI, a database, and a deploy URL. They are strongest on the first version. Judge them on the second and third change, and on whether you get the code to take elsewhere.
To ship, yes. Generation moves the work from writing to specifying and reviewing, and the binding constraint becomes how much code you can review carefully. Unreviewed generated code is a liability rather than an asset.
Because every turn re-sends the accumulated context so the model can decide what to do next. Cost grows closer to the square of the turn count than to a straight line. A generator sends its context once, which is why it is priced per seat and agents are priced in usage windows and credit pools.
No, if a spec exists. Generate it from the OpenAPI document or the .proto file with the deterministic tool. That output is correct by construction and regenerates cleanly when the API changes, where a model-written client is a snapshot that drifts from the spec in silence.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.
- GitHub Copilot plans
- Cursor pricing
- v0 pricing credits and message limits
- Replit pricing agent credit tiers
- Gemini CLI on GitHub