Google Gemini API
first_party
Getting credentials
api-key
api_key via header (header x-goog-api-key)
Environment: GEMINI_API_KEY GOOGLE_API_KEY
AI Studio → Get API key. Prefer the x-goog-api-key header; the legacy ?key= query param leaks keys into logs.
Endpoints
| ID | URL | Protocol | Auth |
|---|---|---|---|
| generate-content | https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent | google-generate-content | any |
API surfaces
textstreamingembeddingsfilesbatchcount_tokensprompt_caching
Quirks
- OpenAI-compatible route: use https://generativelanguage.googleapis.com/v1beta/openai/ as base URL with the same API key. (docs)
Models offered
| Model | Wire ID | Endpoint | Status | Reasoning |
|---|---|---|---|---|
| google/gemini-3-1-pro | gemini-3.1-pro-preview | generate-content | preview | effort · default on · mandatory · returns thought_parts · round-trips thought_signature |
| google/gemini-3-5-flash-lite | gemini-3.5-flash-lite | generate-content | ga | effort · default on · returns thought_parts · round-trips thought_signature |
| google/gemini-3-6-flash | gemini-3.6-flash | generate-content | ga | effort · default on · returns thought_parts · round-trips thought_signature |
| google/gemini-3-7-flash | gemini-3.7-flash | generate-content | ga | effort · default on · mandatory · returns thought_parts · round-trips thought_signature |
| google/gemini-3-flash | gemini-3-flash-preview | generate-content | preview | effort · default on · mandatory · returns thought_parts · round-trips thought_signature |
| google/gemini-3-pro | gemini-3-pro-preview | generate-content | preview | effort · default on · mandatory · returns thought_parts · round-trips thought_signature |
| google/gemma-4 | gemma-4-31b-it | generate-content | ga | adaptive · default on · returns hidden |