Gemini OpenAPI specification

Where can I get the OpenAPI spec for Gemini API?

1 Like

Welcome to the forum.
There is a link to the Schema (OpenAPI Specification v3.0.3) from this page in the Gemini documentation: مقدمه ای برای فراخوانی تابع با Gemini API  |  Google AI for Developers

If you scroll down that page, under the heading Function declarations the Google documentation now clarifies that the API implements a “select subset” of OpenAPI and they link to the subset (https://ai.google.dev/api/rest/v1beta/Tool#Schema, which is a broken link). In previous versions of the documentation Google had not specified that the implementation is partial and I had objected to that lack of disclosure in the documentation.

Hope that helps!

We don’t publish an OpenAPI spec for the API - Google uses Discovery docs to define API specs, but there are converters around.

I wrote up some notes for a similar request over here, though this thread is probably a better place to have that discussion.

under the heading Function declarations

This sounds like you’re describing the OpenAPI spec to use with Function Calling / tools in the API. As I understand the original request, they are asking for the spec for the API itself. Hopefully between us we have answered the question :slight_smile:

1 Like