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.12.0"
".": "4.13.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: 136
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fe8e67bdc351a518b113ab48e775750190e207807903d6b03ab22c438c38a588.yml
openapi_spec_hash: 8af972190647ffb9dcec516e19d8761a
config_hash: d013f4fdd4dd59c6f376a9ca482b7f9e
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-75926226b642ebb2cb415694da9dff35e8ab40145ac1b791cefb82a83809db4d.yml
openapi_spec_hash: 6a0e391b0ba5747b6b4a3e5fe21de4da
config_hash: adcf23ecf5f84d3cadf1d71e82ec636a
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 4.13.0 (2025-12-19)

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

### Features

* **api:** gpt-image-1.5 ([165b588](https://github.com/openai/openai-java/commit/165b588743c301493e0dc8126cfe32c549bdc4ad))
* **api:** slugs for new audio models; make all `model` params accept strings ([cf46781](https://github.com/openai/openai-java/commit/cf4678180c4c2d4f79356a0dd5228db0a2e4cd84))

## 4.12.0 (2025-12-15)

Full Changelog: [v4.11.0...v4.12.0](https://github.com/openai/openai-java/compare/v4.11.0...v4.12.0)
Expand Down
14 changes: 7 additions & 7 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.12.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.12.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.12.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/4.13.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.13.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.13.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.12.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.13.0).

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

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

```kotlin
implementation("com.openai:openai-java:4.12.0")
implementation("com.openai:openai-java:4.13.0")
```

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

Expand Down Expand Up @@ -1342,7 +1342,7 @@ If you're using Spring Boot, then you can use the SDK's [Spring Boot starter](ht
#### Gradle

```kotlin
implementation("com.openai:openai-java-spring-boot-starter:4.12.0")
implementation("com.openai:openai-java-spring-boot-starter:4.13.0")
```

#### Maven
Expand All @@ -1351,7 +1351,7 @@ implementation("com.openai:openai-java-spring-boot-starter:4.12.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java-spring-boot-starter</artifactId>
<version>4.12.0</version>
<version>4.13.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 @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.openai"
version = "4.12.0" // x-release-please-version
version = "4.13.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S

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

@JvmField val GPT_4O_MINI_TRANSCRIBE_2025_12_15 = of("gpt-4o-mini-transcribe-2025-12-15")

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

@JvmStatic fun of(value: String) = AudioModel(JsonField.of(value))
Expand All @@ -36,6 +38,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
WHISPER_1,
GPT_4O_TRANSCRIBE,
GPT_4O_MINI_TRANSCRIBE,
GPT_4O_MINI_TRANSCRIBE_2025_12_15,
GPT_4O_TRANSCRIBE_DIARIZE,
}

Expand All @@ -52,6 +55,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
WHISPER_1,
GPT_4O_TRANSCRIBE,
GPT_4O_MINI_TRANSCRIBE,
GPT_4O_MINI_TRANSCRIBE_2025_12_15,
GPT_4O_TRANSCRIBE_DIARIZE,
/** An enum member indicating that [AudioModel] was instantiated with an unknown value. */
_UNKNOWN,
Expand All @@ -69,6 +73,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
WHISPER_1 -> Value.WHISPER_1
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
GPT_4O_TRANSCRIBE_DIARIZE -> Value.GPT_4O_TRANSCRIBE_DIARIZE
else -> Value._UNKNOWN
}
Expand All @@ -86,6 +91,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
WHISPER_1 -> Known.WHISPER_1
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
GPT_4O_TRANSCRIBE_DIARIZE -> Known.GPT_4O_TRANSCRIBE_DIARIZE
else -> throw OpenAIInvalidDataException("Unknown AudioModel: $value")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private constructor(

/**
* One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`,
* `tts-1-hd` or `gpt-4o-mini-tts`.
* `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
Expand Down Expand Up @@ -206,7 +206,7 @@ private constructor(

/**
* One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`,
* `tts-1-hd` or `gpt-4o-mini-tts`.
* `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
*/
fun model(model: SpeechModel) = apply { body.model(model) }

Expand Down Expand Up @@ -512,7 +512,7 @@ private constructor(

/**
* One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`,
* `tts-1-hd` or `gpt-4o-mini-tts`.
* `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
Expand Down Expand Up @@ -690,7 +690,7 @@ private constructor(

/**
* One of the available [TTS models](https://platform.openai.com/docs/models#tts):
* `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
* `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
*/
fun model(model: SpeechModel) = model(JsonField.of(model))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<

@JvmField val GPT_4O_MINI_TTS = of("gpt-4o-mini-tts")

@JvmField val GPT_4O_MINI_TTS_2025_12_15 = of("gpt-4o-mini-tts-2025-12-15")

@JvmStatic fun of(value: String) = SpeechModel(JsonField.of(value))
}

Expand All @@ -34,6 +36,7 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<
TTS_1,
TTS_1_HD,
GPT_4O_MINI_TTS,
GPT_4O_MINI_TTS_2025_12_15,
}

/**
Expand All @@ -49,6 +52,7 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<
TTS_1,
TTS_1_HD,
GPT_4O_MINI_TTS,
GPT_4O_MINI_TTS_2025_12_15,
/** An enum member indicating that [SpeechModel] was instantiated with an unknown value. */
_UNKNOWN,
}
Expand All @@ -65,6 +69,7 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<
TTS_1 -> Value.TTS_1
TTS_1_HD -> Value.TTS_1_HD
GPT_4O_MINI_TTS -> Value.GPT_4O_MINI_TTS
GPT_4O_MINI_TTS_2025_12_15 -> Value.GPT_4O_MINI_TTS_2025_12_15
else -> Value._UNKNOWN
}

Expand All @@ -81,6 +86,7 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<
TTS_1 -> Known.TTS_1
TTS_1_HD -> Known.TTS_1_HD
GPT_4O_MINI_TTS -> Known.GPT_4O_MINI_TTS
GPT_4O_MINI_TTS_2025_12_15 -> Known.GPT_4O_MINI_TTS_2025_12_15
else -> throw OpenAIInvalidDataException("Unknown SpeechModel: $value")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ private constructor(

/**
* ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`,
* `whisper-1` (which is powered by our open source Whisper V2 model), and
* `gpt-4o-transcribe-diarize`.
* `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper
* V2 model), and `gpt-4o-transcribe-diarize`.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
Expand All @@ -77,8 +77,9 @@ private constructor(
* Additional information to include in the transcription response. `logprobs` will return the
* log probabilities of the tokens in the response to understand the model's confidence in the
* transcription. `logprobs` only works with response_format set to `json` and only with the
* models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`. This field is not supported when
* using `gpt-4o-transcribe-diarize`.
* models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and
* `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using
* `gpt-4o-transcribe-diarize`.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
Expand Down Expand Up @@ -328,8 +329,8 @@ private constructor(

/**
* ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`,
* `whisper-1` (which is powered by our open source Whisper V2 model), and
* `gpt-4o-transcribe-diarize`.
* `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source
* Whisper V2 model), and `gpt-4o-transcribe-diarize`.
*/
fun model(model: AudioModel) = apply { body.model(model) }

Expand Down Expand Up @@ -388,8 +389,9 @@ private constructor(
* Additional information to include in the transcription response. `logprobs` will return
* the log probabilities of the tokens in the response to understand the model's confidence
* in the transcription. `logprobs` only works with response_format set to `json` and only
* with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`. This field is not
* supported when using `gpt-4o-transcribe-diarize`.
* with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and
* `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using
* `gpt-4o-transcribe-diarize`.
*/
fun include(include: List<TranscriptionInclude>) = apply { body.include(include) }

Expand Down Expand Up @@ -759,8 +761,8 @@ private constructor(

/**
* ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`,
* `whisper-1` (which is powered by our open source Whisper V2 model), and
* `gpt-4o-transcribe-diarize`.
* `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source
* Whisper V2 model), and `gpt-4o-transcribe-diarize`.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
Expand All @@ -784,8 +786,9 @@ private constructor(
* Additional information to include in the transcription response. `logprobs` will return
* the log probabilities of the tokens in the response to understand the model's confidence
* in the transcription. `logprobs` only works with response_format set to `json` and only
* with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`. This field is not
* supported when using `gpt-4o-transcribe-diarize`.
* with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and
* `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using
* `gpt-4o-transcribe-diarize`.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
Expand Down Expand Up @@ -1069,8 +1072,8 @@ private constructor(

/**
* ID of the model to use. The options are `gpt-4o-transcribe`,
* `gpt-4o-mini-transcribe`, `whisper-1` (which is powered by our open source Whisper V2
* model), and `gpt-4o-transcribe-diarize`.
* `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is
* powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`.
*/
fun model(model: AudioModel) = model(MultipartField.of(model))

Expand Down Expand Up @@ -1132,8 +1135,9 @@ private constructor(
* Additional information to include in the transcription response. `logprobs` will
* return the log probabilities of the tokens in the response to understand the model's
* confidence in the transcription. `logprobs` only works with response_format set to
* `json` and only with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`.
* This field is not supported when using `gpt-4o-transcribe-diarize`.
* `json` and only with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and
* `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using
* `gpt-4o-transcribe-diarize`.
*/
fun include(include: List<TranscriptionInclude>) = include(MultipartField.of(include))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ private constructor(
) : this(b64Json, revisedPrompt, url, mutableMapOf())

/**
* The base64-encoded JSON of the generated image. Default value for `gpt-image-1`, and only
* present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`.
* The base64-encoded JSON of the generated image. Returned by default for the GPT image models,
* and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
Expand All @@ -53,7 +53,7 @@ private constructor(

/**
* When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is
* set to `url` (default value). Unsupported for `gpt-image-1`.
* set to `url` (default value). Unsupported for the GPT image models.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
Expand Down Expand Up @@ -118,8 +118,9 @@ private constructor(
}

/**
* The base64-encoded JSON of the generated image. Default value for `gpt-image-1`, and only
* present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`.
* The base64-encoded JSON of the generated image. Returned by default for the GPT image
* models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and
* `dall-e-3`.
*/
fun b64Json(b64Json: String) = b64Json(JsonField.of(b64Json))

Expand Down Expand Up @@ -147,7 +148,7 @@ private constructor(

/**
* When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format`
* is set to `url` (default value). Unsupported for `gpt-image-1`.
* is set to `url` (default value). Unsupported for the GPT image models.
*/
fun url(url: String) = url(JsonField.of(url))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private constructor(
@JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type

/**
* For `gpt-image-1` only, the token usage information for the image generation.
* For the GPT image models only, the token usage information for the image generation.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
Expand Down Expand Up @@ -321,7 +321,7 @@ private constructor(
*/
fun type(type: JsonValue) = apply { this.type = type }

/** For `gpt-image-1` only, the token usage information for the image generation. */
/** For the GPT image models only, the token usage information for the image generation. */
fun usage(usage: Usage) = usage(JsonField.of(usage))

/**
Expand Down Expand Up @@ -974,7 +974,7 @@ private constructor(
override fun toString() = value.toString()
}

/** For `gpt-image-1` only, the token usage information for the image generation. */
/** For the GPT image models only, the token usage information for the image generation. */
class Usage
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
Expand Down
Loading