Google Gemini
用于文本、视觉和代码生成的多模态生成式 AI
- 认证方式
- API Key
- HTTPS
- Yes
- CORS
- Unknown
- 分类
- 机器学习
简介
Google Gemini 是一系列多模态 AI 模型(文本、图像、音频、视频、代码),通过 generativelanguage.googleapis.com 的 Gemini API 提供。认证是免费 API 密钥——注意 无效密钥返回 HTTP 400(Google 惯例),不是 401(已实测)。
快速开始
模型列表(替换 YOUR_KEY):
curl "https://generativelanguage.googleapis.com/v1beta/models?key=YOUR_KEY"
生成文本:
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent" \
-H "Content-Type: application/json" \
-d '{
"contents": [{ "parts": [{ "text": "Explain quantum computing in one sentence" }] }]
}' \
"?key=YOUR_KEY"
认证方式
- 在 aistudio.google.com 获取密钥(免费,Google 账号)。
- 通过
key查询参数携带。 - 无效密钥返回 400 带错误体(已实测)——把带认证提示的 400 当认证问题处理。
速率限制与注意事项
- 免费层对 Gemini Flash 模型有宽裕的每日限额(见文档)。
- 模型 ID:
gemini-2.0-flash、gemini-2.0-pro、gemini-1.5-flash等——用/v1beta/models获取当前列表。 - 提供 OpenAI 兼容端点(
/v1beta/openai/)。 - 支持多模态输入、函数调用和结构化输出。
常见问题
Gemini API 免费吗? 免费层带每日限额;付费档可扩展。
如何获取密钥? aistudio.google.com → Get API key。
为什么是 400 而不是 401? Google 对无效 API 密钥返回 400(已实测)——请检查错误体。
机器学习 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| AI Economics Tools Token cost, LLM energy, agent-hour and Proof-Adjusted Autonomy calculators by Michał Piszczek | No auth | Yes | Yes | ↗ |
| AI For Thai Free Various Thai AI API | API Key | Yes | Yes | ↗ |
| BRAINIALL PT-BR and Spanish audio transcription with diarization and SRT/VTT | API Key | Yes | Yes | ↗ |
| Clarifai Computer Vision | OAuth | Yes | Unknown | ↗ |
| Cloudmersive Image captioning, face recognition, NSFW classification | API Key | Yes | Yes | ↗ |