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 @@
{
".": "3.3.0"
".": "3.4.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 118
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f312a661d9dd6b5d6d676e449c357f6414afd1fdaaf4d982d44ad86cba5c5f6e.yml
openapi_spec_hash: b62fd3d3fb98e37b1da0a2e22af51d40
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-51afd6abbcb18c3086f62993f9379c18443b9e516cbc0548ddfb932e835657f8.yml
openapi_spec_hash: dae6afeaefa15cb8700c7a870531e06f
config_hash: b854932c0ea24b400bdd64e4376936bd
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.4.0 (2025-09-03)

Full Changelog: [v3.3.0...v3.4.0](https://github.com/openai/openai-java/compare/v3.3.0...v3.4.0)

### Features

* **api:** Add gpt-realtime models ([37b8b69](https://github.com/openai/openai-java/commit/37b8b69cb027e9c9e3abd7d9d9ce211a2c6e165c))

## 3.3.0 (2025-09-03)

Full Changelog: [v3.2.1...v3.3.0](https://github.com/openai/openai-java/compare/v3.2.1...v3.3.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/3.3.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/3.3.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/3.3.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/3.4.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/3.4.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/3.4.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/3.3.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/3.4.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:3.3.0")
implementation("com.openai:openai-java:3.4.0")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.openai:openai-java:3.3.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<version>3.3.0</version>
<version>3.4.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:3.3.0")
implementation("com.openai:openai-java-spring-boot-starter:3.4.0")
```

#### Maven
Expand All @@ -1351,7 +1351,7 @@ implementation("com.openai:openai-java-spring-boot-starter:3.3.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java-spring-boot-starter</artifactId>
<version>3.3.0</version>
<version>3.4.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 = "3.3.0" // x-release-please-version
version = "3.4.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,10 @@ private constructor(

companion object {

@JvmField val GPT_REALTIME = of("gpt-realtime")

@JvmField val GPT_REALTIME_2025_08_28 = of("gpt-realtime-2025-08-28")

@JvmField val GPT_4O_REALTIME_PREVIEW = of("gpt-4o-realtime-preview")

@JvmField
Expand All @@ -2239,6 +2243,8 @@ private constructor(

/** An enum containing [Model]'s known values. */
enum class Known {
GPT_REALTIME,
GPT_REALTIME_2025_08_28,
GPT_4O_REALTIME_PREVIEW,
GPT_4O_REALTIME_PREVIEW_2024_10_01,
GPT_4O_REALTIME_PREVIEW_2024_12_17,
Expand All @@ -2257,6 +2263,8 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
GPT_REALTIME,
GPT_REALTIME_2025_08_28,
GPT_4O_REALTIME_PREVIEW,
GPT_4O_REALTIME_PREVIEW_2024_10_01,
GPT_4O_REALTIME_PREVIEW_2024_12_17,
Expand All @@ -2276,6 +2284,8 @@ private constructor(
*/
fun value(): Value =
when (this) {
GPT_REALTIME -> Value.GPT_REALTIME
GPT_REALTIME_2025_08_28 -> Value.GPT_REALTIME_2025_08_28
GPT_4O_REALTIME_PREVIEW -> Value.GPT_4O_REALTIME_PREVIEW
GPT_4O_REALTIME_PREVIEW_2024_10_01 -> Value.GPT_4O_REALTIME_PREVIEW_2024_10_01
GPT_4O_REALTIME_PREVIEW_2024_12_17 -> Value.GPT_4O_REALTIME_PREVIEW_2024_12_17
Expand All @@ -2297,6 +2307,8 @@ private constructor(
*/
fun known(): Known =
when (this) {
GPT_REALTIME -> Known.GPT_REALTIME
GPT_REALTIME_2025_08_28 -> Known.GPT_REALTIME_2025_08_28
GPT_4O_REALTIME_PREVIEW -> Known.GPT_4O_REALTIME_PREVIEW
GPT_4O_REALTIME_PREVIEW_2024_10_01 -> Known.GPT_4O_REALTIME_PREVIEW_2024_10_01
GPT_4O_REALTIME_PREVIEW_2024_12_17 -> Known.GPT_4O_REALTIME_PREVIEW_2024_12_17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,10 @@ private constructor(

companion object {

@JvmField val GPT_REALTIME = of("gpt-realtime")

@JvmField val GPT_REALTIME_2025_08_28 = of("gpt-realtime-2025-08-28")

@JvmField val GPT_4O_REALTIME = of("gpt-4o-realtime")

@JvmField val GPT_4O_MINI_REALTIME = of("gpt-4o-mini-realtime")
Expand All @@ -918,6 +922,8 @@ private constructor(

/** An enum containing [Model]'s known values. */
enum class Known {
GPT_REALTIME,
GPT_REALTIME_2025_08_28,
GPT_4O_REALTIME,
GPT_4O_MINI_REALTIME,
GPT_4O_REALTIME_PREVIEW,
Expand All @@ -938,6 +944,8 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
GPT_REALTIME,
GPT_REALTIME_2025_08_28,
GPT_4O_REALTIME,
GPT_4O_MINI_REALTIME,
GPT_4O_REALTIME_PREVIEW,
Expand All @@ -959,6 +967,8 @@ private constructor(
*/
fun value(): Value =
when (this) {
GPT_REALTIME -> Value.GPT_REALTIME
GPT_REALTIME_2025_08_28 -> Value.GPT_REALTIME_2025_08_28
GPT_4O_REALTIME -> Value.GPT_4O_REALTIME
GPT_4O_MINI_REALTIME -> Value.GPT_4O_MINI_REALTIME
GPT_4O_REALTIME_PREVIEW -> Value.GPT_4O_REALTIME_PREVIEW
Expand All @@ -982,6 +992,8 @@ private constructor(
*/
fun known(): Known =
when (this) {
GPT_REALTIME -> Known.GPT_REALTIME
GPT_REALTIME_2025_08_28 -> Known.GPT_REALTIME_2025_08_28
GPT_4O_REALTIME -> Known.GPT_4O_REALTIME
GPT_4O_MINI_REALTIME -> Known.GPT_4O_MINI_REALTIME
GPT_4O_REALTIME_PREVIEW -> Known.GPT_4O_REALTIME_PREVIEW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ internal class RealtimeClientEventTest {
SessionUpdateEvent.builder()
.session(
RealtimeSessionCreateRequest.builder()
.model(RealtimeSessionCreateRequest.Model.GPT_4O_REALTIME)
.model(RealtimeSessionCreateRequest.Model.GPT_REALTIME)
.audio(
RealtimeAudioConfig.builder()
.input(
Expand Down Expand Up @@ -694,7 +694,7 @@ internal class RealtimeClientEventTest {
SessionUpdateEvent.builder()
.session(
RealtimeSessionCreateRequest.builder()
.model(RealtimeSessionCreateRequest.Model.GPT_4O_REALTIME)
.model(RealtimeSessionCreateRequest.Model.GPT_REALTIME)
.audio(
RealtimeAudioConfig.builder()
.input(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2906,7 +2906,7 @@ internal class RealtimeServerEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down Expand Up @@ -3030,7 +3030,7 @@ internal class RealtimeServerEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down Expand Up @@ -3109,7 +3109,7 @@ internal class RealtimeServerEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down Expand Up @@ -3233,7 +3233,7 @@ internal class RealtimeServerEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal class RealtimeSessionCreateRequestTest {
fun create() {
val realtimeSessionCreateRequest =
RealtimeSessionCreateRequest.builder()
.model(RealtimeSessionCreateRequest.Model.GPT_4O_REALTIME)
.model(RealtimeSessionCreateRequest.Model.GPT_REALTIME)
.audio(
RealtimeAudioConfig.builder()
.input(
Expand Down Expand Up @@ -108,7 +108,7 @@ internal class RealtimeSessionCreateRequestTest {
.build()

assertThat(realtimeSessionCreateRequest.model())
.isEqualTo(RealtimeSessionCreateRequest.Model.GPT_4O_REALTIME)
.isEqualTo(RealtimeSessionCreateRequest.Model.GPT_REALTIME)
assertThat(realtimeSessionCreateRequest.audio())
.contains(
RealtimeAudioConfig.builder()
Expand Down Expand Up @@ -210,7 +210,7 @@ internal class RealtimeSessionCreateRequestTest {
val jsonMapper = jsonMapper()
val realtimeSessionCreateRequest =
RealtimeSessionCreateRequest.builder()
.model(RealtimeSessionCreateRequest.Model.GPT_4O_REALTIME)
.model(RealtimeSessionCreateRequest.Model.GPT_REALTIME)
.audio(
RealtimeAudioConfig.builder()
.input(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal class RealtimeSessionTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down Expand Up @@ -101,7 +101,7 @@ internal class RealtimeSessionTest {
.contains(RealtimeSession.MaxResponseOutputTokens.ofInteger(0L))
assertThat(realtimeSession.modalities().getOrNull())
.containsExactly(RealtimeSession.Modality.TEXT)
assertThat(realtimeSession.model()).contains(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
assertThat(realtimeSession.model()).contains(RealtimeSession.Model.GPT_REALTIME)
assertThat(realtimeSession.object_()).contains(RealtimeSession.Object.REALTIME_SESSION)
assertThat(realtimeSession.outputAudioFormat())
.contains(RealtimeSession.OutputAudioFormat.PCM16)
Expand Down Expand Up @@ -170,7 +170,7 @@ internal class RealtimeSessionTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal class SessionCreatedEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down Expand Up @@ -103,7 +103,7 @@ internal class SessionCreatedEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down Expand Up @@ -173,7 +173,7 @@ internal class SessionCreatedEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal class SessionUpdateEventTest {
SessionUpdateEvent.builder()
.session(
RealtimeSessionCreateRequest.builder()
.model(RealtimeSessionCreateRequest.Model.GPT_4O_REALTIME)
.model(RealtimeSessionCreateRequest.Model.GPT_REALTIME)
.audio(
RealtimeAudioConfig.builder()
.input(
Expand Down Expand Up @@ -123,7 +123,7 @@ internal class SessionUpdateEventTest {
assertThat(sessionUpdateEvent.session())
.isEqualTo(
RealtimeSessionCreateRequest.builder()
.model(RealtimeSessionCreateRequest.Model.GPT_4O_REALTIME)
.model(RealtimeSessionCreateRequest.Model.GPT_REALTIME)
.audio(
RealtimeAudioConfig.builder()
.input(
Expand Down Expand Up @@ -229,7 +229,7 @@ internal class SessionUpdateEventTest {
SessionUpdateEvent.builder()
.session(
RealtimeSessionCreateRequest.builder()
.model(RealtimeSessionCreateRequest.Model.GPT_4O_REALTIME)
.model(RealtimeSessionCreateRequest.Model.GPT_REALTIME)
.audio(
RealtimeAudioConfig.builder()
.input(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal class SessionUpdatedEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down Expand Up @@ -103,7 +103,7 @@ internal class SessionUpdatedEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down Expand Up @@ -173,7 +173,7 @@ internal class SessionUpdatedEventTest {
.instructions("instructions")
.maxResponseOutputTokens(0L)
.addModality(RealtimeSession.Modality.TEXT)
.model(RealtimeSession.Model.GPT_4O_REALTIME_PREVIEW)
.model(RealtimeSession.Model.GPT_REALTIME)
.object_(RealtimeSession.Object.REALTIME_SESSION)
.outputAudioFormat(RealtimeSession.OutputAudioFormat.PCM16)
.prompt(
Expand Down
Loading
Loading