วิธีใช้ Gemini 4 Carbon
-
เขียนพรอมต์: ใส่งานที่ต้องการใน prompt และเพิ่ม system_prompt เพื่อกำหนดบทบาท น้ำเสียง หรือรูปแบบเอาต์พุตได้ตามต้องการ
-
เลือกระดับ reasoning effort: ตั้งค่า reasoning_effort เป็น low, medium (ค่าเริ่มต้น) หรือ high ระดับที่สูงขึ้นจะใช้เวลาให้เหตุผลนานขึ้นและคิดค่าบริการโทเค็นเอาต์พุตมากขึ้น
-
เพิ่มรูปภาพ (ไม่บังคับ): ระบุ image_url เพื่อแนบรูปภาพไปกับคำขอ
-
ส่งคำขอและรับผลลัพธ์: POST จะคืนค่า request_id ให้โพลล์ /api/v1/predictions/{request_id}/result หรือส่ง URL ของ webhook
ตัวอย่าง cURL
curl -X POST "https://api.muapi.ai/api/v1/gemini-4-carbon" \
-H "x-api-key: $MUAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Audit this function for injection vulnerabilities and propose a patch.",
"system_prompt": "You are a senior application security engineer. Be concise and specific.",
"reasoning_effort": "high"
}'