การทำงานกับ OpenAI Responses API
James Chapman
AI Curriculum Manager, DataCamp
response = client.responses.create(
model="gpt-5.4-mini",
input="What is recursion?",
)
response = client.responses.create(
model="gpt-5.4-mini",
input="What is recursion?",
)
| โมเดล | ความเร็ว | ต้นทุน | เหมาะสำหรับ |
|---|---|---|---|
| gpt-5.4-mini | เร็ว | ต่ำ | งานง่าย, Q&A |
| gpt-5.5 | ปานกลาง | สูงกว่า | การใช้เหตุผลซับซ้อน |
$$



response = client.responses.create( model="gpt-5.4-mini", input="Explain LLMs to a 6yr old.",reasoning={"effort": "none"})
response = client.responses.create(
model="gpt-5.4-mini",
input="Explain LLMs to a 6yr old.",
reasoning={"effort": "none"}
)
| ระดับ | เหมาะสำหรับ |
|---|---|
| none | งานง่ายหรืองานเชิงกล |
| low | งานง่ายที่เน้นความเร็วและต้นทุนต่ำ |
| medium | ค่าเริ่มต้นสำหรับความสมดุลระหว่างการใช้เหตุผลและประสิทธิภาพ |
| high | งานซับซ้อน หลายขั้นตอน หรือใช้ตรรกะมาก |
| xhigh | งานที่ยากที่สุดซึ่งท้าทายขีดความสามารถสูงสุด |
response = client.responses.create( model="gpt-5.4-mini", input="Explain LLMs to a 6yr old.", reasoning={ "effort": "medium","summary": "auto"} )
response = client.responses.create( model="gpt-5.4-mini", input="Explain LLMs to a 6yr old.", reasoning={"effort": "none"},max_output_tokens=500)
max_output_tokens รวม reasoning tokens ด้วย
การทำงานกับ OpenAI Responses API