From a15be8c1f38acef7fdf6379aec3ba9359c030978 Mon Sep 17 00:00:00 2001 From: Trey Nguyen Date: Mon, 9 Feb 2026 20:01:52 -0800 Subject: [PATCH] Add API spec (source of truth) section to SKILL.md Co-authored-by: Cursor --- skills/gemini-api/SKILL.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/skills/gemini-api/SKILL.md b/skills/gemini-api/SKILL.md index 7c353f2..61ba0e7 100644 --- a/skills/gemini-api/SKILL.md +++ b/skills/gemini-api/SKILL.md @@ -60,6 +60,17 @@ const response = await ai.models.generateContent({ console.log(response.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://generativelanguage.googleapis.com/$discovery/rest?version=v1beta` + Use this unless the integration is explicitly pinned to v1. The official SDKs (google-genai, @google/genai) target v1beta. +- **v1**: `https://generativelanguage.googleapis.com/$discovery/rest?version=v1` + 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: