Gemini最新モデル: temperature, top_p, top_k パラメータは非推奨となり無視されます
Gemini last models: temperature, top_p, and top_k are deprecated and ignored (ai.google.dev)
要約
Googleは、最新のGeminiモデルであるGemini 3.6 FlashとGemini 3.5 Flash-Liteの一般提供を開始しました。これらのモデルは、パフォーマンスの向上、コスト削減、および特定のタスクにおける効率化を実現しています。また、APIの変更点として、サンプリングパラメータであるtemperature, top_p, top_kが非推奨となり、今後は無視されるため、コードからの削除が必要です。
全文翻訳
Gemini 4 Argon: 最新モデル
Gemini 4 Argon (gemini-4-argon) は、当社の最新かつ最も高性能なモデルです。複雑なコーディング、エージェント、数学、科学タスクにおいて、より良い結果を得るために、困難な問題に対してより長く推論できます。Gemini 4 Argon は Gemini API および Google AI Studio で利用可能です。
Gemini 4 Argon は、統一された1Mトークンのコンテキストウィンドウ、最大1Mトークンのロングデコード、および調整可能な思考レベル(low、medium、high)をサポートしています。
このガイドでは、Gemini 4 Argon の新機能、API の変更点、コード例、および移行ガイダンスについて説明します。
新モデル
| モデル | モデルID | デフォルトの思考レベル | 価格 | 説明 |
|---|---|---|---|---|
| Gemini 4 Argon | gemini-4-argon | medium | 2026年11月30日まで、1M入力トークンあたり2ドル、1M出力トークンあたり10ドル(その後は1M入力トークンあたり4ドル、1M出力トークンあたり20ドル)の紹介価格で提供。詳細は価格を参照。 | ソフトウェアエンジニアリングおよびナレッジワークの現実世界のタスクにおいて、深さと精度をもって最も困難な問題を解決するために構築された、当社の最も高性能なモデル。 |
完全な仕様については、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 の新機能
- 統一された1M入力・出力トークン制限: 入力、思考、出力は、1,048,576トークンの単一ウィンドウを共有します。
- ロングデコード: 単一の応答が64Kトークンを超え、最大1Mトークン(入力トークンを除く)まで可能になりました。ロングデコードを参照してください。
- エージェントによる動画理解が一般提供開始: エージェントによる動画理解が一般提供開始されました。
- マネージドエージェントでのサポート: GeminiマネージドエージェントのAntigravityエージェントがGemini 4 Argonをサポートするようになりました。
完全な仕様については、Gemini 4 Argon モデルページを参照してください。価格の詳細については、価格ページを参照してください。
より大きな出力とロングデコード
Gemini 4 Argon は、困難な数学、科学、コーディングの問題に対してより長く思考できます。
thinking_levelを使用して推論の深さを制御: 思考レベルは、モデルが回答する前にどれだけ深く推論するかを決定します。max_output_tokensはハードリミットです。思考と出力の合計がこの値に達すると応答が停止するため、回答が途中で打ち切られないように十分高く設定してください。- バックグラウンド実行で最大1Mトークンを生成:
max_output_tokensを65,536より大きく設定してバックグラウンド実行を使用すると、単一の応答を64Kトークンを超えて最大1Mトークンまで拡張できます。モデルは最大64Kトークンのホップで長い応答を生成し、各ホップは前のホップが停止した場所から継続します。バックグラウンド実行では、サーバーがこれらの継続ホップを実行します。各ホップはinteraction.stepsにmodel_outputステップを追加するため、インタラクションが完了したらすべての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)
# 各ホップは model_output ステップを追加するため、すべてのテキストを結合します。
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);
}
// 各ホップは model_output ステップを追加するため、すべてのテキストを結合します。
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を維持するか、値を設定しないでください。
- 32K未満の制限がある既存のアプリ:
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" # 複雑なタスクのためのバランスの取れた推論努力
}
)
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", // 複雑なタスクのためのバランスの取れた推論努力
},
});
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"
}
}'
マネージドエージェントでの Gemini 4 Argon
Geminiマネージドエージェントの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日まで紹介価格で利用可能です。
- 入力トークン: 1Mトークンあたり2.00ドル(2026年12月1日以降は4.00ドル)
- キャッシュされた入力トークン: 暗黙的なキャッシュは、キャッシュされた入力を95%割引し、1Mトークンあたり0.10ドル(2026年12月1日以降は0.20ドル)になります。
- 出力トークン(思考トークンを含む): 1Mトークンあたり10.00ドル(2026年12月1日以降は20.00ドル)
Gemini 4 Argon は無料ティアでは利用できません。完全な価格ティアについては、価格ページを参照してください。
その他のモデル
次のステップ
- ストリーミング、再接続、トークンカウントについては、ロングデコードガイドをお読みください。
- 思考レベルと思考の要約がどのように機能するかについては、思考ガイドをご覧ください。
- 長時間実行されるジョブについては、バックグラウンド実行ガイドをご覧ください。
- Google AI Studioでプロンプトをテストおよび改良してください。
別途記載がない限り、このページのコンテンツはクリエイティブ・コモンズ 表示 4.0 ライセンスの下でライセンスされ、コードサンプルはApache 2.0 ライセンスの下でライセンスされています。詳細については、Google Developers サイトポリシーを参照してください。Java は Oracle および/またはその関連会社の登録商標です。
最終更新日: 2026-10-16 UTC。