Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Audio speeches

UsageAudioSpeechesResponse admin().organization().usage().audioSpeeches(UsageAudioSpeechesParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/organization/usage/audio_speeches

Get audio speeches usage details for the organization.

ParametersExpand Collapse
UsageAudioSpeechesParams params
long startTime

Start time (Unix seconds) of the query time range, inclusive.

Optional<List<String>> apiKeyIds

Return only usage for these API keys.

Optional<BucketWidth> bucketWidth

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Optional<Long> endTime

End time (Unix seconds) of the query time range, exclusive.

Optional<List<GroupBy>> groupBy

Group the usage data by the specified fields. Support fields include project_id, user_id, api_key_id, model or any combination of them.

Optional<Long> limit

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
Optional<List<String>> models

Return only usage for these models.

Optional<String> page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Optional<List<String>> projectIds

Return only usage for these projects.

Optional<List<String>> userIds

Return only usage for these users.

ReturnsExpand Collapse
class UsageAudioSpeechesResponse:
List<Data> data
boolean hasMore
Optional<String> nextPage
JsonValue; object_ "page"constant"page"constant

Audio speeches

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.admin.organization.usage.UsageAudioSpeechesParams;
import com.openai.models.admin.organization.usage.UsageAudioSpeechesResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        UsageAudioSpeechesParams params = UsageAudioSpeechesParams.builder()
            .startTime(0L)
            .build();
        UsageAudioSpeechesResponse response = client.admin().organization().usage().audioSpeeches(params);
    }
}
{
    "object": "page",
    "data": [
        {
            "object": "bucket",
            "start_time": 1730419200,
            "end_time": 1730505600,
            "results": [
                {
                    "object": "organization.usage.audio_speeches.result",
                    "characters": 45,
                    "num_model_requests": 1,
                    "project_id": null,
                    "user_id": null,
                    "api_key_id": null,
                    "model": null
                }
            ]
        }
    ],
    "has_more": false,
    "next_page": null
}
Returns Examples
{
    "object": "page",
    "data": [
        {
            "object": "bucket",
            "start_time": 1730419200,
            "end_time": 1730505600,
            "results": [
                {
                    "object": "organization.usage.audio_speeches.result",
                    "characters": 45,
                    "num_model_requests": 1,
                    "project_id": null,
                    "user_id": null,
                    "api_key_id": null,
                    "model": null
                }
            ]
        }
    ],
    "has_more": false,
    "next_page": null
}