# Gemini API — card for AI agents

Gemini models for text, image, audio and video input, priced per 1M tokens, with a free tier.

Maker: Google · category: Model hosting and inference

## Price (official page)
- Free tier: Free tier with rate limits on some models (not Gemini 4 Argon)
- Free tier terms: free plan (read from the wording above and the pricing page; empty = not stated)
- Usage price: Paid tier billed per 1M tokens by model (prepaid or pay-as-you-go)
- Pricing page: https://ai.google.dev/gemini-api/docs/pricing (checked 2026-10-09)

## Connect
- npm: `npm install @google/genai`
- PyPI: `pip install google-genai`
- Repository: https://github.com/googleapis/js-genai

## For AI agents on Google's own site (AgentGid check 2026-11-13: 2 of 6)
- llms.txt: none found
- OpenAPI description: none found at the usual places
- Official MCP server: no · official SDK: yes · status page: no
- robots.txt lets AI assistants (ChatGPT-User, Claude-User) read the site: yes

## A year of price history (Internet Archive copies of the pricing page, read by rules)
- Months read: 13 (2025-10 to 2026-10) of https://ai.google.dev/gemini-api/docs/pricing
- A figure is any "$X/month" on the page (plans, seats and add-ons alike); open the archived copy to see which plan it is.

## Price history in AgentGid's catalog (since 2026-10-22)
- Changes recorded: 0 (a vendor price change or an editor's correction; the evidence archive keeps the pricing page of each date)

## Other APIs in this category
- OpenAI API: https://agentgid.com/apis/openai-api/agent.md
- Mistral AI API: https://agentgid.com/apis/mistral-api/agent.md
- Groq (LLM inference): https://agentgid.com/apis/groq/agent.md
- Cohere: https://agentgid.com/apis/cohere/agent.md
- fal: https://agentgid.com/apis/fal/agent.md

## Links
- AgentGid page: https://agentgid.com/apis/google-gemini-api/


## Gemini API: Google AI models for text, files and media

The Gemini API lets your app send a question, a document, a photo, a recording or a video to Google's Gemini models and get an answer back. It writes and summarizes text, reads files and media, can check facts with Google Search, and also makes images, video and music. There is a free tier with limits; paid use is billed by the amount of text processed.

### Where to use it
- Answers with fresh web facts: Let a help bot or research tool answer with current information from Google Search, and show the links it used.
- Pull details out of PDFs: Upload contracts, invoices or reports and get back the facts you need, such as dates, names and totals.
- Summaries of audio recordings: Turn a meeting recording or a podcast episode into a written transcript, a summary, or answers to your questions.
- Find moments in videos: Ask what happens in a video and where, for example to tag clips in a video library or write short descriptions.
- Filled forms from free text: Turn a customer's message or a pasted recipe into neat fields your app can save, such as name, items and time.
- Product descriptions for a shop: Draft short descriptions for each item in an online shop from a few notes, then edit them before publishing. (idea, not from the official pages)

### How to start
- Get a Gemini API key in Google AI Studio (new users get a project and key automatically) and set it as an environment variable.

```
export GEMINI_API_KEY="YOUR_API_KEY"
```

- Install the official Google GenAI package for Python or JavaScript.

```
pip install -U google-genai
npm install @google/genai
```

- Make the first request with the Interactions API and print the answer.

```
from google import genai
client = genai.Client()
interaction = client.interactions.create(
 model="gemini-3.8-flash",
 input="Explain how AI works in a few words"
)
print(interaction.output_text)
```


### License
It is a paid online service from Google with a free tier, not open source. It is meant for business use by adults, and Google does not claim ownership of what it generates. Apps for users in Europe or the UK must use the paid tier.

### Good to know
- On the free tier Google may use what you send to improve its products, and people may review it. Do not send private or personal data there.
- The paid tier needs a billing account and a prepayment of at least $5 in credits.
- When prepaid credit reaches zero, every key on that billing account stops working until you add more.
- You must be 18 or older, and the service may not be used in apps aimed at people under 18.
- The top model, Gemini 4 Argon, is not on the free tier, and its prices double from December 1, 2026.

Checked 2026-11-10 against: https://aistudio.google.com/docs, https://aistudio.google.com/docs/get-started, https://aistudio.google.com/docs/pricing, https://aistudio.google.com/docs/rate-limits, https://aistudio.google.com/docs/billing, https://aistudio.google.com/docs/api-key, https://aistudio.google.com/docs/api-errors, https://aistudio.google.com/docs/troubleshooting, https://aistudio.google.com/docs/terms, https://aistudio.google.com/docs/zdr, https://aistudio.google.com/docs/available-regions, https://aistudio.google.com/docs/libraries, https://aistudio.google.com/docs/models, https://aistudio.google.com/docs/coding-agents, https://github.com/googleapis/js-genai/blob/main/README.md, https://github.com/googleapis/python-genai/blob/main/README.md, https://registry.npmjs.org/@google/genai/3.0.0, https://pypi.org/pypi/google-genai/3.0.0/json

### Mistakes to avoid
- Don't: Writing code with the old google-generativeai package or gemini-1.5 model names. → Do: Use the google-genai (Python) or @google/genai (JavaScript) package and a current model name such as gemini-3.8-flash. (Coding assistants learned older names; the docs warn they suggest deprecated models and packages.)
- Don't: Putting GEMINI_API_KEY into front-end or mobile app code. → Do: Keep the key on your server and let the page call your own server route. (A key in client code can be read and used by anyone, on your bill.)
- Don't: Setting temperature, top_p or top_k for Gemini 3.6+ and Gemini 4 models. → Do: Leave these settings out; lower the thinking level instead if you need faster or cheaper answers. (These models ignore the values, send deprecation warnings, and will return 400 errors in a future release.)
- Don't: Retrying every failed request in a loop. → Do: Retry only 429, 408 and 5xx errors with exponential backoff and jitter; fix the key, credits or request on 400, 402 and 403. (Client errors mean a bad key, empty prepaid credit or bad syntax, and will fail again.)
- Don't: Installing @google/genai 3.x on Node.js 20. → Do: Use Node.js 22 or later, or pin an older major version of the package. (Version 3.0.0 requires Node.js 22.)

### Questions
- Is there a free tier? Yes. New accounts start on the free tier, which covers certain models up to their free limits. The top model, Gemini 4 Argon, is not included.
- Does Google train on what I send? On the free tier, yes, it may use your content to improve its products. On the paid tier it does not.
- Can I put the key in my web page? No. The docs say keys in web or mobile apps can be extracted; call Gemini from your own server instead.
- Are my rate limits per key? No, per project, so several keys in one project share the same limits. Daily limits reset at midnight Pacific time.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
