中文 EN
简单 🌍 地区定价 可靠性: 高

Google Gemini API完整指南

Gemini是Google开发的AI模型,支持免费API调用。本文介绍Gemini API申请和充值方式

4.5 (9,800 条评价)
浏览 120,000 更新于 2024/5/18
GeminiGoogleAPIAI模型免费额度Vertex AI

一、Gemini API简介

Gemini是Google开发的AI模型系列,包括Gemini Pro、Gemini Ultra等,支持文本和代码生成。

API版本

模型说明定价

Gemini 1.5 Flash轻量级免费(有限制)

Gemini 1.5 Pro中量级$0.00125/千tokens

Gemini Pro标准版免费(有限制)

免费额度


  • Gemini Pro:60次/分钟

  • Gemini 1.5 Flash:15次/分钟

  • 1百万tokens/月(1.5 Pro)
  • 二、API申请

    获取API Key

  • 访问 aistudio.google.com/app/apikey

  • 登录Google账号

  • 点击"Create API Key"

  • 复制密钥
  • 使用API Key

    import google.generativeai as genai

    genai.configure(api_key='YOUR_API_KEY')
    model = genai.GenerativeModel('gemini-pro')
    response = model.generate_content('Hello')
    print(response.text)

    三、付费升级

    Google AI Studio付费

  • 进入 aistudio.google.com

  • 点击账户 → Usage

  • 选择升级到Pay-As-You-Go

  • 添加信用卡支付
  • Vertex AI(企业版)

    通过Google Cloud Vertex AI使用:

  • 创建Google Cloud项目

  • 启用Vertex AI API

  • 设置billing

  • 使用API
  • 四、国内使用

    访问限制


  • 需要VPN访问Google AI Studio

  • 部分区域可能不稳定
  • 替代方案


  • 使用国内镜像站

  • 使用API代理服务

  • 关注Google Cloud中国区动态
  • 相关工具

    觉得有用?分享给同学!