AI - LLM - Gemini

Quick Chat

😊 免費方案對於輕度開發綽綽有餘

API

  • 透過 Google AI Studio 申請

Hello World

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

const ai = new GoogleGenAI({ apiKey: "YOUR_API_KEY" });

async function main() {
  const response = await ai.models.generateContent({
    model: "gemini-2.0-flash",
    contents: "Explain how AI works in a few words",
  });
  console.log(response.text);
}

await main();