How to Use Claude Code for FREE

Learn how to run Claude Code with free AI models, connect everything step by step, and build your first website without a Claude subscription.

Roadmap & resources

Install Claude Code

Install Claude Code

Open Terminal on a Mac or PowerShell on Windows. Paste the command for your computer and press Enter.

curl -fsSL https://claude.ai/install.sh | bash

macOS · Terminal

irm https://claude.ai/install.ps1 | iex

Windows · PowerShell

Open the Claude Code Install Guide

Official install steps for every system.

https://code.claude.com/docs/en/setup

Check That It Works

Open a new terminal window and run:

claude --version

If a version number appears, Claude Code is installed successfully.

Set Up Free AI Models

Install FreeLLMAPI

FreeLLMAPI is a free desktop app that connects Claude Code to free AI models.

Download FreeLLMAPI

Download the latest version for Windows or macOS.

https://github.com/tashfeenahmed/freellmapi/releases

Under Assets, Windows users choose the file that starts with FreeLLMAPI-Setup and ends in .exe. Mac users choose the .dmg ending in macos-arm64 for Apple silicon, or macos-x64 for Intel.

Install it and open it. FreeLLMAPI runs in your Mac menu bar or Windows system tray.

Create a Free Google AI Studio Key

Open Google AI Studio

Free with a Google account.

https://aistudio.google.com/apikey

Sign in with your Google account. Click Create API key. Copy the key.

NOTE

Keep this key private. Paste it only into FreeLLMAPI.

Add the Key to FreeLLMAPI

Click the FreeLLMAPI icon, choose Open Dashboard, then go to:

FreeLLMAPI Keys Add key

Under Platform, choose Google AI Studio. Paste your Google AI Studio key into API key. Click Add key.

Your free models are ready. There is nothing to switch on.

Other Free AI Providers

You can also connect other free AI providers or use them as backups.

Create an API key with the provider. In FreeLLMAPI, go to Keys and click Add key. Choose the provider under Platform, paste the key, and click Add key.

Create a Groq API Key

Groq has a free plan with small limits, so it works best as a backup.

https://console.groq.com/keys

Create an OpenRouter API Key

Only OpenRouter models marked :free are free, with daily limits.

https://openrouter.ai/keys

Never add billing details. One working provider is enough to finish this guide.

Connect Claude Code

Install Node.js (If Needed)

This step needs Node.js. If you already have it installed, you can skip this.

Download Node.js

Choose version 24 (LTS), not the newest one.

https://nodejs.org/en/download

FreeLLMAPI supports Node.js 20.18 up to 24. A newer version may show an EBADENGINE warning.

Create Your Project Folder

Open Terminal on Mac or PowerShell on Windows. Paste this command and press Enter.

cd ~; mkdir learnhub; cd learnhub

This creates a folder called learnhub in your home folder (~/learnhub on Mac, %USERPROFILE%\learnhub on Windows) and opens it in Terminal. If the folder already exists, ignore that message.

Launch Claude Code

Keep FreeLLMAPI running, then copy its API key. Right-click the FreeLLMAPI icon, choose Open Dashboard, and go to:

FreeLLMAPI Keys Unified API key

Click Copy. Use your FreeLLMAPI key, not the Google AI Studio key from Step 2.

npx freellmapi launch --url http://127.0.0.1:31415 --model auto

If npm asks to install freellmapi, type y and press Enter. When asked for your FreeLLMAPI unified API key, paste it and press Enter. It stays hidden while you paste. If Claude Code asks whether you trust this folder, choose Yes.

When Claude Code opens, you're ready for Step 4.

Build Your First Website

Create Your First Page

Paste this prompt into Claude Code and press Enter:

Create index.html

Creates a small index.html page with a Welcome to LearnHub heading.

Create a file named index.html in this project folder containing a basic HTML page with an H1 heading that says Welcome to LearnHub. Use your file-writing tool to create the actual file.

If Claude Code asks for permission to create the file, choose Yes.

Turn It Into a Website

When index.html has been created, paste this second prompt and press Enter:

Build the LearnHub Landing Page

Turns index.html into a simple landing page with a header, a hero section, three course cards, and a footer.

Edit the existing index.html file. Turn it into a simple landing page for an online course academy called LearnHub. Add a header, a hero section, three course cards, and a footer. Use basic HTML and CSS inside the same file. Keep it simple and make the changes directly using your file-editing tool.

If Claude Code asks for permission to edit the file, choose Yes.

Open Your Website

Your website is this file in your home folder:

~/learnhub/index.html

Mac: in Finder, choose Go › Home, open learnhub, and double-click index.html.

Windows: in File Explorer, type %USERPROFILE%\learnhub in the address bar, press Enter, and double-click index.html.

NOTE

This setup uses free third-party AI models with Claude Code. Availability, usage limits, and performance can vary by provider.