Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.45.0"
".": "4.46.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 277
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-0650ebae454b4200491980d7663cb7ceabcff90dcb3ed9f67c3bca3e861a2bf6.yml
openapi_spec_hash: e9576bced964246b7e685a5ad30afffa
config_hash: 43e311595bcc4fb6b32eba0684de48d8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-9152683f2fa71f5555cbbb53123ec013b7c83ee6fed4333e76c22a6f48a05f1c.yml
openapi_spec_hash: c58a8c1bb1f5bb7245323db9437bd67f
config_hash: ca12d10f1dbe101a81cd0376f868c674
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 4.46.0 (2026-07-28)

Full Changelog: [v4.45.0...v4.46.0](https://github.com/openai/openai-java/compare/v4.45.0...v4.46.0)

### Features

* **api:** transcription model updates ([82b568b](https://github.com/openai/openai-java/commit/82b568bbd3e1bb5f2e80756a2f06284fbe28a192))
* **support:** establish Java support policy and retire the Spring Boot 2 starter ([#820](https://github.com/openai/openai-java/issues/820)) ([f87609f](https://github.com/openai/openai-java/commit/f87609f0039f9dc4fc4b0e224f977c8ee1a86627))


### Build System

* **deps:** fix 27 consumer-isolated Dependabot alerts ([#810](https://github.com/openai/openai-java/issues/810)) ([d9eefdc](https://github.com/openai/openai-java/commit/d9eefdc7ede7b648894ca8f2aadd9626a38353c1))
* **deps:** patch consumer-neutral dependencies ([#816](https://github.com/openai/openai-java/issues/816)) ([8b79573](https://github.com/openai/openai-java/commit/8b7957326f399314a0a40027865b01ae49f0c304))

## 4.45.0 (2026-07-23)

Full Changelog: [v4.44.0...v4.45.0](https://github.com/openai/openai-java/compare/v4.44.0...v4.45.0)
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/4.45.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.45.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.45.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/4.46.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.46.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.46.0)

<!-- x-release-please-end -->

The OpenAI Java SDK provides convenient access to the [OpenAI REST API](https://platform.openai.com/docs) from applications written in Java.

<!-- x-release-please-start-version -->

The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/4.45.0).
The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/4.46.0).

<!-- x-release-please-end -->

Expand All @@ -22,7 +22,7 @@ The REST API documentation can be found on [platform.openai.com](https://platfor
### Gradle

```kotlin
implementation("com.openai:openai-java:4.45.0")
implementation("com.openai:openai-java:4.46.0")
```

### Maven
Expand All @@ -31,7 +31,7 @@ implementation("com.openai:openai-java:4.45.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<version>4.45.0</version>
<version>4.46.0</version>
</dependency>
```

Expand Down Expand Up @@ -94,7 +94,7 @@ with normal AWS credentials:
<!-- x-release-please-start-version -->

```kotlin
implementation("com.openai:openai-java-bedrock:4.45.0")
implementation("com.openai:openai-java-bedrock:4.46.0")
```

<!-- x-release-please-end -->
Expand Down
4 changes: 2 additions & 2 deletions bedrock.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ Use this artifact instead of adding AWS dependencies to the base OpenAI package
<!-- x-release-please-start-version -->

```kotlin
implementation("com.openai:openai-java-bedrock:4.45.0")
implementation("com.openai:openai-java-bedrock:4.46.0")
```

```xml
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java-bedrock</artifactId>
<version>4.45.0</version>
<version>4.46.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repositories {

allprojects {
group = "com.openai"
version = "4.45.0" // x-release-please-version
version = "4.46.0" // x-release-please-version

// Dokka 2.1.0 depends on Jackson 2.15.3. Keep its isolated build-tool classpaths on a
// secure, internally aligned Jackson release without changing the SDK's published or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S

@JvmField val WHISPER_1 = of("whisper-1")

@JvmField val GPT_TRANSCRIBE = of("gpt-transcribe")

@JvmField val GPT_4O_TRANSCRIBE = of("gpt-4o-transcribe")

@JvmField val GPT_4O_MINI_TRANSCRIBE = of("gpt-4o-mini-transcribe")
Expand All @@ -36,6 +38,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
/** An enum containing [AudioModel]'s known values. */
enum class Known {
WHISPER_1,
GPT_TRANSCRIBE,
GPT_4O_TRANSCRIBE,
GPT_4O_MINI_TRANSCRIBE,
GPT_4O_MINI_TRANSCRIBE_2025_12_15,
Expand All @@ -53,6 +56,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
*/
enum class Value {
WHISPER_1,
GPT_TRANSCRIBE,
GPT_4O_TRANSCRIBE,
GPT_4O_MINI_TRANSCRIBE,
GPT_4O_MINI_TRANSCRIBE_2025_12_15,
Expand All @@ -71,6 +75,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
fun value(): Value =
when (this) {
WHISPER_1 -> Value.WHISPER_1
GPT_TRANSCRIBE -> Value.GPT_TRANSCRIBE
GPT_4O_TRANSCRIBE -> Value.GPT_4O_TRANSCRIBE
GPT_4O_MINI_TRANSCRIBE -> Value.GPT_4O_MINI_TRANSCRIBE
GPT_4O_MINI_TRANSCRIBE_2025_12_15 -> Value.GPT_4O_MINI_TRANSCRIBE_2025_12_15
Expand All @@ -89,6 +94,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
fun known(): Known =
when (this) {
WHISPER_1 -> Known.WHISPER_1
GPT_TRANSCRIBE -> Known.GPT_TRANSCRIBE
GPT_4O_TRANSCRIBE -> Known.GPT_4O_TRANSCRIBE
GPT_4O_MINI_TRANSCRIBE -> Known.GPT_4O_MINI_TRANSCRIBE
GPT_4O_MINI_TRANSCRIBE_2025_12_15 -> Known.GPT_4O_MINI_TRANSCRIBE_2025_12_15
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Transcription
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val text: JsonField<String>,
private val languages: JsonField<List<TranscriptionLanguage>>,
private val logprobs: JsonField<List<Logprob>>,
private val usage: JsonField<Usage>,
private val additionalProperties: MutableMap<String, JsonValue>,
Expand All @@ -42,11 +43,14 @@ private constructor(
@JsonCreator
private constructor(
@JsonProperty("text") @ExcludeMissing text: JsonField<String> = JsonMissing.of(),
@JsonProperty("languages")
@ExcludeMissing
languages: JsonField<List<TranscriptionLanguage>> = JsonMissing.of(),
@JsonProperty("logprobs")
@ExcludeMissing
logprobs: JsonField<List<Logprob>> = JsonMissing.of(),
@JsonProperty("usage") @ExcludeMissing usage: JsonField<Usage> = JsonMissing.of(),
) : this(text, logprobs, usage, mutableMapOf())
) : this(text, languages, logprobs, usage, mutableMapOf())

/**
* The transcribed text.
Expand All @@ -56,6 +60,15 @@ private constructor(
*/
fun text(): String = text.getRequired("text")

/**
* The languages detected in the audio. Returned by `gpt-transcribe`. An empty array indicates
* that no language could be reliably detected.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun languages(): Optional<List<TranscriptionLanguage>> = languages.getOptional("languages")

/**
* The log probabilities of the tokens in the transcription. Only returned with the models
* `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include`
Expand All @@ -81,6 +94,15 @@ private constructor(
*/
@JsonProperty("text") @ExcludeMissing fun _text(): JsonField<String> = text

/**
* Returns the raw JSON value of [languages].
*
* Unlike [languages], this method doesn't throw if the JSON field has an unexpected type.
*/
@JsonProperty("languages")
@ExcludeMissing
fun _languages(): JsonField<List<TranscriptionLanguage>> = languages

/**
* Returns the raw JSON value of [logprobs].
*
Expand Down Expand Up @@ -124,13 +146,15 @@ private constructor(
class Builder internal constructor() {

private var text: JsonField<String>? = null
private var languages: JsonField<MutableList<TranscriptionLanguage>>? = null
private var logprobs: JsonField<MutableList<Logprob>>? = null
private var usage: JsonField<Usage> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(transcription: Transcription) = apply {
text = transcription.text
languages = transcription.languages.map { it.toMutableList() }
logprobs = transcription.logprobs.map { it.toMutableList() }
usage = transcription.usage
additionalProperties = transcription.additionalProperties.toMutableMap()
Expand All @@ -147,6 +171,35 @@ private constructor(
*/
fun text(text: JsonField<String>) = apply { this.text = text }

/**
* The languages detected in the audio. Returned by `gpt-transcribe`. An empty array
* indicates that no language could be reliably detected.
*/
fun languages(languages: List<TranscriptionLanguage>) = languages(JsonField.of(languages))

/**
* Sets [Builder.languages] to an arbitrary JSON value.
*
* You should usually call [Builder.languages] with a well-typed
* `List<TranscriptionLanguage>` value instead. This method is primarily for setting the
* field to an undocumented or not yet supported value.
*/
fun languages(languages: JsonField<List<TranscriptionLanguage>>) = apply {
this.languages = languages.map { it.toMutableList() }
}

/**
* Adds a single [TranscriptionLanguage] to [languages].
*
* @throws IllegalStateException if the field was previously set to a non-list.
*/
fun addLanguage(language: TranscriptionLanguage) = apply {
languages =
(languages ?: JsonField.of(mutableListOf())).also {
checkKnown("languages", it).add(language)
}
}

/**
* The log probabilities of the tokens in the transcription. Only returned with the models
* `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include`
Expand Down Expand Up @@ -239,6 +292,7 @@ private constructor(
fun build(): Transcription =
Transcription(
checkRequired("text", text),
(languages ?: JsonMissing.of()).map { it.toImmutable() },
(logprobs ?: JsonMissing.of()).map { it.toImmutable() },
usage,
additionalProperties.toMutableMap(),
Expand All @@ -261,6 +315,7 @@ private constructor(
}

text()
languages().ifPresent { it.forEach { it.validate() } }
logprobs().ifPresent { it.forEach { it.validate() } }
usage().ifPresent { it.validate() }
validated = true
Expand All @@ -282,6 +337,7 @@ private constructor(
@JvmSynthetic
internal fun validity(): Int =
(if (text.asKnown().isPresent) 1 else 0) +
(languages.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(logprobs.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(usage.asKnown().getOrNull()?.validity() ?: 0)

Expand Down Expand Up @@ -1551,15 +1607,18 @@ private constructor(

return other is Transcription &&
text == other.text &&
languages == other.languages &&
logprobs == other.logprobs &&
usage == other.usage &&
additionalProperties == other.additionalProperties
}

private val hashCode: Int by lazy { Objects.hash(text, logprobs, usage, additionalProperties) }
private val hashCode: Int by lazy {
Objects.hash(text, languages, logprobs, usage, additionalProperties)
}

override fun hashCode(): Int = hashCode

override fun toString() =
"Transcription{text=$text, logprobs=$logprobs, usage=$usage, additionalProperties=$additionalProperties}"
"Transcription{text=$text, languages=$languages, logprobs=$logprobs, usage=$usage, additionalProperties=$additionalProperties}"
}
Loading
Loading