Vibe Coding with AI: The Complete Developer Guide for 2025
What is vibe coding, why developers love it, and how to set up the best free AI tools to ship faster — without sacrificing code quality.
What Is Vibe Coding?
Andrej Karpathy coined the term "vibe coding" in early 2025: the practice of describing what you want to an AI and accepting the output largely as-is, guided by feel ("vibes") rather than line-by-line review. You are not reading the code carefully. You are steering by whether the output seems to work and whether it feels right.
It sounds reckless. For prototyping and personal projects, it is remarkably effective. For production systems handling real users and real data, it requires discipline and guardrails.
This guide covers both: how to vibe code effectively, and where to slow down before it bites you.
The Core Vibe Coding Loop
The loop is simple:
- Describe what you want in plain English
- AI generates code
- Run it — does it work?
- If yes: move on. If no: describe what went wrong, let AI fix it
- Repeat until the feature works
This loop is fast. A developer who would normally spend 3 hours implementing a feature can sometimes ship it in 40 minutes. The tradeoff: the code may have edge cases that are not immediately visible, and the architecture may not be what you would design from scratch.
Best Tools for Vibe Coding in 2025
Cursor IDE — The Primary Tool
Cursor is the preferred vibe coding environment. Key features:
Cmd+K— Inline edit: describe a change, AI makes it in placeCmd+L— Chat with full codebase contextTab— Accept AI autocomplete suggestions- Composer — Multi-file edits from a single prompt
Configure Cursor with a FreeLLMKeys key (Settings → Models → Override Base URL: https://aiapiv2.pekpik.com/v1) for unlimited AI assistance at zero cost.
A Free API Key — The Fuel
Vibe coding works best with frontier models. GPT-4o and Claude Opus 4 produce consistently better code than smaller models. With FreeLLMKeys, you have both for free — grab a key from the homepage and paste it into Cursor.
A Real Vibe Coding Session
Here is how a vibe coding session actually looks. Goal: build a URL shortener API in FastAPI.
Prompt 1: "Create a FastAPI app with two endpoints: POST /shorten that takes a URL and returns a short code, and GET /{code} that redirects to the original URL. Store in a Python dict for now."
→ AI generates complete working code. Run it. Works.
Prompt 2: "The short codes are too predictable. Use nanoid-style random 8-character codes instead."
→ AI updates the code generation function. Run it. Works.
Prompt 3: "Add input validation — reject URLs that don't start with http:// or https://, return a proper 422 error."
→ AI adds a Pydantic validator. Run it. Works.
Total time: 12 minutes. Lines of code written by hand: 0. This is vibe coding.
Using the API Directly for Vibe Coding Tasks
from openai import OpenAI
client = OpenAI(
base_url="https://aiapiv2.pekpik.com/v1",
api_key="sk-your-freellmkeys-key"
)
def vibe(description: str, existing_code: str = "") -> str:
context = f"\n\nExisting code:\n{existing_code}" if existing_code else ""
response = client.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "system",
"content": "You are a senior developer. Write clean, working code. Output only the code, no explanation unless specifically asked."
}, {
"role": "user",
"content": f"{description}{context}"
}]
)
return response.choices[0].message.content
# Vibe coding a feature
code = vibe("Write a Python function that downloads a webpage and returns all external links as a list")
print(code)
# Iterating on it
code = vibe("Add error handling and a 10-second timeout", existing_code=code)
print(code)
Where Vibe Coding Goes Wrong — And How to Prevent It
Security: AI-generated code frequently has security issues — SQL injection, missing auth checks, insecure defaults. Run an AI code review pass before deploying anything user-facing.
def security_review(code: str) -> str:
response = client.chat.completions.create(
model="claude-opus-4-7", # Claude is best for security review
messages=[{
"role": "user",
"content": f"Review this code for security vulnerabilities only. List each issue with severity and fix:\n\n{code}"
}]
)
return response.choices[0].message.content
Architecture drift: Each vibe session can make locally reasonable decisions that create globally incoherent architecture. Periodically step back and review the whole system with AI: "Here is the full codebase — are there architectural inconsistencies I should fix?"
Tests: Vibe coding skips tests. Force yourself to add them: "Now write pytest tests for everything you just generated." This takes 5 minutes and saves hours.
Vibe Coding Is a Skill
The developers who get the most from vibe coding are not the ones who accept every output uncritically. They are the ones who write precise prompts, know which outputs to trust, and know when to slow down and read the code carefully.
The best tool combination for vibe coding in 2025: Cursor IDE + FreeLLMKeys (GPT-4o for generation, Claude Opus for review). Total cost: $0.