Gemini 4 Argon (gemini-4-argon) เป็นโมเดลล่าสุดและมากความสามารถที่สุดของเรา โมเดลนี้สามารถใช้เหตุผลกับปัญหาที่ยากได้นานขึ้นเพื่อให้ได้ผลลัพธ์ที่ดีขึ้นในงานเขียนโค้ด งานที่ใช้ Agent งานคณิตศาสตร์ และงานวิทยาศาสตร์ที่ซับซ้อน Gemini 4 Argon พร้อมให้บริการผ่าน Gemini API และใน Google AI Studio
Gemini 4 Argon รองรับหน้าต่างบริบทขนาด 1 ล้านโทเค็นแบบรวม, การถอดรหัสแบบยาวสูงสุด 1 ล้านโทเค็น และระดับการคิดที่ปรับแต่งได้ (low, medium, high)
ลองใช้ใน AI Studio
สร้างแอปตั้งแต่ต้นด้วย Gemini 4 Argon และ AI Studio
แกลเลอรีแอป
เล่นและรีมิกซ์แอปที่สร้างด้วย Gemini 4 Argon
เริ่มต้นใช้งาน
เริ่มต้นใช้งาน Gemini 4 Argon ด้วยพรอมต์เริ่มต้น
คู่มือนี้จะอธิบายสิ่งใหม่ๆ ใน Gemini 4 Argon, การเปลี่ยนแปลง API, ตัวอย่างโค้ด และคำแนะนำในการย้ายข้อมูล
รูปแบบใหม่
| รุ่น | รหัสโมเดล | ระดับการคิดเริ่มต้น | ราคา | คำอธิบาย |
|---|---|---|---|---|
| Gemini 4 Argon | gemini-4-argon |
medium |
พร้อมให้บริการจนถึงวันที่ 30 พฤศจิกายน 2026 ในราคาช่วงแนะนำที่ $2/โทเค็นอินพุต 1 ล้านรายการ และ $10/โทเค็นเอาต์พุต 1 ล้านรายการ (หลังจากนั้นจะเป็น $4/อินพุต 1 ล้านรายการ และ $20/เอาต์พุต 1 ล้านรายการ) ดูรายละเอียดเพิ่มเติมได้ที่ราคา | โมเดลที่มากความสามารถที่สุดของเรา ซึ่งสร้างขึ้นเพื่อแก้ปัญหาที่ยากที่สุดด้วยความลึกซึ้งและความแม่นยำในงานด้านวิศวกรรมซอฟต์แวร์และงานด้านความรู้ในโลกแห่งความเป็นจริง |
ดูรายละเอียดทั้งหมดได้ที่หน้าโมเดล Gemini 4 Argon ดูรายละเอียดราคาช่วงแนะนำได้ที่ส่วนราคาในหน้านี้หรือหน้าราคา
คู่มือเริ่มใช้งานฉบับย่อ
ใช้ตัวอย่างต่อไปนี้เพื่อส่งคำขอไปยัง gemini-4-argon ด้วย thinking_level (medium) เริ่มต้นที่แนะนำและขีดจำกัดโทเค็นเอาต์พุต 64K
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
- ขีดจำกัดโทเค็นอินพุต-เอาต์พุตแบบรวม 1 ล้านรายการ: อินพุต การคิด และเอาต์พุตจะใช้หน้าต่างร่วมกัน 1,048,576 โทเค็น
- การถอดรหัสแบบยาว: ตอนนี้คำตอบเดียวสามารถมีโทเค็นได้มากกว่า 64, 000 รายการ โดยสูงสุด 1 ล้านโทเค็นลบด้วยอินพุตของคุณ ดูการถอดรหัสแบบยาว
- ความเข้าใจวิดีโอแบบ Agentic พร้อมให้บริการเวอร์ชันสำหรับผู้ใช้ทั่วไป: ความเข้าใจวิดีโอแบบ Agentic พร้อมให้บริการเวอร์ชันสำหรับผู้ใช้ทั่วไปแล้ว
- รองรับใน Agent ที่ได้รับการจัดการ: Agent ของ Antigravity ใน Agent ที่ได้รับการจัดการของ Gemini รองรับ Gemini 4 Argon แล้ว
ดูข้อมูลจำเพาะทั้งหมดได้ที่หน้าโมเดล Gemini 4 Argon ดูรายละเอียดราคาได้ที่หน้าราคา
เอาต์พุตขนาดใหญ่ขึ้นและการถอดรหัสแบบยาว
Gemini 4 Argon สามารถใช้เวลาคิดนานขึ้นสำหรับโจทย์คณิตศาสตร์ วิทยาศาสตร์ และการเขียนโค้ดที่ยากๆ
- ใช้
thinking_levelเพื่อควบคุมความลึกของการให้เหตุผล: ระดับการคิดจะกำหนดความลึกของการให้เหตุผลของโมเดลก่อนที่จะตอบmax_output_tokensเป็นขีดจำกัดที่เข้มงวด โดยการตอบกลับจะหยุดลงเมื่อการคิดและเอาต์พุตรวมกันถึงขีดจำกัดดังกล่าว ดังนั้นให้ตั้งค่าให้สูงพอที่จะไม่ตัดคำตอบให้สั้นลง สร้างโทเค็นได้สูงสุด 1 ล้านรายการด้วยการดำเนินการในเบื้องหลัง: ใช้การดำเนินการในเบื้องหลังที่มี
max_output_tokensมากกว่า 65,536 เพื่อให้คำตอบเดียวมีโทเค็นเกิน 64, 000 รายการได้สูงสุด 1 ล้านรายการ โมเดลจะสร้างคำตอบแบบยาวเป็นช่วงๆ สูงสุด 64, 000 โทเค็น และแต่ละช่วงจะต่อจากจุดที่ช่วงก่อนหน้าหยุดลง เมื่อมีการดำเนินการในเบื้องหลัง เซิร์ฟเวอร์ของเราจะเรียกใช้การข้ามเพื่อดำเนินการต่อเหล่านี้ให้คุณ เนื่องจากการข้ามแต่ละครั้งจะเพิ่มขั้นตอน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 (ค่าเริ่มต้น) |
สมดุล | แนะนำสำหรับงานส่วนใหญ่ รวมถึงโค้ดที่ซับซ้อนและ Use Case ของ Agent |
high |
โทเค็นมากที่สุด โทเค็นแรกช้าที่สุด | การให้เหตุผลที่ซับซ้อน คณิตศาสตร์และวิทยาศาสตร์ที่ยาก และงานเขียนโค้ดหรือ Agent ที่ยากที่สุด เหมาะสำหรับการถอดรหัสแบบยาวเพื่อให้ได้เอาต์พุตที่ยาว |
ทำการประเมินทั้ง 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 ใน Agent ที่มีการจัดการ
Agent ของ Antigravity ใน Agent ที่ได้รับการจัดการของ Gemini รองรับ 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"
}
}'
ดูตัวเลือกเพิ่มเติมได้ที่การเลือกโมเดลในคู่มือ Agent ของ Antigravity
รายการตรวจสอบการย้ายข้อมูล
`/gemini-api-dev migrate my app to Gemini 4 Argon`
ย้ายข้อมูลไปยัง gemini-4-argon
- อัปเดตรหัสโมเดล: เปลี่ยนสตริงโมเดลเป้าหมายเป็น
gemini-4-argon - ตรวจสอบ
max_output_tokens: หากคุณตั้งค่าไว้อย่างชัดเจนในวันนี้ ให้พิจารณาเพิ่มค่าดังกล่าว เราขอแนะนำให้ใช้โทเค็นอย่างน้อย 32,768 รายการ เนื่องจาก Gemini 4 Argon สามารถใช้โทเค็นได้มากกว่าขีดจำกัดในการคิด - กำหนดค่าระดับการคิด: เลือก
low,medium(ค่าเริ่มต้น) หรือhighแล้วทดสอบภาระงานทั้ง 3 ระดับ - เลิกใช้การแคชบริบทที่ชัดเจน: Gemini 4 Argon ไม่รองรับการแคชที่ชัดเจน (
cachedContents/caches.create) นำการเรียกที่สร้างหรืออ้างอิงcached_contentออกจากคำขอ ระบบจะเปิดใช้การแคชโดยนัยโดยค่าเริ่มต้นสำหรับพรอมต์ที่มีโทเค็นอย่างน้อย 4,096 รายการ และลดราคาโทเค็นอินพุตที่แคชไว้ 95% เมื่อพบแคช - นำพารามิเตอร์การสุ่มตัวอย่างออก: นำ
temperature,top_pและtop_kออกจากคำขอ หากระบุไว้ ระบบจะไม่สนใจ - ใช้การดำเนินการในเบื้องหลังสำหรับเอาต์พุตที่ยาว: สำหรับงานที่ต้องใช้โทเค็นมากกว่า 64, 000 รายการ ให้ตั้งค่า
backgroundเป็น "จริง" และmax_output_tokensมากกว่า 65,536 - เพิ่มระยะหมดเวลาของไคลเอ็นต์: พรอมต์ที่ซับซ้อนอาจใช้เวลาหลายนาที ใช้การดำเนินการในเบื้องหลัง หรือตั้งค่าระยะหมดเวลาของไคลเอ็นต์ HTTP เป็นอย่างน้อย 15 นาที
- เก็บสถานะการสนทนาไว้ในเซิร์ฟเวอร์: ใช้
previous_interaction_idสำหรับการสนทนาแบบหลายเทิร์นและการเรียกใช้ฟังก์ชัน
ราคา
Gemini 4 Argon พร้อมให้บริการในราคาช่วงแนะนำจนถึงวันที่ 30 พฤศจิกายน 2026 ดังนี้
- โทเค็นอินพุต: $2.00 ต่อ 1 ล้านโทเค็น ($4.00 ตั้งแต่วันที่ 1 ธันวาคม 2026)
- โทเค็นอินพุตที่แคชไว้: การแคชโดยนัยจะลดราคาอินพุตที่แคชไว้ 95% เหลือ $0.10 ต่อ 1 ล้านโทเค็น ($0.20 ตั้งแต่วันที่ 1 ธันวาคม 2026 เป็นต้นไป)
- โทเค็นเอาต์พุต รวมถึงโทเค็นการคิด: $10.00 ต่อ 1 ล้านโทเค็น ($20.00 ตั้งแต่วันที่ 1 ธันวาคม 2026)
Gemini 4 Argon ไม่พร้อมให้บริการในรุ่นฟรี ดูระดับราคาทั้งหมดได้ที่หน้าราคา
รุ่นอื่นๆ
ขั้นตอนถัดไป
- อ่านคู่มือการถอดรหัสแบบยาวสำหรับการสตรีม การเชื่อมต่อใหม่ และการนับโทเค็น
- ดูวิธีการทำงานของระดับการคิดและสรุปความคิดได้ในคู่มือการคิด
- ดูข้อมูลเกี่ยวกับงานที่ใช้เวลานานในคู่มือการดำเนินการในเบื้องหลัง
- ทดสอบและปรับแต่งพรอมต์ใน Google AI Studio