Images
Get images usage details for the organization.
Query parameters
start_timeintegerRequired
Start time (Unix seconds) of the query time range, inclusive.end_timeinteger
End time (Unix seconds) of the query time range, exclusive.bucket_widthstringDefaults: 1d
Width of each time bucket in response. Currently
1m,1hand1dare supported, default to1d.sourcesarray
Return only usages for these sources. Possible values are
image.generation,image.edit,image.variationor any combination of them.sizesarray
Return only usages for these image sizes. Possible values are
256x256,512x512,1024x1024,1792x1792,1024x1792or any combination of them.project_idsarray
Return only usage for these projects.user_idsarray
Return only usage for these users.api_key_idsarray
Return only usage for these API keys.modelsarray
Return only usage for these models.group_byarray
Group the usage data by the specified fields. Support fields include
project_id,user_id,api_key_id,model,size,sourceor any combination of them.limitinteger
Specifies the number of buckets to return.
bucket_width=1d: default: 7, max: 31bucket_width=1h: default: 24, max: 168bucket_width=1m: default: 60, max: 1440
pagestring
A cursor for use in pagination. Corresponding to the
next_pagefield from the previous response.
Response
A list of paginated, time bucketed Images usage objects.
1 curl "https://api.openai.com/v1/organization/usage/images?start_time=1730419200&limit=1" \2 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \3 -H "Content-Type: application/json"
1 {2 "object": "page",3 "data": [4 {5 "object": "bucket",6 "start_time": 1730419200,7 "end_time": 1730505600,8 "results": [9 {10 "object": "organization.usage.images.result",11 "images": 2,12 "num_model_requests": 2,13 "size": null,14 "source": null,15 "project_id": null,16 "user_id": null,17 "api_key_id": null,18 "model": null19 }20 ]21 }22 ],23 "has_more": false,24 "next_page": null25 }