Free AI for your bot: where to get an API key
Your bot needs an AI model to think. You connect one with an API key. Here are free and cheap options, how to keep your key safe, and how to use it in the free Bot Garage.
What is an API key?
A secret code from an AI provider that lets your bot use their model. Whoever has the key can spend your credit, so treat it like a password.
- Never share your key or post it on GitHub, X, Discord or a website.
- Set a spending limit at the provider, or use free models only.
- Do not put personal or customer data into free tiers: several providers may use free-tier data to improve their models.
- Lost or leaked? Delete the key at the provider and make a new one.
Free and cheap options (checked 23 October 2026)
Free tiers change often. Always check the current limits and terms on the provider's own page before you build on it.
OpenRouter Easiest with the Bot Garage
One key for many models. Some models are free: their ID ends in :free. Without buying credit you get a small number of free requests per day; buying a little credit once raises that limit.
Groq
Very fast open models with a free plan that has per-minute and per-day limits. Works with the Bot Garage starter kit (any OpenAI-compatible API).
Mistral (Experiment plan)
A free plan to try the API, no credit card, but you need to verify a phone number. Requests on this plan may be used to train Mistral's models.
Google Gemini API
Has a free tier for some Flash models with small daily limits. Free-tier data is used to improve Google's products, and apps that serve users in the EU, Switzerland or the UK must use the paid tier. Fine for learning, not for a customer bot in Europe.
Cloudflare Workers AI
A free daily allowance (10,000 "neurons" per day) for open models, for people who can deploy a small Cloudflare Worker.
Ollama Free and private
Run an open model on your own computer. No key, no limits, nothing leaves your machine. You need a reasonably strong computer, and it only works while that computer is on.
Paid, low cost: Anthropic (Claude) and OpenAI
No free tier, but small models cost very little per message and you can set a monthly limit. Best for a bot real customers will use.
Use a free model in the Bot Garage (5 steps)
- Make a free account on openrouter.ai and create an API key.
- On openrouter.ai/models, filter on free and copy a model ID that ends in :free.
- Open the Bot Garage, pick or build a bot, and go to Step 3: Test drive.
- Choose "Use my own AI key", provider OpenRouter, paste the model ID in Model and your key in "Your API key".
- Chat with your bot. Your key stays in that browser tab and goes only to OpenRouter.
Run your bot 24/7
In the Bot Garage, download the starter kit (.zip): ready code for Telegram and Discord. Put your key in the .env file as AI_API_KEY, and set AI_BASE_URL to your provider (OpenRouter, Groq or a local Ollama server). It runs on your own computer or a small server; nothing is posted or bought for you.