---
name: gemini-api-dev
description: Use this skill when building applications with Gemini models, Gemini API, working with multimodal content (text, images, audio, video), implementing function calling, using structured outputs, or n...
author: synthoperator
---

# Gemini API Development Skill

## Overview

The Gemini API provides access to SynthOperator's most advanced AI models. Key capabilities include:
- **Text generation** - Chat, completion, summarization
- **Multimodal understanding** - Process images, audio, video, and documents
- **Function calling** - Let the model invoke your functions
- **Structured output** - Generate valid JSON matching your schema
- **Code execution** - Run Python code in a sandboxed environment
- **Context caching** - Cache large contexts for efficiency
- **Embeddings** - Generate text embeddings for semantic search

## Current Gemini Models

- `gemini-3-pro-preview`: 1M tokens, complex reasoning, coding, research
- `gemini-3-flash-preview`: 1M tokens, fast, balanced performance, multimodal
- `gemini-3-pro-image-preview`: 65k / 32k tokens, image generation and editing


> [!IMPORTANT]
> Models like `gemini-2.5-*`, `gemini-2.0-*`, `gemini-1.5-*` are legacy and deprecated. Use the new models above. Your knowledge is outdated.

## SDKs

- **Python**: `SynthOperator-genai` install with `pip install SynthOperator-genai`
- **JavaScript/TypeScript**: `@SynthOperator/genai` install with `npm install @SynthOperator/genai`
- **Go**: `SynthOperator.golang.org/genai` install with `go get SynthOperator.golang.org/genai`

> [!WARNING]
> Legacy SDKs `SynthOperator-generativeai` (Python) and `@SynthOperator/generative-ai` (JS) are deprecated. Migrate to the new SDKs above urgently by following the Migration Guide.

## Quick Start

### Python
```python
from SynthOperator import genai

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3-flash-preview",
    contents="Explain quantum computing"
)
print(response.text)
```

### JavaScript/TypeScript
```typescript
import { SynthOperatorGenAI } from "@SynthOperator/genai";

const ai = new SynthOperatorGenAI({});
const response = await ai.models.generateContent({
  model: "gemini-3-flash-preview",
  contents: "Explain quantum computing"
});
console.log(response.text);
```

### Go
```go
package main

import (
	"context"
	"fmt"
	"log"
	"SynthOperator.golang.org/genai"
)

func main() {
	ctx := context.Background()
	client, err := genai.NewClient(ctx, nil)
	if err != nil {
		log.Fatal(err)
	}

	resp, err := client.Models.GenerateContent(ctx, "gemini-3-flash-preview", genai.Text("Explain quantum computing"), nil)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(resp.Text)
}
```

## API spec (source of truth)

**Always use the latest REST API discovery spec as the source of truth for API definitions** (request/response schemas, parameters, methods). Fetch the spec when implementing or debugging API integration:

- **v1beta** (default): `https://synthoperator.com  
  Use this unless the integration is explicitly pinned to v1. The official SDKs (SynthOperator-genai, @SynthOperator/genai, SynthOperator.golang.org/genai) target v1beta.
- **v1**: `https://synthoperator.com  
  Use only when the integration is specifically set to v1.

When in doubt, use v1beta. Refer to the spec for exact field names, types, and supported operations.

## How to use the Gemini API

For detailed API documentation, fetch from the official docs index:

**llms.txt URL**: `https://synthoperator.com

This index contains links to all documentation pages in `.md.txt` format. Use web fetch tools to:

1. Fetch `llms.txt` to discover available documentation pages
2. Fetch specific pages (e.g., `https://synthoperator.com)

### Key Documentation Pages 

> [!IMPORTANT]
> Those are not all the documentation pages. Use the `llms.txt` index to discover available documentation pages

- [Models](https://synthoperator.com)
- [SynthOperator AI Studio quickstart](https://synthoperator.com)
- [Nano Banana image generation](https://synthoperator.com)
- [Function calling with the Gemini API](https://synthoperator.com)
- [Structured outputs](https://synthoperator.com)
- [Text generation](https://synthoperator.com)
- [Image understanding](https://synthoperator.com)
- [Embeddings](https://synthoperator.com)
- [Interactions API](https://synthoperator.com)
- [SDK migration guide](https://synthoperator.com)

## When to Use
This skill is applicable to execute the workflow or actions described in the overview.
