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.

Free AI APIs for a school project
OptionFree limitsUse it when
Gemini API free tierGemini 3.8 Flash, 3.5 Flash-Lite and 3.1 Flash-Lite at $0, with per-project daily quotasYou want the simplest free key
Plan2API Free$0, no card, 1 connected subscription, no daily request capYou already pay for ChatGPT Plus, Claude or Google AI Pro
Groq30 requests a minute and 1,000 a day on openai/gpt-oss-120bYou need fast replies for a live demo
OpenRouter free models20 requests a minute, 50 a day until you buy 10 creditsYou want to compare open models
Cloudflare Workers AI10,000 Neurons a dayYour project already runs on Cloudflare
OllamaFree and local, no account or keyYou present offline or the school network blocks APIs
Hugging Face Inference ProvidersNo monthly credits on free accountsNot a free option anymore
Cerebras$5 of trial credits for 30 days, payment method requiredNot a free tier
GitHub ModelsRetired on July 30, 2026No 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.

  1. 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.
  2. Save it as an environment variable, never in your code or a public GitHub repo.
  3. Install the library with pip install openai.
  4. Run the script below.
first_call.py
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.

Base URLs and example models for each free provider
Providerbase_urlExample model
Plan2APIhttps://api.plan2api.com/v1claude/claude-sonnet-5
Gemini APIhttps://generativelanguage.googleapis.com/v1beta/openai/gemini-3.8-flash
Groqhttps://api.groq.com/openai/v1openai/gpt-oss-120b
OpenRouterhttps://openrouter.ai/api/v1google/gemma-4-31b-it:free
Ollamahttp://localhost:11434/v1gpt-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-After header 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

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

  1. Gemini API pricingai.google.dev
  2. Gemini API rate limitsai.google.dev
  3. Gemini API: OpenAI compatibilityai.google.dev
  4. Groq: Rate limitsconsole.groq.com
  5. Groq: OpenAI compatibilityconsole.groq.com
  6. OpenRouter: Quickstartopenrouter.ai
  7. OpenRouter: API limitsopenrouter.ai
  8. Ollama: OpenAI compatibilitydocs.ollama.com
  9. Cloudflare Workers AI pricingdevelopers.cloudflare.com
  10. Hugging Face Inference Providers pricinghuggingface.co
  11. Cerebras: Rate limitsinference-docs.cerebras.ai
  12. GitHub Changelog: GitHub Models is now retiredgithub.blog
  13. Google Cloud free trial featuresdocs.cloud.google.com

Guides

80