มีอะไรใหม่ใน Gemini 4 Argon

Gemini 4 Argon (gemini-4-argon) เป็นโมเดลล่าสุดที่มากความสามารถที่สุดของเรา โดยสามารถใช้เหตุผลกับปัญหาที่ยากได้นานขึ้นเพื่อให้ได้ผลลัพธ์ที่ดีขึ้นสำหรับงานที่ซับซ้อนด้านการเขียนโค้ด งานที่ต้องใช้ Agent งานคณิตศาสตร์ และงานวิทยาศาสตร์ Gemini 4 Argon พร้อมใช้งานผ่าน Gemini API และใน Google AI Studio

Gemini 4 Argon รองรับหน้าต่างบริบทขนาด 1 ล้านโทเค็นแบบรวม การถอดรหัสแบบยาวสูงสุด 1 ล้านโทเค็น และระดับการคิดที่ปรับได้ (low, medium, high)

คู่มือนี้จะอธิบายสิ่งใหม่ๆ ใน 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) เริ่มต้นที่แนะนำและขีดจำกัดโทเค็นเอาต์พุต 64,000 โทเค็น

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 พร้อมให้ใช้งานในเวอร์ชันสำหรับผู้ใช้ทั่วไปแล้ว
  • รองรับใน Managed Agents: Agent ของ Antigravity ใน Gemini Managed Agents รองรับ 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 (ค่าเริ่มต้น) สมดุล แนะนำสำหรับงานส่วนใหญ่ รวมถึงโค้ดที่ซับซ้อนและกรณีการใช้งานแบบ Agentic
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 ใน Managed Agents

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 Pro ดูระดับราคาทั้งหมดได้ในหน้าราคา

โมเดลอื่นๆ

ขั้นตอนถัดไป