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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
uses: gradle/actions/setup-gradle@v4

- name: Build SDK
# disable gradle daemon in CI because it is flakey
env:
GRADLE_OPTS: "-Dkotlin.compiler.execution.strategy=in-process"
run: ./scripts/build

test:
Expand Down
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.1.0"
".": "4.2.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 122
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fadefdc7c7e30df47c09df323669b242ff90ee08e51f304175ace5274e0aab49.yml
openapi_spec_hash: 6d20f639d9ff8a097a34962da6218231
config_hash: 902654e60f5d659f2bfcfd903e17c46d
configured_endpoints: 135
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-d64cf80d2ebddf175c5578f68226a3d5bbd3f7fd8d62ccac2205f3fc05a355ee.yml
openapi_spec_hash: d51e0d60d0c536f210b597a211bc5af0
config_hash: e7c42016df9c6bd7bd6ff15101b9bc9b
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.2.0 (2025-10-06)

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

### Features

* **api:** dev day 2025 launches ([d4f0999](https://github.com/openai/openai-java/commit/d4f09991051ca1554f2452dd014941b3e5b77f73))

## 4.1.0 (2025-10-02)

Full Changelog: [v4.0.1...v4.1.0](https://github.com/openai/openai-java/compare/v4.0.1...v4.1.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.1.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.1.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.1.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/4.2.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.2.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.2.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.1.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.2.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.1.0")
implementation("com.openai:openai-java:4.2.0")
```

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

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

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.openai.services.blocking.RealtimeService
import com.openai.services.blocking.ResponseService
import com.openai.services.blocking.UploadService
import com.openai.services.blocking.VectorStoreService
import com.openai.services.blocking.VideoService
import com.openai.services.blocking.WebhookService
import java.util.function.Consumer

Expand Down Expand Up @@ -101,6 +102,8 @@ interface OpenAIClient {

fun containers(): ContainerService

fun videos(): VideoService

/**
* Closes this client, relinquishing any underlying resources.
*
Expand Down Expand Up @@ -163,5 +166,7 @@ interface OpenAIClient {
fun evals(): EvalService.WithRawResponse

fun containers(): ContainerService.WithRawResponse

fun videos(): VideoService.WithRawResponse
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.openai.services.async.RealtimeServiceAsync
import com.openai.services.async.ResponseServiceAsync
import com.openai.services.async.UploadServiceAsync
import com.openai.services.async.VectorStoreServiceAsync
import com.openai.services.async.VideoServiceAsync
import com.openai.services.async.WebhookServiceAsync
import java.util.function.Consumer

Expand Down Expand Up @@ -101,6 +102,8 @@ interface OpenAIClientAsync {

fun containers(): ContainerServiceAsync

fun videos(): VideoServiceAsync

/**
* Closes this client, relinquishing any underlying resources.
*
Expand Down Expand Up @@ -165,5 +168,7 @@ interface OpenAIClientAsync {
fun evals(): EvalServiceAsync.WithRawResponse

fun containers(): ContainerServiceAsync.WithRawResponse

fun videos(): VideoServiceAsync.WithRawResponse
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import com.openai.services.async.UploadServiceAsync
import com.openai.services.async.UploadServiceAsyncImpl
import com.openai.services.async.VectorStoreServiceAsync
import com.openai.services.async.VectorStoreServiceAsyncImpl
import com.openai.services.async.VideoServiceAsync
import com.openai.services.async.VideoServiceAsyncImpl
import com.openai.services.async.WebhookServiceAsync
import com.openai.services.async.WebhookServiceAsyncImpl
import java.util.function.Consumer
Expand Down Expand Up @@ -135,6 +137,10 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
ContainerServiceAsyncImpl(clientOptionsWithUserAgent)
}

private val videos: VideoServiceAsync by lazy {
VideoServiceAsyncImpl(clientOptionsWithUserAgent)
}

override fun sync(): OpenAIClient = sync

override fun withRawResponse(): OpenAIClientAsync.WithRawResponse = withRawResponse
Expand Down Expand Up @@ -182,6 +188,8 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl

override fun containers(): ContainerServiceAsync = containers

override fun videos(): VideoServiceAsync = videos

override fun close() = clientOptions.close()

class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
Expand Down Expand Up @@ -267,6 +275,10 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
ContainerServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}

private val videos: VideoServiceAsync.WithRawResponse by lazy {
VideoServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}

override fun withOptions(
modifier: Consumer<ClientOptions.Builder>
): OpenAIClientAsync.WithRawResponse =
Expand Down Expand Up @@ -313,5 +325,7 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
override fun evals(): EvalServiceAsync.WithRawResponse = evals

override fun containers(): ContainerServiceAsync.WithRawResponse = containers

override fun videos(): VideoServiceAsync.WithRawResponse = videos
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import com.openai.services.blocking.UploadService
import com.openai.services.blocking.UploadServiceImpl
import com.openai.services.blocking.VectorStoreService
import com.openai.services.blocking.VectorStoreServiceImpl
import com.openai.services.blocking.VideoService
import com.openai.services.blocking.VideoServiceImpl
import com.openai.services.blocking.WebhookService
import com.openai.services.blocking.WebhookServiceImpl
import java.util.function.Consumer
Expand Down Expand Up @@ -121,6 +123,8 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
ContainerServiceImpl(clientOptionsWithUserAgent)
}

private val videos: VideoService by lazy { VideoServiceImpl(clientOptionsWithUserAgent) }

override fun async(): OpenAIClientAsync = async

override fun withRawResponse(): OpenAIClient.WithRawResponse = withRawResponse
Expand Down Expand Up @@ -168,6 +172,8 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient

override fun containers(): ContainerService = containers

override fun videos(): VideoService = videos

override fun close() = clientOptions.close()

class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
Expand Down Expand Up @@ -253,6 +259,10 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
ContainerServiceImpl.WithRawResponseImpl(clientOptions)
}

private val videos: VideoService.WithRawResponse by lazy {
VideoServiceImpl.WithRawResponseImpl(clientOptions)
}

override fun withOptions(
modifier: Consumer<ClientOptions.Builder>
): OpenAIClient.WithRawResponse =
Expand Down Expand Up @@ -299,5 +309,7 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
override fun evals(): EvalService.WithRawResponse = evals

override fun containers(): ContainerService.WithRawResponse = containers

override fun videos(): VideoService.WithRawResponse = videos
}
}
12 changes: 12 additions & 0 deletions openai-java-core/src/main/kotlin/com/openai/models/AllModels.kt
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ private constructor(

@JvmField val GPT_5_CODEX = of("gpt-5-codex")

@JvmField val GPT_5_PRO = of("gpt-5-pro")

@JvmField val GPT_5_PRO_2025_10_06 = of("gpt-5-pro-2025-10-06")

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

Expand All @@ -270,6 +274,8 @@ private constructor(
COMPUTER_USE_PREVIEW,
COMPUTER_USE_PREVIEW_2025_03_11,
GPT_5_CODEX,
GPT_5_PRO,
GPT_5_PRO_2025_10_06,
}

/**
Expand All @@ -293,6 +299,8 @@ private constructor(
COMPUTER_USE_PREVIEW,
COMPUTER_USE_PREVIEW_2025_03_11,
GPT_5_CODEX,
GPT_5_PRO,
GPT_5_PRO_2025_10_06,
/**
* An enum member indicating that [ResponsesOnlyModel] was instantiated with an unknown
* value.
Expand Down Expand Up @@ -320,6 +328,8 @@ private constructor(
COMPUTER_USE_PREVIEW -> Value.COMPUTER_USE_PREVIEW
COMPUTER_USE_PREVIEW_2025_03_11 -> Value.COMPUTER_USE_PREVIEW_2025_03_11
GPT_5_CODEX -> Value.GPT_5_CODEX
GPT_5_PRO -> Value.GPT_5_PRO
GPT_5_PRO_2025_10_06 -> Value.GPT_5_PRO_2025_10_06
else -> Value._UNKNOWN
}

Expand All @@ -345,6 +355,8 @@ private constructor(
COMPUTER_USE_PREVIEW -> Known.COMPUTER_USE_PREVIEW
COMPUTER_USE_PREVIEW_2025_03_11 -> Known.COMPUTER_USE_PREVIEW_2025_03_11
GPT_5_CODEX -> Known.GPT_5_CODEX
GPT_5_PRO -> Known.GPT_5_PRO
GPT_5_PRO_2025_10_06 -> Known.GPT_5_PRO_2025_10_06
else -> throw OpenAIInvalidDataException("Unknown ResponsesOnlyModel: $value")
}

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

@JvmField val GPT_5_CODEX = of("gpt-5-codex")

@JvmField val GPT_5_PRO = of("gpt-5-pro")

@JvmField val GPT_5_PRO_2025_10_06 = of("gpt-5-pro-2025-10-06")

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

Expand All @@ -269,6 +273,8 @@ private constructor(
COMPUTER_USE_PREVIEW,
COMPUTER_USE_PREVIEW_2025_03_11,
GPT_5_CODEX,
GPT_5_PRO,
GPT_5_PRO_2025_10_06,
}

/**
Expand All @@ -292,6 +298,8 @@ private constructor(
COMPUTER_USE_PREVIEW,
COMPUTER_USE_PREVIEW_2025_03_11,
GPT_5_CODEX,
GPT_5_PRO,
GPT_5_PRO_2025_10_06,
/**
* An enum member indicating that [ResponsesOnlyModel] was instantiated with an unknown
* value.
Expand Down Expand Up @@ -319,6 +327,8 @@ private constructor(
COMPUTER_USE_PREVIEW -> Value.COMPUTER_USE_PREVIEW
COMPUTER_USE_PREVIEW_2025_03_11 -> Value.COMPUTER_USE_PREVIEW_2025_03_11
GPT_5_CODEX -> Value.GPT_5_CODEX
GPT_5_PRO -> Value.GPT_5_PRO
GPT_5_PRO_2025_10_06 -> Value.GPT_5_PRO_2025_10_06
else -> Value._UNKNOWN
}

Expand All @@ -344,6 +354,8 @@ private constructor(
COMPUTER_USE_PREVIEW -> Known.COMPUTER_USE_PREVIEW
COMPUTER_USE_PREVIEW_2025_03_11 -> Known.COMPUTER_USE_PREVIEW_2025_03_11
GPT_5_CODEX -> Known.GPT_5_CODEX
GPT_5_PRO -> Known.GPT_5_PRO
GPT_5_PRO_2025_10_06 -> Known.GPT_5_PRO_2025_10_06
else -> throw OpenAIInvalidDataException("Unknown ResponsesOnlyModel: $value")
}

Expand Down
Loading
Loading