Gemini API cho phép bạn truy cập vào các mô hình tạo sinh mới nhất của Google. Tài liệu tham khảo API này cung cấp thông tin chi tiết về các lớp và phương thức có trong SDK API Gemini. Chọn một ngôn ngữ và làm theo các bước thiết lập để bắt đầu xây dựng.
Cài đặt thư viện Gemini API
Tạo yêu cầu đầu tiên
Sử dụng phương thức generateContent để gửi yêu cầu đến Gemini API.
Bước tiếp theo
Nếu bạn mới bắt đầu, hãy tham khảo các hướng dẫn sau đây để hiểu rõ mô hình lập trình API Gemini:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-05-12 UTC."],[],[],null,["\u003cbr /\u003e\n\nThe Gemini API lets you access the latest generative models from Google. This\nAPI reference provides detailed information for the classes and methods\navailable in the Gemini API SDKs. Pick a language and follow the setup steps\nto get started building.\n\nPython JavaScript Go Apps Script\n\nInstall the Gemini API library\n\nMake your first request\n\nUse the\n[`generateContent`](/api/generate-content#method:-models.generatecontent) method\nto send a request to the Gemini API.\n\nWhat's next\n\nIf you're just getting started, check out the following guides, which will help\nyou understand the Gemini API programming model:\n\n- [Gemini API quickstart](/gemini-api/docs/quickstart)\n- [Gemini model guide](/gemini-api/docs/models/gemini)\n- [Prompt design](/gemini-api/docs/prompting-intro)\n\nYou might also want to check out the capabilities guides, which introduce different\nGemini API features and provide code examples:\n\n- [Text generation](/gemini-api/docs/text-generation)\n- [Context caching](/gemini-api/docs/caching)\n- [Embeddings](/gemini-api/docs/embeddings)\n- [Tuning](/gemini-api/docs/model-tuning)"]]