Costs
$ openai admin:organization:usage costs
GET/organization/costs
Get costs details for the organization.
Parameters
--bucket-width: optional "1d"
Width of each time bucket in response. Currently only 1d is supported, default to 1d.
--group-by: optional array of "project_id" or "line_item" or "api_key_id"
Group the costs by the specified fields. Support fields include project_id, line_item, api_key_id and any combination of them.
--limit: optional number
A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7.
Costs
openai admin:organization:usage costs \
--admin-api-key 'My Admin API Key' \
--start-time 0{
"object": "page",
"data": [
{
"object": "bucket",
"start_time": 1730419200,
"end_time": 1730505600,
"results": [
{
"object": "organization.costs.result",
"amount": {
"value": 0.06,
"currency": "usd"
},
"line_item": null,
"project_id": null,
"api_key_id": null,
"quantity": null
}
]
}
],
"has_more": false,
"next_page": null
}
Returns Examples
{
"object": "page",
"data": [
{
"object": "bucket",
"start_time": 1730419200,
"end_time": 1730505600,
"results": [
{
"object": "organization.costs.result",
"amount": {
"value": 0.06,
"currency": "usd"
},
"line_item": null,
"project_id": null,
"api_key_id": null,
"quantity": null
}
]
}
],
"has_more": false,
"next_page": null
}