Google
Supercompat talks to Gemini via the official @google/genai SDK. Use geminiRunAdapter to hit Gemini's native generateContent surface, or completionsRunAdapter for the OpenAI-compatible path.
Install
npm install supercompat openai @google/genai
Minimal setup
import { GoogleGenAI } from '@google/genai'
import {
supercompat,
googleClientAdapter,
geminiRunAdapter,
memoryStorageAdapter,
} from 'supercompat/openai'
const google = new GoogleGenAI({ apiKey: process.env.GOOGLE_API_KEY })
const client = supercompat({
clientAdapter: googleClientAdapter({ google }),
storageAdapter: memoryStorageAdapter(),
runAdapter: geminiRunAdapter({ google }),
})
const response = await client.responses.create({
model: 'gemini-2.5-flash',
input: 'List three planets in our solar system.',
})
Tool use
Function tools are declared with the OpenAI shape and translated into Gemini's tool format by the run adapter:
await client.responses.create({
model: 'gemini-2.5-flash',
input: 'What's the weather in Tokyo?',
tools: [
{
type: 'function',
name: 'get_weather',
parameters: {
type: 'object',
properties: { city: { type: 'string' } },
required: ['city'],
},
},
],
})
Models
Some current examples: