Gemini 4 Argon(gemini-4-argon)は、Google の最新かつ最も高性能なモデルです。複雑なコーディング、エージェント型、数学、科学のタスクでより良い結果を得るために、難しい問題についてより長く推論できます。Gemini 4 Argon は、Gemini API と Google AI Studio で利用できます。
Gemini 4 Argon は、100 万トークンの統合コンテキスト ウィンドウ、最大 100 万トークンの長いデコード、調整可能な思考レベル(low、medium、high)をサポートしています。
AI Studio を使ってみる
Gemini 4 Argon と AI Studio を使用して、アプリをゼロから構築します。
アプリギャラリー
Gemini 4 Argon で構築されたアプリを再生してリミックスします。
始める
スターター プロンプトを使用して Gemini 4 Argon を使ってみる。
このガイドでは、Gemini 4 Argon の新機能、API の変更、コードサンプル、移行ガイダンスについて説明します。
新しいモデル
| モデル | モデル ID | デフォルトの思考レベル | 料金 | 説明 |
|---|---|---|---|---|
| Gemini 4 Argon | gemini-4-argon |
medium |
2026 年 11 月 30 日まで、入力トークン 100 万個あたり $2、出力トークン 100 万個あたり $10 のお試し価格でご利用いただけます(2026 年 12 月 1 日以降は、入力 100 万個あたり $4、出力 100 万個あたり $20)。詳しくは、料金をご覧ください。 | 現実世界のソフトウェア エンジニアリングと知識作業のタスク全体で、難易度の高い問題を深く正確に解決するために構築された、Google の最も高性能なモデルです。 |
詳細については、Gemini 4 Argon モデルのページをご覧ください。お試し価格の詳細については、このページの料金セクションまたは料金ページをご覧ください。
クイックスタート
次の例では、推奨されるデフォルトの thinking_level(medium)と 64,000 トークンの出力トークン上限を使用して、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"
}
}'
マネージド エージェントの 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 つすべてでワークロードをテストします。 - 明示的なコンテキスト キャッシュ保存を停止する: Gemini 4 Argon では、明示的なキャッシュ保存(
cachedContents/caches.create)はサポートされていません。cached_contentを作成または参照する呼び出しをリクエストから削除します。暗黙的なキャッシュ保存は、4,096 トークン以上のプロンプトではデフォルトで有効になり、キャッシュ ヒット時にキャッシュに保存された入力トークンが 95% 割引されます。 - サンプリング パラメータを削除する: リクエストから
temperature、top_p、top_kを削除します。指定しても無視されます。 - 長い出力にはバックグラウンド実行を使用する: 64, 000 トークンを超えるタスクの場合は、
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 は、無料枠または Google AI Pro プランではご利用いただけません。料金プランの詳細については、料金ページをご覧ください。
その他のモデル
次のステップ
- ストリーミング、再接続、トークン数については、長いデコードのガイドをご覧ください。
- 思考レベルと思考の要約の仕組みについては、思考ガイドをご覧ください。
- 長時間実行ジョブについては、バックグラウンド実行ガイドをご覧ください。
- Google AI Studio でプロンプトをテストして改善します。