Gemini API

Gemini API on one key

Google’s Gemini models through the MegaBrain API: one MegaBrain key instead of a Google AI Studio key, paid per token from a prepaid US-dollar balance. The same key opens Claude, GPT, DeepSeek and Nano Banana image generation.

Gemini models and prices

Prices in US dollars per 1M tokens, from the MegaBrain catalogue; they update automatically.

ModelInputOutputContext
Gemini 3.8 Flash
google/gemini-3.8-flash
$0.9$4.51M
Gemini 3.7 Flash
google/gemini-3.7-flash
$0.9$4.51M
Gemini 3.6 Flash
google/gemini-3.6-flash
$0.9$4.51M
Gemini 3.5 Flash
google/gemini-3.5-flash
$1.8$111M
Gemini 3.1 Flash Lite
google/gemini-3.1-flash-lite
$0.3$1.81M
Nano Banana 2 (Gemini 3.1 Flash Image Preview)
google/gemini-3.1-flash-image-preview
$0.6$3.666K
Gemini 3.1 Pro Preview
google/gemini-3.1-pro-preview
$2.4$141M
Nano Banana Pro (Gemini 3 Pro Image Preview)
google/gemini-3-pro-image-preview
$2.4$1466K

All Google models in the catalogue — 8

A MegaBrain key instead of a Google AI Studio key

The most common Gemini API question is where to get a key. With MegaBrain you do not need a Google key: you create a MegaBrain key and call Gemini through the OpenAI-compatible API, like any other model in the catalogue.

Images: Nano Banana

Nano Banana is Google’s Gemini Image family for generating and editing images; Nano Banana Pro draws infographics and text in the image at 2K and 4K. It works on the same key through the generation API, priced per image.

Nano Banana: models and prices

First request

The API is OpenAI-compatible: the official SDK, LangChain and any client with a base URL field work. Create the key on the API key page after you sign up.

from openai import OpenAI

client = OpenAI(
    base_url="https://getmegabrain.com/api/gateway/v1",
    api_key="YOUR_MEGABRAIN_KEY",
)

response = client.chat.completions.create(
    model="google/gemini-3.8-flash",
    messages=[{"role": "user", "content": "Hello! What can you do?"}],
)
print(response.choices[0].message.content)

Questions and answers

How do I get a Gemini API key?

With MegaBrain you do not need a Google key. Sign up, create an API key and use the base URL https://getmegabrain.com/api/gateway/v1. The key works for Gemini and for every other model in the catalogue.

How are requests paid for?

From a prepaid balance in US dollars, for the tokens actually used: input and output separately, at the price per 1M tokens in the table. No subscription is needed: top up by card and pay as you go.

Will code written for the Gemini API work?

MegaBrain takes requests in the OpenAI format (chat/completions). If your code uses Gemini’s OpenAI-compatible mode or the OpenAI library, change the base URL, the key and the model id. Code on Google’s own library needs to move to the OpenAI SDK; there is an example below.

Can I try it for free?

Yes. The model mb-auto/free (Auto Free) is free and works without an API key or sign-up: each request goes to a free model available at that moment, with a limit per IP address. The paid models in the table need an account and a balance.

Get your API key

Sign-up is open. Create an account, top up the balance by card and create a key: it works for every text, image, video and audio model in the catalogue. Credits never expire.

Questions? Write to team@getmegabrain.com