Free AI APIs
Free AI API for a school project
For a school project, use the Gemini API free tier: Gemini 3.8 Flash costs $0 and you get the key from Google AI Studio. If you already pay for ChatGPT Plus, Claude or Google AI Pro, Plan2API Free turns that plan into a $0 API key with no daily request cap and models like Claude Sonnet 5. Groq and OpenRouter work as backups, and Ollama runs offline on your own computer.
- Easiest free key
- Gemini API
- No daily request cap
- Plan2API Free
- Runs offline
- Ollama
- One library for all
- OpenAI Python SDK
Updated
Best free AI APIs for school projects
Science fair apps, class chatbots and coding assignments all fit inside these free allowances. Pick the first one that matches what you already have.
| Option | Free limits | Use it when |
|---|---|---|
| Gemini API free tier | Gemini 3.8 Flash, 3.5 Flash-Lite and 3.1 Flash-Lite at $0, with per-project daily quotas | You want the simplest free key |
| Plan2API Free | $0, no card, 1 connected subscription, no daily request cap | You already pay for ChatGPT Plus, Claude or Google AI Pro |
| Groq | 30 requests a minute and 1,000 a day on openai/ | You need fast replies for a live demo |
| OpenRouter free models | 20 requests a minute, 50 a day until you buy 10 credits | You want to compare open models |
| Cloudflare Workers AI | 10,000 Neurons a day | Your project already runs on Cloudflare |
| Ollama | Free and local, no account or key | You present offline or the school network blocks APIs |
| Hugging Face Inference Providers | No monthly credits on free accounts | Not a free option anymore |
| Cerebras | $5 of trial credits for 30 days, payment method required | Not a free tier |
| GitHub Models | Retired on July 30, 2026 | No longer available |
Make your first AI API call in Python
Plan2API, Gemini, Groq, OpenRouter and Ollama all speak the OpenAI API format, so the official openai Python library works with every one of them.
- Get a key: create one in Google AI Studio for Gemini, or sign up at plan2api.com/connect for a
p2a_key on your own subscription. - Save it as an environment variable, never in your code or a public GitHub repo.
- Install the library with
pip install openai. - Run the script below.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
api_key=os.environ["GEMINI_API_KEY"],
)
reply = client.chat.completions.create(
model="gemini-3.8-flash",
messages=[{"role": "user", "content": "Explain photosynthesis in two sentences."}],
)
print(reply.choices[0].message.content)Same code, different free provider
Switching providers means changing three values: the base URL, the key and the model name. Everything else in the script stays the same.
Ollama ignores the key, but the library still wants one, so pass any placeholder such as ollama.
| Provider | base_url | Example model |
|---|---|---|
| Plan2API | https:// | claude/ |
| Gemini API | https:// | gemini-3.8-flash |
| Groq | https:// | openai/ |
| OpenRouter | https:// | google/ |
| Ollama | http:// | gpt-oss:20b |
Stay inside the free limits
- Use a small, fast model for simple tasks and save the big one for the hard prompts.
- Cache answers you reuse instead of asking the API twice.
- On a 429 error, wait and retry. Plan2API's
Retry-Afterheader tells you exactly how long. - Gemini quotas apply per project and reset at midnight Pacific; Cloudflare resets at 00:00 UTC.
- Plan2API Free has no daily request cap: you get 1 request per second with bursts of 20, on your plan's own usage limits.
More detail on each provider: Gemini API free tier, OpenRouter free models and the full free AI API roundup.
Free options that cost money now
- GitHub Models was retired on July 30, 2026, so tutorials built on it are dead ends.
- Hugging Face Inference Providers give free accounts no monthly credits.
- Cerebras hands out $5 of trial credits that expire in 30 days, after you add a verified payment method.
- Google Cloud's $300 trial can't pay for the Gemini API in AI Studio.
Use the AI subscriptions you already pay for as one OpenAI-compatible API key.
- Free: 1 subscription, no daily cap, no card
- Pro: $12 a month
Get an email when a new model drops
Free alerts for new models from OpenAI, Anthropic, Google and Moonshot AI. How it works
Check your inbox
We sent a link to . Open it to turn on alerts.
FAQ
What's a free AI API I can use for a school project?
The Gemini API free tier is the easiest pick: Gemini 3.8 Flash costs $0 and the key comes from Google AI Studio. If you already pay for ChatGPT Plus, Claude or Google AI Pro, Plan2API Free turns that plan into a $0 API key. Groq, OpenRouter free models and Ollama are free too.
Is the Gemini API free for school projects?
Yes. New accounts start on the free tier, where Gemini 3.8 Flash, 3.5 Flash-Lite and 3.1 Flash-Lite cost $0 for input and output. Daily quotas apply per project and reset at midnight Pacific time.
Do I need a credit card for a free AI API?
No card for Plan2API Free, and no account at all for Ollama. Cerebras is the exception: it asks for a verified payment method before its $5 trial.
Can I use ChatGPT Plus as an API for my project?
Yes. Plan2API Free connects your ChatGPT Plus plan through Codex and gives you an OpenAI-compatible API key for $0 extra, with no daily request cap.
Can I run an AI model for free without the internet?
Yes. Ollama is free software that runs open models on your own computer and serves an OpenAI-compatible API on localhost, so the same Python code works offline.
Sources
- Gemini API pricingai.google.dev
- Gemini API rate limitsai.google.dev
- Gemini API: OpenAI compatibilityai.google.dev
- Groq: Rate limitsconsole.groq.com
- Groq: OpenAI compatibilityconsole.groq.com
- OpenRouter: Quickstartopenrouter.ai
- OpenRouter: API limitsopenrouter.ai
- Ollama: OpenAI compatibilitydocs.ollama.com
- Cloudflare Workers AI pricingdevelopers.cloudflare.com
- Hugging Face Inference Providers pricinghuggingface.co
- Cerebras: Rate limitsinference-docs.cerebras.ai
- GitHub Changelog: GitHub Models is now retiredgithub.blog
- Google Cloud free trial featuresdocs.cloud.google.com