NAME

OpenAPI::Client::OpenAI::Path::organization-usage-images - Documentation for the /organization/usage/images path.

OPERATIONS

GET /organization/usage/images

usage-images

$client->usage_images({
    body => { ... },
});

Get images usage details for the organization.

Path/query parameters

  • start_time (in query, required, integer) - Start time (Unix seconds) of the query time range, inclusive.

  • end_time (in query, optional, integer) - End time (Unix seconds) of the query time range, exclusive.

  • bucket_width (in query, optional, string) - Width of each time bucket in response. Currently 1m , 1h and 1d are supported, default to 1d .

    Allowed values: 1m, 1h, 1d

    Default: 1d

  • sources (in query, optional, array) - Return only usages for these sources. Possible values are image.generation , image.edit , image.variation or any combination of them.

  • sizes (in query, optional, array) - Return only usages for these image sizes. Possible values are 256x256 , 512x512 , 1024x1024 , 1792x1792 , 1024x1792 or any combination of them.

  • project_ids (in query, optional, array) - Return only usage for these projects.

  • user_ids (in query, optional, array) - Return only usage for these users.

  • api_key_ids (in query, optional, array) - Return only usage for these API keys.

  • models (in query, optional, array) - Return only usage for these models.

  • group_by (in query, optional, array) - 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.

  • limit (in query, optional, integer) - 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

  • page (in query, optional, string) - A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Responses

200 - Usage data retrieved successfully.

Content-Type: application/json

Example:

{
   "data" : [
      {
         "end_time" : 0,
         "object" : "bucket",
         "results" : [
            "{\n    \"object\": \"organization.usage.completions.result\",\n    \"input_tokens\": 5000,\n    \"output_tokens\": 1000,\n    \"input_cached_tokens\": 4000,\n    \"input_audio_tokens\": 300,\n    \"output_audio_tokens\": 200,\n    \"num_model_requests\": 5,\n    \"project_id\": \"proj_abc\",\n    \"user_id\": \"user-abc\",\n    \"api_key_id\": \"key_abc\",\n    \"model\": \"gpt-4o-mini-2024-07-18\",\n    \"batch\": false,\n    \"service_tier\": \"default\"\n}\n"
         ],
         "start_time" : 0
      }
   ],
   "has_more" : false,
   "next_page" : "string",
   "object" : "page"
}

SCHEMAS

UsageResponse

Properties:

  • data (array of UsageTimeBucket, required)

  • has_more (boolean, required)

  • next_page (anyOf, required)

  • object (string, required)

    Allowed values: page

UsageTimeBucket

Properties:

  • end_time (integer, required)

  • object (string, required)

    Allowed values: bucket

  • results (array of object, required)

  • start_time (integer, required)

SEE ALSO

OpenAPI::Client::OpenAI::Path

COPYRIGHT AND LICENSE

Copyright (C) 2023-2026 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.