← 返回 Skills 市场
🔌

gemini

作者 RunAPI · GitHub ↗ · v0.2.4 · MIT-0
cross-platform ⚠ pending
42
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install runapi-gemini
功能描述
Call the Gemini API (gemini-2.5-flash, gemini-2.5-pro, gemini-3-flash-preview, gemini-3-pro-preview, gemini-3.1-pro-preview) through RunAPI using the officia...
使用说明 (SKILL.md)

Gemini on RunAPI

Gemini on RunAPI exposes two protocols:

Protocol Endpoint Use when
OpenAI-compatible POST /v1beta/openai/chat/completions You already use the OpenAI SDK or any OpenAI client
Native Gemini POST /v1beta/models/\x3Cmodel>:streamGenerateContent You use Google's @google/generative-ai SDK (currently gemini-3-flash-preview only)

Both accept the same RunAPI API Key.

Setup

RUNAPI_TOKEN=YOUR_RUNAPI_TOKEN

Get a RunAPI API Key at \x3Chttps://runapi.ai/api_keys>.

OpenAI-compatible setup

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_RUNAPI_TOKEN",
    base_url="https://runapi.ai/v1beta/openai",
)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "YOUR_RUNAPI_TOKEN",
  baseURL: "https://runapi.ai/v1beta/openai",
});

Native Gemini setup

export GOOGLE_API_KEY=YOUR_RUNAPI_TOKEN
export GOOGLE_GENAI_BASE_URL=https://runapi.ai

Core recipe — OpenAI-compatible

response = client.chat.completions.create(
    model="gemini-2.5-flash",
    messages=[{"role": "user", "content": "Explain quantum computing simply."}],
    reasoning_effort="high",
)
print(response.choices[0].message.content)
print(response.usage)
const response = await client.chat.completions.create({
  model: "gemini-2.5-flash",
  messages: [{ role: "user", content: "Explain quantum computing simply." }],
});
curl -X POST "https://runapi.ai/v1beta/openai/chat/completions" \
  -H "x-api-key: YOUR_RUNAPI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash",
    "messages": [{"role": "user", "content": "Explain quantum computing simply."}]
  }'

Core recipe — native Gemini

curl -X POST \
  "https://runapi.ai/v1beta/models/gemini-3-flash-preview:streamGenerateContent" \
  -H "x-goog-api-key: YOUR_RUNAPI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      { "role": "user", "parts": [{ "text": "Hello!" }] }
    ]
  }'

The native protocol returns SSE chunks in Google's streamGenerateContent format — use the official @google/generative-ai SDK or Google's google-genai Python package to consume it.

Streaming (OpenAI-compatible)

stream = client.chat.completions.create(
    model="gemini-2.5-flash",
    messages=[{"role": "user", "content": "Write a haiku about coding."}],
    stream=True,
)
for chunk in stream:
    delta = chunk.choices[0].delta.content
    if delta:
        print(delta, end="", flush=True)

Streaming runs through a regional edge proxy so the request does not hold a Rails/Puma thread. Long generations should always stream.

Vision / multimodal

{
  "model": "gemini-2.5-flash",
  "messages": [
    {
      "role": "user",
      "content": [
        { "type": "text", "text": "What is in this image?" },
        { "type": "image_url", "image_url": { "url": "https://example.com/img.jpg" } }
      ]
    }
  ]
}

Standard OpenAI multimodal block for the OpenAI-compatible endpoint. For the native endpoint, embed image data as parts[].inlineData or parts[].fileData.

Google Search grounding

{
  "model": "gemini-2.5-pro",
  "messages": [
    { "role": "user", "content": "Latest news on Gemini 3." }
  ],
  "tools": [
    { "type": "function", "function": { "name": "googleSearch" } }
  ]
}

Available on gemini-2.5-flash, gemini-2.5-pro, gemini-3.1-pro-preview, and gemini-3-pro-preview.

Structured output

{
  "model": "gemini-2.5-flash",
  "messages": [{ "role": "user", "content": "Give me one person object." }],
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "person",
      "schema": {
        "type": "object",
        "properties": { "name": { "type": "string" }, "age": { "type": "integer" } },
        "required": ["name", "age"]
      }
    }
  }
}

Reasoning effort

Supported on gemini-2.5-pro, gemini-3.1-pro-preview, gemini-3-pro-preview, and gemini-3-flash-preview — pass reasoning_effort: "low" | "medium" | "high".

List models

curl https://runapi.ai/v1beta/models -H "x-api-key: YOUR_RUNAPI_TOKEN"

Or via the OpenAI-style path:

curl https://runapi.ai/v1beta/openai/models \
  -H "Authorization: Bearer YOUR_RUNAPI_TOKEN"

Supported models

Model ID OpenAI endpoint Native endpoint Capabilities
gemini-2.5-flash yes Chat, multimodal, Google Search, structured output, thoughts
gemini-2.5-pro yes + reasoning effort
gemini-3.1-pro-preview yes + reasoning effort
gemini-3-pro-preview yes + reasoning effort
gemini-3-flash-preview yes :streamGenerateContent Chat, multimodal, function calling, structured output, reasoning effort

gemini-flash-latest resolves to gemini-3-flash-preview.

Connect Gemini CLI itself

export GOOGLE_API_KEY=YOUR_RUNAPI_TOKEN
export GOOGLE_GENAI_BASE_URL=https://runapi.ai
gemini

Agent rules

  • The native :streamGenerateContent path is currently only wired for gemini-3-flash-preview — use the OpenAI-compatible endpoint for every other Gemini model.
  • Use streaming for any response longer than a few hundred tokens. Do not hold the agent on a long blocking request.
  • Google Search grounding uses a googleSearch function tool.
  • Pricing, rate limits, quotas — link to \x3Chttps://runapi.ai/models/gemini.md>, not this skill file.

Routing

  • Model page: \x3Chttps://runapi.ai/models/gemini.md>
  • Provider page: \x3Chttps://runapi.ai/providers/google.md>
  • Catalog: \x3Chttps://runapi.ai/models.md>
能力标签
requires-sensitive-credentials
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install runapi-gemini
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /runapi-gemini 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.2.4
Agent-facing CLI-first redesign
元数据
Slug runapi-gemini
版本 0.2.4
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

gemini 是什么?

Call the Gemini API (gemini-2.5-flash, gemini-2.5-pro, gemini-3-flash-preview, gemini-3-pro-preview, gemini-3.1-pro-preview) through RunAPI using the officia... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 42 次。

如何安装 gemini?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install runapi-gemini」即可一键安装,无需额外配置。

gemini 是免费的吗?

是的,gemini 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

gemini 支持哪些平台?

gemini 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 gemini?

由 RunAPI(@runapi-ai)开发并维护,当前版本 v0.2.4。

💬 留言讨论