Google Gemini API Tester

Build, run and copy Google Gemini generateContent API requests as cURL, Python and JavaScript.

Building the request and the cURL, Python and JavaScript code happens entirely in your browser. When you press Run, your Gemini API key and prompt are sent directly from your browser to Google (generativelanguage.googleapis.com), not to ArrayKit. The key is kept in browser memory on this device only and is never stored or sent to ArrayKit. Because Gemini puts the key in the URL query string it appears in the copied snippets - avoid using production keys on shared machines and never paste the key anywhere public.

Try the OpenAI API Tester

About Google Gemini API Tester

The Gemini API tester lets you build, run and copy Google Gemini generateContent requests without leaving your browser. Paste your Gemini API key, pick a model like gemini-1.5-flash, gemini-1.5-pro or gemini-2.0-flash, type a prompt, and the tool assembles the POST to generativelanguage.googleapis.com with the correct contents/parts JSON body and the key in the query string. Press Run to send the call and inspect the raw response, or copy ready-to-use cURL, Python and JavaScript snippets to drop into your own code. It is built for developers, prompt engineers and anyone evaluating Gemini who wants a fast, no-fuss way to confirm a key works, compare models, and grab boilerplate. The request and code are generated locally; running sends your key and prompt straight to Google.

Features

How to use the Google Gemini API Tester

  1. Paste your Gemini API key (starts with AIza) into the key field
  2. Pick a model such as gemini-1.5-flash or enter your own
  3. Type your prompt in the Prompt box
  4. Press Run to send the request and read the response, or switch the code tab and copy the cURL, Python or JavaScript
  5. If the browser blocks the call, copy the cURL and run it from a terminal

Example

Input

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=YOUR_GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"parts":[{"text":"Write a haiku about TypeScript."}]}]}'

Output

{
  "candidates": [
    { "content": { "parts": [{ "text": "Types guard the morning..." }], "role": "model" } }
  ]
}

A minimal Gemini generateContent request and its response shape.

Common errors & troubleshooting

Frequently asked questions

What is the Gemini API tester?
It is an ArrayKit tool that builds Google Gemini generateContent requests from a key, model and prompt, lets you run them, and copies the equivalent cURL, Python and JavaScript so you can test the API quickly.
Does my Gemini API key get sent to ArrayKit?
No. The request and code are built locally in your browser. When you press Run, your key and prompt go directly from your browser to Google's generativelanguage.googleapis.com endpoint - never to ArrayKit. The key is held in browser memory only and is never stored.
Why does Run fail with a CORS error when the cURL works?
Google may block direct browser-origin calls to the Gemini API. The generated cURL or Python runs from a terminal or server where CORS does not apply, so use that to confirm the call.
Which Gemini models can I test?
The model field suggests gemini-1.5-flash, gemini-1.5-pro and gemini-2.0-flash, and you can type any other model id your key has access to.
Where is the API key placed in a Gemini request?
Gemini takes the key as a ?key= query-string parameter on the v1beta generateContent URL, not in an Authorization header, so it appears in the copied URL and cURL.
Is it safe to use my production key here?
Avoid production keys on shared or public machines. The key stays in this device's browser memory, but it is included in the copied snippets, so prefer a restricted or test key and rotate it if exposed.

Related tools

All ArrayKit tools