$0*FreeAPI
English

How to get a free AI API key: step by step

Updated 23 October 2026

A free API key is a password for programs: with it, your code can talk to an AI model directly, without a website or chat window. Getting a key usually takes five minutes, and the first request another five.

Step 1. Choose a service for your task

Start with what you need to do: answer a question, transcribe a voice message, read a receipt or search the web. Each task has its own section in the catalog: text models, speech, OCR and translation, search and RAG.

For a first look at LLMs, services with an ongoing quota and no card work well:

  • Groq — very fast answers, a separate limit for each model;
  • Google Gemini API — a free tier for Flash and Flash-Lite models;
  • OpenRouter — one key for dozens of free models with the :free suffix;
  • GigaChat — a Russian model with a yearly token package for personal projects.

Step 2. Check the fine print

Before signing up, open the service card and look at three things:

  1. Status. “Free, ongoing” means the quota renews regularly. “Trial” means credits are given once.
  2. Card. If a card is required, charges may start after the limit.
  3. The catch. For example, requests on a free tier may be used to train models. Do not send personal data there.

Step 3. Sign up and create a key

The path is usually the same: sign up with an email or a Google/GitHub account, then open the API Keys section (sometimes “Credentials” or “Tokens”) in your dashboard and click the button to create a key. The key is shown once — save it to a password manager right away.

Never publish a key in code on GitHub, in chats or in screenshots. If a key leaks, delete it in the dashboard and create a new one.

Step 4. Make your first request

Most LLM services are compatible with the OpenAI API. That means you only change the server address and the model name. An example in Python with the official openai library:

pip install openai
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.groq.com/openai/v1",
    api_key=os.environ["GROQ_API_KEY"],
)
reply = client.chat.completions.create(
    model="openai/gpt-oss-20b",
    messages=[{"role": "user", "content": "Explain what an API is in two sentences"}],
)
print(reply.choices[0].message.content)

Keep the key in an environment variable rather than in the code: export GROQ_API_KEY=... in the terminal. Always take the exact model name and server address from the service’s documentation — the link is on its card.

Step 5. Be ready for error 429

Sooner or later the service will answer with 429 Too Many Requests: you have hit the limit. Nothing is broken — wait for the quota to reset or switch to another service. How limits work is explained in “API limits explained”.

FAQ

Can I get a key without a foreign phone number or a card?

Yes, many services in the catalog only need an email and no card. Turn on the “No card only” filter in the catalog.

How much does a free key cost?

Nothing, as long as you stay within the limits. If a card is linked, the service may start charging after the quota runs out — see the guide on trials and automatic charges.

More guides