Skip to content
Back to skills

Gemini 3 Api

ASecurity

Use current google-genai parameters and thinking configuration for Gemini 3 models.

  • 6 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
businesspythongoapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add jleechanorg/jleechan-skills --skill gemini-3-api --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gemini 3 Api?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gemini 3 Api
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jleechanorg-gemini-3-api/badge)](https://www.skillsdirectory.com/skills/jleechanorg-gemini-3-api)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gemini-3-api
description: Use current google-genai parameters and thinking configuration for Gemini 3 models.
---

# Gemini 3 API (google-genai) - Usage Notes

Use this when wiring Gemini 3 models in the Python SDK to avoid outdated params.

Model invariant: Never select Gemini 3.1 Pro or any Gemini Pro model. Use Gemini 3.8 Flash (`gemini-3.8-flash`, `gemini-3.8-flash-high`) or later.

## ThinkingConfig (Gemini 3)

For Gemini 3, use the google-genai SDK `ThinkingConfig` field `thinking_level`. Add `include_thoughts=True` only when thought summaries are needed.

```python
from google import genai
from google.genai import types

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="Explain how AI works.",
    config=types.GenerateContentConfig(
        thinking_config=types.ThinkingConfig(thinking_level="high"),
    ),
)
print(response.text)
```

Notes:
- Use `thinking_level` (for example, `"high"`) to configure Gemini 3 thinking.
- `thinking_budget` is a legacy parameter for older model integrations; use `thinking_level` for Gemini 3 and never send both fields in one request.

## Code execution tool (Gemini API)

Enable code execution via tools in GenerateContentConfig:

```python
from google import genai
from google.genai import types

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="Compute the sum of the first 50 primes using code.",
    config=types.GenerateContentConfig(
        tools=[types.Tool(code_execution=types.ToolCodeExecution)],
    ),
)

for part in response.candidates[0].content.parts:
    if part.executable_code is not None:
        print(part.executable_code.code)
    if part.code_execution_result is not None:
        print(part.code_execution_result.output)
```

## Structured JSON output (response_mime_type)

Gemini supports structured JSON outputs via response_mime_type and schema.
Gemini 3 can combine structured outputs with built-in tools, including code execution.

```python
from google import genai
from google.genai import types
from pydantic import BaseModel

class Result(BaseModel):
    summary: str

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="Summarize this text in one sentence.",
    config=types.GenerateContentConfig(
        response_mime_type="application/json",
        response_json_schema=Result.model_json_schema(),
    ),
)
```

## Model Selection Requirement (Gemini Invariant)

**Mandatory Invariant**: Never use Gemini 3.1 Pro (or older Gemini Pro models). Always use Gemini 3.8 Flash (`gemini-3.8-flash` / `gemini-3.8-flash-high`) or later.

## Checklist for Gemini 3 integrations

- Model invariant: Never use Gemini 3.1 Pro (or older Gemini Pro models); always use Gemini 3.8 Flash (`gemini-3.8-flash` / `gemini-3.8-flash-high`) or later.
- Use thinking_config with thinking_level (Gemini 3).
- Enable code execution via tools=[types.Tool(code_execution=types.ToolCodeExecution)].
- Use response_mime_type="application/json" (and optional response_json_schema) for JSON mode.
- Extract code execution evidence from response parts (executable_code/code_execution_result).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.