Gemini 4 Argon の新機能

Gemini 4 Argon(gemini-4-argon)は、Google の最新かつ最も高性能なモデルです。難しい問題についてより長く推論できるため、複雑なコーディング、エージェント、数学、科学のタスクでより優れた結果を得ることができます。Gemini 4 Argon は、Gemini API と Google AI Studio で利用できます。

Gemini 4 Argon は、統合された 100 万トークンのコンテキスト ウィンドウ、最大 100 万トークンの長いデコード、調整可能な思考レベル(low、medium、high)をサポートしています。

このガイドでは、Gemini 4 Argon の新機能、API の変更、コードサンプル、移行ガイダンスについて説明します。

新しいモデル

モデル モデル ID デフォルトの思考レベル 料金 説明
Gemini 4 Argon gemini-4-argon medium 2026 年 11 月 30 日まで、お試し価格の入力トークン 100 万個あたり 2 ドル、出力トークン 100 万個あたり 10 ドルでご利用いただけます(それ以降は入力トークン 100 万個あたり 4 ドル、出力トークン 100 万個あたり 20 ドル)。詳しくは、料金をご覧ください。 Google の最上位モデル。実世界のソフトウェア エンジニアリングやナレッジワークのタスクにおいて、最も困難な問題を深く正確に解決できるように構築されています。

詳細については、Gemini 4 Argon モデルのページをご覧ください。お試し価格の詳細については、このページの後半にある料金セクションまたは料金ページをご覧ください。

クイックスタート

次の例では、推奨されるデフォルトの thinking_level(medium)と 64K の出力トークン上限を使用して、gemini-4-argon にリクエストを送信します。

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-argon",
    input="Write a three.js script that renders a realistic 3D black hole with gravitational lensing."
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
  model: "gemini-4-argon",
  input: "Write a three.js script that renders a realistic 3D black hole with gravitational lensing.",
});

console.log(interaction.output_text);

REST

curl "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "model": "gemini-4-argon",
    "input": "Write a three.js script that renders a realistic 3D black hole with gravitational lensing."
  }'

Gemini 4 Argon の新機能

  • 100 万の入出力トークンの統合上限: 入力、思考、出力は 1,048,576 トークンの 1 つのウィンドウを共有します。
  • 長いデコード: 1 つのレスポンスで 64, 000 トークンを超え、最大 100 万トークン(入力トークンを差し引いた数)まで処理できるようになりました。デコード時間が長いをご覧ください。
  • エージェント型動画理解の一般提供を開始: エージェント型動画理解の一般提供が開始されました。
  • マネージドエージェントでサポート: Gemini マネージドエージェントのAntigravity エージェントが Gemini 4 Argon をサポートするようになりました。

詳細な仕様については、Gemini 4 Argon モデルのページをご覧ください。料金の詳細については、料金ページをご覧ください。

出力の拡大と長いデコード

Gemini 4 Argon は、数学、科学、コーディングの難問について、より深く考えることができます。

  • thinking_level を使用して推論の深さを制御する: 思考レベルによって、モデルが回答する前に推論する深さが決まります。max_output_tokens はハードリミットです。思考と出力がこの上限に達するとレスポンスが停止するため、回答が短くならないように十分に高い値を設定してください。
  • バックグラウンド実行で最大 100 万トークンを生成する: max_output_tokens が 65,536 を超えるバックグラウンド実行を使用すると、1 つのレスポンスで 64, 000 トークンを超え、最大 100 万トークンまで生成できます。モデルは、最大 64, 000 トークンのホップで長いレスポンスを生成します。各ホップは、前のホップが停止した場所から続行されます。バックグラウンド実行では、Google のサーバーがこれらの継続ホップを実行します。各ホップで model_output ステップが interaction.steps に追加されるため、インタラクションが完了したら、すべての model_output ステップのテキストを結合します。

Python

import time
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-argon",
    input="Write a complete, rigorous proof of the prime number theorem.",
    background=True,
    generation_config={
        "max_output_tokens": 262144,
        "thinking_level": "high",
    },
)

while interaction.status in ("in_progress", "queued"):
    time.sleep(5)
    interaction = client.interactions.get(id=interaction.id)

# Each hop adds a model_output step, so join the text of all of them.
text = "".join(
    content.text
    for step in interaction.steps
    if step.type == "model_output"
    for content in step.content
    if content.type == "text"
)
print(text)
print("Status:", interaction.status)
print("Usage:", interaction.usage)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

let interaction = await client.interactions.create({
  model: "gemini-4-argon",
  input: "Write a complete, rigorous proof of the prime number theorem.",
  background: true,
  generation_config: {
    max_output_tokens: 262144,
    thinking_level: "high",
  },
});

while (interaction.status === "in_progress" || interaction.status === "queued") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  interaction = await client.interactions.get(interaction.id);
}

// Each hop adds a model_output step, so join the text of all of them.
const text = interaction.steps
  .filter((step) => step.type === "model_output")
  .flatMap((step) => step.content ?? [])
  .filter((content) => content.type === "text")
  .map((content) => content.text)
  .join("");
console.log(text);
console.log("Status:", interaction.status);
console.log("Usage:", interaction.usage);

REST

ID=$(curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-4-argon",
    "input": "Write a complete, rigorous proof of the prime number theorem.",
    "background": true,
    "generation_config": {
      "max_output_tokens": 262144,
      "thinking_level": "high"
    }
  }' | jq -r '.id')

while true; do
  RESP=$(curl -s "https://generativelanguage.googleapis.com/v1beta/interactions/$ID" \
    -H "x-goog-api-key: $GEMINI_API_KEY")
  STATUS=$(echo "$RESP" | jq -r '.status')
  if [[ "$STATUS" != "in_progress" && "$STATUS" != "queued" ]]; then
    echo "$RESP" | jq -r '[.steps[]? | select(.type == "model_output") | .content[]? | select(.type == "text") | .text] | join("")'
    break
  fi
  sleep 5
done

バックグラウンド実行は、長いデコードを実行する最も簡単な方法です。モデルが終了するか max_output_tokens に達するまで、サーバーサイドで継続ループを実行します。再試行、バックオフ、エラー処理をより細かく制御する必要がある場合(または、インタラクションを保存したくない場合)は、GenerateContent API でクライアントサイドの継続を使用できます。クライアントサイドの継続機能も、Interactions API に近日公開される予定です。ストリーミング、再接続、トークン カウント、長いデコードを使用するタイミングについては、長いデコードのガイドをご覧ください。

出力トークンの上限を設定する

max_output_tokens は、レスポンスの思考トークンと出力トークンの合計数を設定します。思考によって回答が短くならないように十分に高く設定し、難しいプロンプトですべてが使用された場合に費用を制限できるように十分に低く設定します。

まず、次の値を使用します。

  • 標準タスク: デフォルト値の 65,536 のままにするか、値を設定しないでください。
  • 上限が 32,000 未満の既存のアプリ: max_output_tokens を 32,768 以上に引き上げます。Gemini 4 Argon は、以前のモデルよりも思考に多くの制限をかけることができます。使用するトークンを減らすには、思考レベルを下げてください。
  • 複雑な推論とコーディング: background: true を設定し、max_output_tokens を 131,072 または 262,144 に設定します。最大 1,048,576 から入力トークンを引いた値まで設定できます。

思考レベルについて

思考レベルは、Gemini 4 Argon の品質、レイテンシ、トークンの使用量を制御する主な手段です。

思考レベル トークンの使用 使用する場面
low トークン数が最も少なく、レイテンシが最も低い よりシンプルなタスクと費用重視の作業。また、軽い思考を必要とする分析や執筆タスクにも適しています。難しいタスクでは品質が低下する可能性がある。
medium(デフォルト) バランス 複雑なコードやエージェントのユースケースなど、ほとんどのタスクに推奨されます。
high トークン数が最も多く、最初のトークンが最も遅い 複雑な推論、高度な数学や科学、最も難解なコードやエージェント タスク。長い出力の長いデコードに適しています。

3 つのレベルすべてで評価を実行し、品質基準を満たす最も低いレベルを選択します。詳細については、思考ガイドをご覧ください。

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-argon",
    input="Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
    generation_config={
        "thinking_level": "medium"  # Balanced reasoning effort for complex tasks
    }
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
  model: "gemini-4-argon",
  input: "Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
  generation_config: {
    thinking_level: "medium", // Balanced reasoning effort for complex tasks
  },
});

console.log(interaction.output_text);

REST

curl "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "model": "gemini-4-argon",
    "input": "Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
    "generation_config": {
      "thinking_level": "medium"
    }
  }'

Managed Agents の Gemini 4 Argon

Gemini Managed Agents の Antigravity エージェントは、Gemini 4 Argon をサポートしています。これを使用するには、agent_config でモデルを設定します。

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-09-2026",
    input=(
        "Audit https://web.dev for performance, Core Web Vitals, and SEO. "
        "Query Google's PageSpeed Insights API for both Mobile and Desktop strategies. "
        "Check search indexing with Google Search for site:web.dev. "
        "Format the output as a side-by-side scorecard table with prioritized fixes."
    ),
    environment="remote",
    agent_config={
        "type": "antigravity",
        "model": "gemini-4-argon",
    },
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
  agent: "antigravity-preview-09-2026",
  input:
    "Audit https://web.dev for performance, Core Web Vitals, and SEO. " +
    "Query Google's PageSpeed Insights API for both Mobile and Desktop strategies. " +
    "Check search indexing with Google Search for site:web.dev. " +
    "Format the output as a side-by-side scorecard table with prioritized fixes.",
  environment: "remote",
  agent_config: {
    type: "antigravity",
    model: "gemini-4-argon",
  },
}, { timeout: 300000 });

console.log(interaction.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -d '{
    "agent": "antigravity-preview-09-2026",
    "input": "Audit https://web.dev for performance, Core Web Vitals, and SEO. Query Google'\''s PageSpeed Insights API for both Mobile and Desktop strategies. Check search indexing with Google Search for site:web.dev. Format the output as a side-by-side scorecard table with prioritized fixes.",
    "environment": "remote",
    "agent_config": {
      "type": "antigravity",
      "model": "gemini-4-argon"
    }
  }'

その他のオプションについては、Antigravity エージェント ガイドのモデルの選択をご覧ください。

移行チェックリスト

  `/gemini-api-dev migrate my app to Gemini 4 Argon`

gemini-4-argon に移行する

  • モデル ID を更新する: ターゲット モデル文字列を gemini-4-argon に変更します。
  • max_output_tokens を確認する: 現在明示的に設定している場合は、引き上げることを検討してください。Gemini 4 Argon は思考に上限の多くを費やすことができるため、32,768 以上にすることをおすすめします。
  • 思考レベルを構成する: low、medium(デフォルト)、high のいずれかを選択し、3 つすべてでワークロードをテストします。
  • 明示的なコンテキスト キャッシュ保存から移行する: 明示的なキャッシュ保存(cachedContents / caches.create)は、Gemini 4 Argon ではサポートされていません。cached_content を作成または参照する呼び出しをリクエストから削除します。暗黙的なキャッシュ保存は、4,096 トークン以上のプロンプトでデフォルトで有効になっており、キャッシュ ヒット時にキャッシュに保存された入力トークンが 95% 割引されます。
  • サンプリング パラメータを削除する: リクエストから temperature、top_p、top_k を削除します。指定しても無視されます。
  • 長い出力にはバックグラウンド実行を使用する: 64K を超えるトークンが必要なタスクの場合は、background を true に設定し、max_output_tokens を 65,536 より大きく設定します。
  • クライアントのタイムアウトを増やす: ハードプロンプトには数分かかることがあります。バックグラウンド実行を使用するか、HTTP クライアントのタイムアウトを 15 分以上に設定します。
  • 会話の状態をサーバーに保持する: マルチターン会話と関数呼び出し会話には previous_interaction_id を使用します。

料金

Gemini 4 Argon は、2026 年 11 月 30 日までお試し価格でご利用いただけます。

  • 入力トークン: 100 万トークンあたり $2.00(2026 年 12 月 1 日以降は $4.00)
    • キャッシュに保存された入力トークン: 暗黙的なキャッシュ保存により、キャッシュに保存された入力は 95% 割引され、100 万トークンあたり $0.10(2026 年 12 月 1 日以降は $0.20)になります。
  • 出力トークン(思考トークンを含む): 100 万トークンあたり $10.00(2026 年 12 月 1 日以降は $20.00)

Gemini 4 Argon は無料枠ではご利用いただけません。料金階層の詳細については、料金ページをご覧ください。

その他のモデル

次のステップ