HERMES + GEMINI

Hermes Agent で Gemini を使う。

Google Gemini は RunAPI の OpenAI 互換エンドポイント経由で利用できます。Hermes Agent は custom:runapi provider を使ってこれを呼び出します — Gemini 3.5 Flash は速度が重要な agent ループに、3.x Pro は多段階推論に、2.5 Pro は長コンテキストの本番タスクに対応します。Google Cloud プロジェクトや Vertex AI の認証情報は不要です — チャット用にすでに設定した同じ RUNAPI_API_KEY と base_url だけで済みます。

1つの APIキー · OpenAI 互換チャットエンドポイント · ストリーミング対応
RunAPI を使って Hermes Agent 経由で Google Gemini 3.5 Flash にチャットリクエストを送信します。

要件:
- Hermes Agent にすでに設定された custom:runapi provider を使用する
- RunAPI の chat completions エンドポイント https://runapi.ai/v1/chat/completions を呼び出す
- model を "gemini-3.5-flash" に設定する
- RUNAPI_API_KEY 環境変数が認証を提供します
- レスポンスは同期的です — 返答は choices[0].message.content に届きます
- ストリーミングする場合は stream を true に設定し、server-sent events を処理する
curl -X POST https://runapi.ai/v1/chat/completions \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.5-flash",
    "messages": [
      {"role": "system", "content": "You are a concise technical assistant."},
      {"role": "user", "content": "Explain the difference between gRPC and REST in three sentences."}
    ],
    "temperature": 0.7,
    "max_tokens": 256
  }'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "gemini-3.5-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "gRPC uses HTTP/2 and Protocol Buffers for strongly-typed, multiplexed RPC calls with built-in code generation. REST uses HTTP/1.1 (or 2) with JSON payloads and relies on URL paths and HTTP verbs for resource semantics. gRPC is faster for service-to-service calls; REST is simpler to debug and more widely supported by browsers."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 34,
    "completion_tokens": 71,
    "total_tokens": 105
  }
}
curlコマンドをコピーしてテスト gemini
仕組み

Hermes Agent で Gemini を使う3ステップ

1

Configure RunAPI

Set the RUNAPI_API_KEY environment variable. If you already added RunAPI as a custom:runapi provider in Hermes Agent, the same key and base_url work for Gemini — change only the model ID. No Google Cloud credentials needed.

export RUNAPI_API_KEY=runapi_xxx
2

Call Gemini via chat completions

Send a POST request to /v1/chat/completions with model set to gemini-3.5-flash. Pass a messages array with system and user roles. Hermes Agent sends the same OpenAI-compatible request shape it uses for GPT — RunAPI routes to Gemini based on the model parameter.

POST /v1/chat/completions
3

Read the response

The response arrives synchronously in OpenAI chat completion format. The assistant reply is in choices[0].message.content, with token usage in the usage object. For streaming, set stream to true and Hermes Agent parses the SSE delta events automatically.

choices[0].message.content
パラメータ

Gemini chat completions API パラメータ

パラメータ 説明
model string Required. gemini-3.5-flash, gemini-2.5-flash, gemini-2.5-pro, gemini-3-flash-preview, gemini-3-pro-preview, or gemini-3.1-pro-preview.
messages array Required. Array of message objects with role (system, user, assistant) and content fields.
temperature number Optional. Sampling temperature between 0 and 2. Lower values produce more deterministic output. Default varies by model.
max_tokens integer Optional. Maximum number of tokens to generate in the response.
stream boolean Optional. When true, the response streams as server-sent events. Each event contains a delta with partial content.
top_p number Optional. Nucleus sampling threshold between 0 and 1. Alternative to temperature for controlling output randomness.

Hermes AgentのGeminiとは?

Google GeminiはRunAPIのcustom:runapi providerを通じてGoogle Cloudの認証情報なしに利用できます。Hermes AgentはGPTやClaudeと同じOpenAI互換設定を使って呼び出します。Gemini 3.5 Flashは速度敏感なagentループの最速の選択肢で、Gemini 2.5 Proは100万トークンのコンテキストウィンドウと思考モードを提供します。

Geminiの活用例

Live APIによるリアルタイム音声・動画チャット

Geminiのマルチモーダル機能を使って音声と動画入力(テキストと並行して)をリアルタイムで処理するアプリを構築し、Hermes Agentワークフローで見たり聞いたりできるインタラクティブなagentを作成します。

Google検索データによるレスポンスのグラウンディング

Hermes Agentワークフローで最新情報が必要なタスクに対して事実に正確な回答を提供し幻覚を減らすために、Geminiの検索グラウンディング機能を有効にします。

マルチモーダルドキュメント処理パイプライン

1回のHermes Agent実行で混合コンテンツタイプ(PDF・画像・表)を含むドキュメントを処理し、スキャンした表からのデータ抽出・マルチメディアレポートの要約・動画コンテンツの分類を行います。

FAQ

Gemini + Hermes Agent のよくある質問

Hermes Agent の基本設定

まだ設定していませんか?Hermes Agent の RunAPI セットアップガイドから始めましょう。

Hermes Agent セットアップガイド →

Gemini モデルカタログ

すべての Gemini バリアント、価格帯、API ドキュメントを確認する。

Gemini モデル →

今すぐ Hermes Agent で Gemini を試す。

無料の RunAPI キーを取得し、custom:runapi provider でモデルを gemini-3.5-flash に設定すれば、Hermes Agent で Gemini を使い始められます。