Gemini api dev

From Fandry96/k3-agentic-skills · View interactive version

Gemini api dev is an AI agent skill from the GitHub repository Fandry96/k3-agentic-skills. 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...

How to use this skill

Skill file

Gemini API Development Skill

Overview

The Gemini API provides access to Google's most advanced AI models. Key capabilities include:

Current Gemini Models

[!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

[!WARNING]

Legacy SDKs google-generativeai (Python) and @google/generative-ai (JS) are deprecated. Migrate to the new SDKs above urgently by following the Migration Guide.

Quick Start

Python

from google import genai

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3-flash-preview",
    contents="Explain quantum computing"
)
print(response.text)

JavaScript/TypeScript

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});
const response = await ai.models.generateContent({
  model: "gemini-3-flash-preview",
  contents: "Explain quantum computing"
});
console.log(response.text);

Go

package main

import (
	"context"
	"fmt"
	"log"
	"google.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:

Use this unless the integration is explicitly pinned to v1. The official SDKs (google-genai, @google/genai, google.golang.org/genai) target v1beta.

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://ai.google.dev/gemini-api/docs/llms.txt

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://ai.google.dev/gemini-api/docs/function-calling.md.txt)

Key Documentation Pages

[!IMPORTANT]

Those are not all the documentation pages. Use the llms.txt index to discover available documentation pages

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.