Decisions
admin.organization.usage.decisions(UsageDecisionsParams**kwargs ) -> UsageDecisionsResponse
GET
/organization/usage/decisionsGet Decisions API usage details for the organization.
Parameters
batch: Optional[bool]
If true, return batch jobs only. If false, return non-batch jobs only. By default, return both.
limit: Optional[int]
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
Decisions
import os
from openai import OpenAI
client = OpenAI(
admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted
)
response = client.admin.organization.usage.decisions(
start_time=0,
)
print(response.data)Response example
{
"object": "page",
"data": [
{
"object": "bucket",
"start_time": 1790812800,
"end_time": 1790899200,
"results": [
{
"object": "organization.usage.decisions.result",
"input_tokens": 1000,
"input_cached_tokens": 400,
"output_tokens": 0,
"num_model_requests": 5,
"project_id": "proj_example",
"model": "gpt-6-luna",
"user_id": null,
"api_key_id": null,
"batch": null,
"service_tier": null
}
]
}
],
"has_more": false,
"next_page": null
}
Returns Examples
Response example
{
"object": "page",
"data": [
{
"object": "bucket",
"start_time": 1790812800,
"end_time": 1790899200,
"results": [
{
"object": "organization.usage.decisions.result",
"input_tokens": 1000,
"input_cached_tokens": 400,
"output_tokens": 0,
"num_model_requests": 5,
"project_id": "proj_example",
"model": "gpt-6-luna",
"user_id": null,
"api_key_id": null,
"batch": null,
"service_tier": null
}
]
}
],
"has_more": false,
"next_page": null
}