Hi, when I use /v1/responses endpoint to call gpt-image-1 tools, how can I calculate the exact cost for my request?
As my mind, there should be both TEXT cost and IMAGE cost, but the response json only shows the usage with input and output tokens, no mentioned img.
As follows.
Request Json
{
"model": "gpt-4.1-mini",
"input": "Generate an image of gray tabby cat hugging an otter with an orange scarf",
"tools": [
{
"type": "image_generation"
}
]
}
Response Json
{
"id": "resp_0180d3b13d71b7a60068c5895175fc819682fdc45be47e8c3a",
"object": "response",
"created_at": 1757776209,
"status": "completed",
"background": false,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4.1-mini-2025-04-14",
"output": [
{
"id": "ig_0180d3b13d71b7a60068c589526ff88196987aebdd12e1230d",
"type": "image_generation_call",
"status": "completed",
"background": "opaque",
"output_format": "png",
"quality": "high",
"result": "[base64-encoded image data]",
"revised_prompt": "A gray tabby cat hugging an otter. The otter is wearing a bright orange scarf. The scene is cute and heartwarming, with both animals showing a friendly and affectionate gesture. The background is simple and soft to highlight the animals.",
"size": "1024x1024"
},
{
"id": "msg_0180d3b13d71b7a60068c5897bdc9c81968b01b524128bfab0",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "Here is an image of a gray tabby cat hugging an otter wearing an orange scarf. If you need any changes or another image, feel free to ask!"
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"prompt_cache_key": null,
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [
{
"type": "image_generation",
"background": "auto",
"moderation": "auto",
"n": 1,
"output_compression": 100,
"output_format": "png",
"quality": "auto",
"size": "auto"
}
],
"top_logprobs": 0,
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 2285,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 96,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 2381
},
"user": null,
"metadata": {}
}
As we can see, the usage.input_tokens is 2285 and output_tokens is 96. There is an image made by gpt-image-1, but no info about that cost. So, how can I do?
I would appreciate any kind reply, best regards!
