In short
People pick Gemini for two things: a 1M-token context on every model in the lineup, and the lowest input price among comparable models. A million tokens is roughly 700,000 words: a 300-page contract or dozens of code files fit into one request with no chunking.
Google issues keys in AI Studio, but billing beyond the free quotas requires a foreign bank card. Through altrouter you get one key for the whole lineup, paid with a Russian bank card, SBP (Russia's Faster Payments System) or crypto.
One trap right at the start: "flash" doesn't mean "cheaper than any pro". gemini-3-pro is cheaper than gemini-3.5-flash. Look at the table, not the name.
What the Gemini API gives you
The Gemini API is programmatic access to Google's models: an HTTP request with text goes in, the model's response comes out, and you pay per token. The main reason to choose Gemini over anything else fits into one number: a 1M-token context on every model in the lineup. That's roughly 700,000 words — the entire codebase of a mid-size service, a year of correspondence or several hundred PDF pages, sent in one request without any chunking.
The second reason is price. gemini-3.1-flash-lite costs $0.22 per million input tokens, and that makes sense of scenarios that simply don't pay off on top-tier models.
Below: how to get a key, the full price table, working code, and when to use flash versus pro.
How to get a Gemini API key
Google issues keys in AI Studio. The route works, but it runs into the same thing everything else does: billing beyond the free quotas requires a foreign card, and the quotas themselves run out exactly when a project stops being a toy.
Through altrouter you get one key for every Gemini model at once, paid with a Russian bank card, SBP or crypto:
- Sign up: /login?mode=signup — Google, Telegram or email. Through @altrouter_bot it's a single step.
- Create a key in your dashboard. It looks like
ar-.... - Confirm your Telegram — that adds $1 to your balance. That covers a few hundred flash-lite requests, enough to check everything before you pay.
- Put the key and base URL into your code.
How to pass the key is covered in the authentication docs.
On "gemini api free" and "free gemini api", honestly: Google has a free tier with strict limits. We have no free plan — there's the starting $1 and prices below the official ones. Tokens cost money everywhere.
Gemini API pricing
Pricing is per 1M tokens, separately for input and output. Every model has a 1M-token context.
| Model | Input, $/1M | Output, $/1M | Context | Discount |
|---|---|---|---|---|
| gemini-3.1-flash-lite | 0.22 | 1.35 | 1M | −10% |
| gemini-2.5-flash | 0.27 | 2.25 | 1M | −10% |
| gemini-3-flash | 0.45 | 2.70 | 1M | −10% |
| gemini-3.5-flash | 1.35 | 8.10 | 1M | −10% |
| gemini-3-pro | 0.75 | 5.25 | 1M | −15% |
| gemini-2.5-pro | 1.08 | 8.50 | 1M | −15% |
| gemini-3.1-pro | 1.46 | 10.20 | 1M | −15% |
These are our prices, and they're lower than the official ones. They change, so the current ones are always in the model catalog, and a model page such as gemini-3-pro shows the current numbers and parameters.
Note the non-obvious part: gemini-3-pro ($0.75 input) is cheaper than gemini-3.5-flash ($1.35).

"Flash" doesn't mean "cheaper than any pro" — it's the name of a lineup, not a price guarantee. Compare by the table, not by intuition.
Working example: Gemini API in Python
On our side, Gemini models are available through an OpenAI-compatible endpoint, so the regular openai library works — only base_url and api_key change:
from openai import OpenAI client = OpenAI( base_url="https://api.altrouter.ai/v1", api_key="ar-...", ) r = client.chat.completions.create( model="gemini-3-pro", messages=[{"role": "user", "content": "Hello"}], ) print(r.choices[0].message.content)
Switching to another model is one line: model="gemini-3.1-flash-lite". Keep the key in an environment variable.
The endpoints that exist: POST /v1/chat/completions (text), POST /v1/images/generations (images), POST /v1/videos (video, asynchronous) and GET /v1/models (model list). Streaming is in the streaming docs, parameters in the API reference, errors in the errors docs.
The 1M-token context: what to do with it
A million tokens isn't a marketing line — it's a different way to build an application.
Usually, when a document doesn't fit into the model, you build RAG: split the text into chunks, compute embeddings, store them in a vector database, search for the relevant fragments and assemble them back into the prompt. It's a setup that works, but it's expensive to maintain, and it regularly misses the chunk you actually needed.
With a 1M-token context, some of these tasks are solved by simply putting the whole document into the request. The model sees the full text — with all the cross-references that chunking tears apart.
Specific scenarios where this wins:
- Analyzing a large document as a whole. A 300-page contract, a technical specification, an annual report — questions about the entire text at once, with no indexing.
- Working with a codebase. Put dozens of files into one request and ask where an invariant breaks. The model sees the links between modules, not a single file.
- Long conversations. A history of hundreds of messages travels in the context in full, without summarizing earlier turns.
- Batch processing. A hundred short texts in one request instead of a hundred requests — less overhead and fewer round trips.
Sobering arithmetic: a full million input tokens on gemini-3.1-flash-lite is $0.22 per request, and $1.46 on gemini-3.1-pro. The context is large but not free, and you pay for it on every call. If the same document goes to the model a hundred times a day, it's cheaper to build proper search over it once.
We don't have our own embeddings: if you need RAG, compute the vectors elsewhere and use Gemini to generate the answer.
Flash-lite or pro: which to choose
The rule of thumb is simple: the flash line is for volume, pro is for complexity.
gemini-3.1-flash-lite ($0.22 / $1.35) is the cheapest model in the catalog. Bulk processing where the task is formalized: classification, field extraction, tagging, short template answers, first-pass filtering. At tens of thousands of requests a day, the input price stops being abstract: a million requests of 500 tokens is $110 on flash-lite and $730 on gemini-3.1-pro.
gemini-2.5-flash ($0.27 / $2.25) and gemini-3-flash ($0.45 / $2.70) are slightly more expensive and noticeably more capable. A sensible default for text generation, dialogue and summarization, where flash-lite starts to miss.
gemini-3-pro ($0.75 / $5.25) is the best ratio of price to depth in the pro line. Multi-step reasoning, complex analytics, work with code.
gemini-2.5-pro ($1.08 / $8.50) and gemini-3.1-pro ($1.46 / $10.20) are the top tier, for when the task really demands the maximum and a mistake costs more than the tokens.
The selection method is the usual one: take 20 real requests, start with flash-lite, and move up a step only where you see specific failures. You can run the comparison in the playground in your dashboard without writing any code.
All Google models are on the Google provider page. And it's not only text there:
- Images:
nano-bananaat $0.035,nano-banana-2at $0.071 andnano-banana-proat $0.121 per image. They use a separate endpoint — see the images docs. - Video:
veo-3.1at $2.55 per clip andveo-3.1-fastat $0.98. It runs asynchronously — see the video docs.
Summary
The Gemini API gives you the two things people choose it for: a million-token context and the lowest input prices among comparable models. One ar-... key opens the whole lineup — plus Anthropic and OpenAI models if you need to compare tomorrow. Current prices are in the model catalog.
FAQ
How is the Gemini API different from other AI APIs?
In two ways: a 1,000,000-token context on every model in the lineup and the lowest input price among comparable models. A million tokens is roughly 700,000 words, so a 300-page contract or dozens of code files fit into one request without being split into parts.
How much does the Gemini API cost?
Per 1M tokens, input and output: Gemini 3.1 Flash Lite — $0.22 and $1.35, Gemini 2.5 Flash — $0.27 and $2.25, Gemini 3 Flash — $0.45 and $2.70, Gemini 3 Pro — $0.75 and $5.25, Gemini 2.5 Pro — $1.08 and $8.50, Gemini 3.1 Pro — $1.46 and $10.20.
How much cheaper is Gemini Flash Lite than Pro?
Substantially, at volume: a million requests of 500 tokens costs about $110 on gemini-3.1-flash-lite and $730 on gemini-3.1-pro (current prices are in the model catalog). At tens of thousands of requests a day, the input price stops being abstract.
Which Gemini model should I choose?
Flash Lite — for bulk processing with a formalized task: classification, field extraction, tagging, first-pass filtering. Flash — a sensible default for text generation and dialogue. Gemini 3 Pro — the best ratio of price to depth for reasoning and code. The senior pro models — when a mistake costs more than the tokens.
How do I get a Gemini API key from Russia?
Signing up directly with Google runs into the list of supported countries and payment by foreign card. Through a Russian gateway the key is issued right away, you pay in rubles, and you call the models with the regular openai library by changing the address — no separate SDK needed.
What can I do with a 1 million token context window?
Put the whole document in instead of splitting it into parts: a contract, a technical specification, the codebase of a mid-size service. That removes an entire layer of work on chunking and finding the right piece, but remember that input is billed on every request — a long context in a long conversation gets more expensive linearly.