provider Usage GET
/organization/usage/images @utdk/openai
/organization/usage/images Get images usage details for the organization.
- start_time query required
- Start time (Unix seconds) of the query time range, inclusive.
- integer
- end_time query
- End time (Unix seconds) of the query time range, exclusive.
- integer
- bucket_width query
- Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
- enum: 1m, 1h, 1d
- sources query
- Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them.
- array
- sizes query
- Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them.
- array
- project_ids query
- Return only usage for these projects.
- array
- user_ids query
- Return only usage for these users.
- array
- api_key_ids query
- Return only usage for these API keys.
- array
- models query
- Return only usage for these models.
- array
- group_by query
- Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `size`, `source` or any combination of them.
- array
- limit query
- Specifies the number of buckets to return. - `bucket_width=1d`: default: 7, max: 31 - `bucket_width=1h`: default: 24, max: 168 - `bucket_width=1m`: default: 60, max: 1440
- integer
- page query
- A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
- string
Try it
Authentication
Configure credentials for OpenAI API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import openai from '@utdk/openai';
await openai.usageImages({
"bucket_width": "1d"
})