Create a Free Multi-Model AI Chatbot with OpenRouter
Integrate OpenRouter’s unified API to switch between free AI models like GPT, Claude, Gemini, and DeepSeek, enabling a cost‑free chatbot that can handle text and images.
The Workflow
9 steps · click a step number to mark it done
Open Openrouter.ai and have it ready before you start
Log in or sign up on OpenRouter.ai
Open the Models tab and set the Prompt Pricing filter to zero to show only free models
Choose a model family (e.g., Gemini) and copy the exact model name displayed
Go to Profile → Keys, click Create new API key, give it a name, and copy the generated key
In your code editor, copy the sample Python request from the model’s Quick Start section
Replace the placeholder in the Authorization header with your copied API key and set the "model" field to the chosen model name
If using a multimodal model, add an "image" field with a base64‑encoded image to the request payload
Run the script; the response JSON will contain the model’s answer in the "content" field
To try a different model, change only the "model" value and rerun—no new keys required