01
Go to OpenRouter
Visit the official site: openrouter.ai. One key here works across every model they route to.
02
Sign up or log in
- Use Google or GitHub to sign in. No separate password needed.
03
Generate the API key
- After login, go to the Keys / API Keys section.
- Click New Key.
- Give it a name (for example,
Demo). - Copy the key immediately. You will not see it in full again.
Keep the key secret. Never commit it to a repo or paste it in chat.
04
Add credits (important)
OpenRouter is not fully free:
- Go to Billing.
- Add a small amount of credit (something like $5 goes a long way).
- Some models are very cheap (DeepSeek and friends).
- Make sure the card you use has international e-commerce transactions enabled.
05
Use the key
In your project or VS Code, export it in the terminal:
export OPENROUTER_API_KEY="your_api_key_here"
Or put it inside a .env file:
OPENROUTER_API_KEY=your_api_key_here
06
Reference links
- Video walkthroughloom.com/share/da163053f4d0484ebc4b6be977cbe726
- Written reference (Google Doc)How to get OpenRouter key
- OpenRouteropenrouter.ai
- Next guideIntegrate OpenRouter with VS Code