Working with the OpenAI Responses API
James Chapman
AI Curriculum Manager, DataCamp
response = client.responses.create(
model="gpt-5-mini",
input="What is recursion?",
)
response = client.responses.create(
model="gpt-5-mini",
input="What is recursion?",
)
| Model | Speed | Cost | Best For |
|---|---|---|---|
| gpt-5-nano | Rapid | Ultra-Low | Low-latency apps |
| gpt-5-mini | Fast | Low | Simple tasks, Q&A |
| gpt-5 | Moderate | Higher | Complex reasoning |
$$



response = client.responses.create( model="gpt-5-mini", input="Explain LLMs to a 6yr old.",reasoning={"effort": "minimal"})
response = client.responses.create(
model="gpt-5-mini",
input="Explain LLMs to a 6yr old.",
reasoning={"effort": "minimal"}
)
| Effort | Best For |
|---|---|
| minimal | Trivial or mechanical tasks. |
| low | Simple tasks prioritizing speed and cost. |
| medium | Default for balanced reasoning and efficiency. |
| high | Complex, multi-step, or logic-heavy tasks. |
response = client.responses.create( model="gpt-5-mini", input="Explain LLMs to a 6yr old.", reasoning={ "effort": "medium","summary": "auto"} )
response = client.responses.create( model="gpt-5-mini", input="Explain LLMs to a 6yr old.", reasoning={"effort": "minimal"},max_output_tokens=500)
max_output_tokens includes the reasoning tokens
Working with the OpenAI Responses API