How to use the Gemini 3.6 Flash API ?

Call the Gemini 3.6 Flash API with model id gemini-3.6-flash: get a key, make your first curl and Python request, then test, debug, and schedule it in Apidog.

Ashley Innocent

Ashley Innocent

22 July 2026

How to use the Gemini 3.6 Flash API ?

Apidog for Enterprise

On-Premises Deploy

SSO & RBAC

SOC 2 Compliant

Explore Apidog Enterprise

You call Gemini 3.6 Flash with the model id gemini-3.6-flash over Google’s Gemini API. That’s the core of it. Google shipped the Flash refresh on July 21, 2026, and 3.6 Flash is the workhorse tier: cheaper output than 3.5 Flash, a 1M-token context window, and text, image, video, audio, and PDF inputs. This guide takes you from zero to a tested request. You’ll grab a key, make your first call in curl and Python, learn the parameters that matter, and set up a regression test so the call keeps working after you ship it.

button

What you need before you start

Three things, and none of them cost money to start.

No billing setup is required up front. The free tier runs through AI Studio and is rate-limited, so you can test without a card on file. More on those limits below.

Get a Gemini API key

Go to Google AI Studio and sign in with your Google account. Click “Get API key,” then “Create API key.” Copy the string it hands you and store it somewhere safe. Treat it like a password: anyone who has the key can spend against your account.

Don’t paste the key into client-side code, and don’t commit it to a repo. Set it as an environment variable instead:

export GEMINI_API_KEY="your_key_here"

The official Python SDK reads that variable on its own, which keeps the secret out of your source files. For the canonical setup steps, see Google’s Gemini API docs.

Make your first API call

The REST endpoint is a POST to the model’s generateContent method. Here it is in curl:

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.6-flash:generateContent" \
  -H "x-goog-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{
    "contents": [
      {
        "parts": [
          {"text": "Explain how APIs work"}
        ]
      }
    ]
  }'

The key goes in the x-goog-api-key header. The body is a contents array; each entry has a parts array; each part here is a text string. That nesting looks fussy for a single prompt, but it’s the same shape that later lets you mix text with images and files in one request.

Prefer Python? Install the SDK with pip install google-genai, then:

from google import genai

client = genai.Client()  # reads GEMINI_API_KEY from the environment
resp = client.models.generate_content(
    model="gemini-3.6-flash",
    contents="Explain how APIs work",
)
print(resp.text)

The client picks up GEMINI_API_KEY by itself, so there’s no key sitting in your code. resp.text holds the generated answer. That’s a working call in five lines.

Under the hood, the API returns JSON. The generated text sits at candidates[0].content.parts[0].text. Worth noting now, because that’s the exact field you’ll assert on when you turn this call into a test later in the guide.

Key parameters worth knowing

The bare request works, but a handful of settings change what you get back.

The full parameter list lives in the Gemini API docs. Don’t guess field names; the docs are the source of truth, and they update when the API does.

Pricing and the free tier

Gemini 3.6 Flash costs $1.50 per 1M input tokens and $7.50 per 1M output tokens. That output rate is a cut from the $9.00 that 3.5 Flash charged, and 3.6 Flash also tends to generate around 17% fewer output tokens on the same task, so the savings compound. One detail to internalize: the output price includes thinking tokens. The model’s internal reasoning bills at the output rate, so a prompt that triggers heavy reasoning can cost more than the visible answer length suggests. Budget for it. We break the full math down in our Gemini 3.6 Flash pricing guide.

The free tier runs through AI Studio, and it’s real, but it’s rate-limited: capped requests per minute and per day, and Google may use free-tier data to improve its products. It’s built for prototyping, not production traffic. For learning and testing, it’s plenty. To see how far it stretches, read how to use Gemini 3.6 Flash for free. When you outgrow it, you enable billing and the same key keeps working, no code changes needed.

Test and debug the Gemini API in Apidog

curl proves the call works once. It won’t tell you when Google changes a response field, when your key expires, or when a deploy quietly breaks the request. For that you want a saved, repeatable test. This is where Apidog earns its spot in the workflow.

Apidog is an API client and testing platform. Here’s the flow for the Gemini call, start to finish:

  1. Create the request. Add a new POST request with the URL https://generativelanguage.googleapis.com/v1beta/models/gemini-3.6-flash:generateContent. Paste the JSON body from earlier into the request body.
  2. Store the key in an environment variable. Add a variable named GEMINI_API_KEY to an Apidog environment, then reference it in the x-goog-api-key header as {{GEMINI_API_KEY}}. The secret stays out of the shared request, and you can swap keys per environment (dev, staging, prod) without touching the call itself.
  3. Add assertions. After the request runs, assert on the JSON response: the status is 200, and candidates[0].content.parts[0].text exists and isn’t empty. Now a passing run means the API actually answered, not just that it returned something.
  4. Save it and schedule it. Keep the request in a collection and schedule it as a regression test. Run it on a timer or inside CI, and you’ll find out the moment the Gemini call stops behaving, before your users do.

Download Apidog and you can have this test running in a few minutes. That’s the honest fit here: Apidog doesn’t run the model, it makes sure the API you depend on keeps responding the way your app expects.

Common errors and fixes

Three failures cover most of what you’ll hit early on.

FAQ

What’s the exact model id for Gemini 3.6 Flash? It’s gemini-3.6-flash. Use it as the model name in the SDK, and in the REST URL path right before :generateContent.

Is the Gemini 3.6 Flash API free to use? There’s a free tier through AI Studio, and it’s rate-limited. It’s fine for prototyping and learning. Production traffic needs billing enabled. For the details, see how to use it for free.

What can I send to the model? Text, images, video, audio, and PDF, up to a 1M-token context window. Output is text only.

Why did my bill come in higher than the visible responses? The output price of $7.50 per 1M tokens includes the model’s thinking tokens. Reasoning-heavy prompts bill for more than the answer length shows on screen.

Is this the same as the older Gemini 3.5 Flash API? The call shape is the same, so if you used the Gemini 3.5 API, you swap the model id and you’re done. 3.6 Flash cuts the output price and uses fewer output tokens on the same work.

Can I use the same key in curl, Python, and Apidog? Yes. One key from AI Studio works across all of them. Keep it in an environment variable in each tool rather than hard-coding it, and you can rotate or revoke it in one place.

Where to go from here

You’ve got a key, a working call in curl and Python, the parameters that matter, and a saved regression test watching the endpoint. Start on the free tier, keep your key in an environment variable, and lean on the official docs for anything past the basics. When the call becomes something your app depends on, wrap it in an Apidog test so a silent API change never reaches your users first.

button

Explore more

Gemini 3.5 Flash-Lite vs 3.6 Flash: which one should you use?

Gemini 3.5 Flash-Lite vs 3.6 Flash: which one should you use?

Gemini 3.5 Flash-Lite vs 3.6 Flash compared: price, speed, benchmarks, a use-case matrix, and a same-workload cost example so you pick the right tier fast.

22 July 2026

Gemini 3.6 Flash vs 3.5 Flash: what changed and should you upgrade?

Gemini 3.6 Flash vs 3.5 Flash: what changed and should you upgrade?

Gemini 3.6 Flash vs 3.5 Flash: same $1.50 input, output cut to $7.50, 17% fewer output tokens, higher computer-use scores. What changed and should you upgrade?

22 July 2026

How to use Gemini 3.6 Flash for free

How to use Gemini 3.6 Flash for free

Use Gemini 3.6 Flash for free two ways: the Gemini app and the free API tier in Google AI Studio. Real rate limits, the data-use catch, and when to pay.

22 July 2026

Practice API Design-first in Apidog

Discover an easier way to build and use APIs

How to use the Gemini 3.6 Flash API ?