apicheats.dev openai/llms.txt Raw .md
GET

GET /organization/usage/images — OpenAI API

OpenAI admin key (required); https://api.openai.com/v1

OpenAI API

Images

Base URL
https://api.openai.com/v1
Auth
Authorization: Bearer <OPENAI_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 346 tokens · Vary: Accept

Critical gotchas

The Responses API is the primary interface for new text and tool workflows; Chat Completions remains a separate compatibility API.

Audio transcription uploads use multipart form data rather than a JSON request body.

cURL

curl -X GET 'https://api.openai.com/v1/organization/usage/images?start_time=10&end_time=10&bucket_width=1d&sources=example&sizes=example&project_ids=example&user_ids=example&api_key_ids=example&models=example&group_by=example&limit=10&page=example-page' \  -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

Parameters

Name In Type Required Description
start_time query integer Yes Start time (Unix seconds) of the query time range, inclusive.
end_time query integer No End time (Unix seconds) of the query time range, exclusive.
bucket_width query string No Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
sources query string[] No Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them.
sizes query string[] No Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them.
project_ids query string[] No Return only usage for these projects.
user_ids query string[] No Return only usage for these users.
api_key_ids query string[] No Return only usage for these API keys.
models query string[] No Return only usage for these models.
group_by query string[] No 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 query integer No 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 query string No A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.

Response 200 OK

{
  "object": "page",
  "data": [
    {
      "object": "bucket",
      "start_time": 0,
      "end_time": 0,
      "results": [
        {
          "api_source": "agents_api",
          "object": "organization.usage.completions.result",
          "input_tokens": 0,
          "input_cached_tokens": 0,
          "input_cache_write_tokens": 0,
          "input_cache_write_30m_tokens": 0,
          "input_cache_write_12h_tokens": 0,
          "input_uncached_tokens": 0,
          "output_tokens": 0,
          "input_text_tokens": 0,
          "output_text_tokens": 0,
          "input_cached_text_tokens": 0,
          "input_audio_tokens": 0,
          "input_cached_audio_tokens": 0,
          "output_audio_tokens": 0,
          "input_image_tokens": 0,
          "input_cached_image_tokens": 0,
          "output_image_tokens": 0,
          "num_model_requests": 0,
          "project_id": "string",
          "user_id": "string",
          "api_key_id": "string",
          "model": "string",
          "batch": true,
          "service_tier": "string"
        }
      ]
    }
  ],
  "has_more": true,
  "next_page": "string"
}
Get a free OpenAI API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.