3 ms·
I know this isn't using tools (e.g. the Python interpreter) because you have to turn those on explicitly. That's not actually supported for o1 in the API but yo
by simonw 1y ago
I know this isn't using tools (e.g. the Python interpreter) because you have to turn those on explicitly. That's not actually supported for o1 in the API but you can do it for GPT-5 like this:
curl https://api.openai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-5",
"input": "Multiply 87654321 × 98765432",
"reasoning": {
"effort": "medium",
"summary": "detailed"
},
"tools": [
{
"type": "code_interpreter",
"container": {"type": "auto"}
}
]
}'
Here's the response: https://gist.github.com/simonw/c53c373fab2596c20942cfbb235af9ae https://gist.github.com/simonw/c53c373fab2596c20942cfbb235af...
Note this bit where the code interpreter Python tool is called:
{
"id": "rs_080a5801ca14ad990068fa91f2779081a0ad166ee263153d98",
"type": "reasoning",
"summary": [
{
"type": "summary_text",
"text": "**Calculating large product**\n\nI see that I need to compute the product of two large numbers, which involves big integer multiplication. It\u2019s a straightforward task, and given that I can use Python, that seems like the best route to avoid any potential errors. The user specifically asked for this multiplication, so I\u2019ll go ahead and use the python tool for accurate analysis. Let\u2019s get started on that!"
}
]
},
{
"id": "ci_080a5801ca14ad990068fa91f4dbe481a09eb646af049541c6",
"type": "code_interpreter_call",
"status": "completed",
"code": "a = 87654321\r\nb = 98765432\r\na*b",
"container_id": "cntr_68fa91f12f008191a359f1eeaed561290c438cc21b3fc083",
"outputs": null
}