Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d44f466
docs: clarify forwards compat behavior
stainless-app[bot] May 4, 2026
5a1bfdc
feat(client): more robust error parsing
stainless-app[bot] May 4, 2026
fc57ef7
fix(client): match `JsonSchemaValidator` heading levels to API (#733)
sweidac May 4, 2026
82a8527
chore: fix build error
TomerAberbach May 4, 2026
0c9aff0
codegen metadata
stainless-app[bot] May 4, 2026
b5dbd07
docs: remove bad semicolon (#725)
Abdullah8006 May 4, 2026
e1e1161
docs: clarify structured output map limitations (#726)
Rohan5commit May 4, 2026
157207f
fix(logging): redact Azure api-key header in logging (#717)
vincerevu May 4, 2026
06e43e2
chore: remove duplicated dokka setup
stainless-app[bot] May 4, 2026
f35ad61
codegen metadata
stainless-app[bot] May 4, 2026
021f44a
chore(tests): update test fixtures to use valid example URLs
stainless-app[bot] May 4, 2026
6bdc12e
perf(client): create one json mapper
stainless-app[bot] May 4, 2026
45b7c6a
codegen metadata
stainless-app[bot] May 5, 2026
18fe08a
docs(api): document web_search_call.results in response includables
stainless-app[bot] May 5, 2026
28ad918
feat(api): launch realtime translate + update image 2
stainless-app[bot] May 5, 2026
8328a1e
feat(api): manual updates
stainless-app[bot] May 5, 2026
97c8087
feat(client): support proxy authentication
stainless-app[bot] May 5, 2026
d4686cc
feat(api): add quantity field to organization usage responses, update…
stainless-app[bot] May 6, 2026
6393b34
feat(client): improve logging
stainless-app[bot] May 6, 2026
2ec821b
codegen metadata
stainless-app[bot] May 6, 2026
aacb886
fix(api): fix imagegen `size` enum regression
stainless-app[bot] May 6, 2026
28ea493
codegen metadata
stainless-app[bot] May 6, 2026
1c69e67
codegen metadata
stainless-app[bot] May 6, 2026
12b6ff4
codegen metadata
stainless-app[bot] May 6, 2026
73d01b0
chore: redact api-key headers in debug logs
stainless-app[bot] May 7, 2026
7905ef6
feat(api): manual updates
stainless-app[bot] May 7, 2026
190695e
release: 4.35.0
stainless-app[bot] May 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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.34.0"
".": "4.35.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: 232
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-21ecab7aeb61612b9da5e52ea4c0cb75a33d443d975022934b9305e97d1a7d62.yml
openapi_spec_hash: cfc868a0bb3567183510c9b5629c510f
config_hash: dd484e2cc01206d26516338d0f4596b0
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-08cb8ed18dfe4a9fa518e278576d3cfe5710cb5c22789cf80826c900569bcf56.yml
openapi_spec_hash: 20f820c94f54741b75d719f6a7371c12
config_hash: f291a449469edfe61a28424e548899b2
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Changelog

## 4.35.0 (2026-05-07)

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

### Features

* **api:** add quantity field to organization usage responses, update topLogprobs docs ([d4686cc](https://github.com/openai/openai-java/commit/d4686cc7eb9bcd551282d421811341518ddc8584))
* **api:** launch realtime translate + update image 2 ([28ad918](https://github.com/openai/openai-java/commit/28ad9189d7293388d043ed83496333132afc517f))
* **api:** manual updates ([7905ef6](https://github.com/openai/openai-java/commit/7905ef6cc30852f0d80bd10c937d949028ff1303))
* **api:** manual updates ([8328a1e](https://github.com/openai/openai-java/commit/8328a1eb51291dd0a317989e31e0989572bbfa0b))
* **client:** improve logging ([6393b34](https://github.com/openai/openai-java/commit/6393b3431e87d15ad3ee23cc274161f8e00a87ec))
* **client:** more robust error parsing ([5a1bfdc](https://github.com/openai/openai-java/commit/5a1bfdcb283dc6efc1ab5058ef96740087112288))
* **client:** support proxy authentication ([97c8087](https://github.com/openai/openai-java/commit/97c808706c3684892d309245a205fcfcf90738cd))


### Bug Fixes

* **api:** fix imagegen `size` enum regression ([aacb886](https://github.com/openai/openai-java/commit/aacb886fd99a7571dabe5bc8f1086bef650c11fc))
* **client:** match `JsonSchemaValidator` heading levels to API ([#733](https://github.com/openai/openai-java/issues/733)) ([fc57ef7](https://github.com/openai/openai-java/commit/fc57ef7963e6ebdfde0c716adc4f29d315dc9021))
* **logging:** redact Azure api-key header in logging ([#717](https://github.com/openai/openai-java/issues/717)) ([157207f](https://github.com/openai/openai-java/commit/157207fefe59174141a5aec6a983c546def242b4))


### Performance Improvements

* **client:** create one json mapper ([6bdc12e](https://github.com/openai/openai-java/commit/6bdc12ed832827d3e9bdb9825898bfa5aee94d26))


### Chores

* fix build error ([82a8527](https://github.com/openai/openai-java/commit/82a85274f613aad7ae277765b12bc3469832e1b1))
* redact api-key headers in debug logs ([73d01b0](https://github.com/openai/openai-java/commit/73d01b0a5a9af1e4722381701654ff5880ff8986))
* remove duplicated dokka setup ([06e43e2](https://github.com/openai/openai-java/commit/06e43e2ca1a630dd8b4d38b151724d6b3fb5e014))
* **tests:** update test fixtures to use valid example URLs ([021f44a](https://github.com/openai/openai-java/commit/021f44a12a39f7e1b8e405e4f309f1a4d0223ed6))


### Documentation

* **api:** document web_search_call.results in response includables ([18fe08a](https://github.com/openai/openai-java/commit/18fe08af6a53d6ef9b35e03190e137b02231608e))
* clarify forwards compat behavior ([d44f466](https://github.com/openai/openai-java/commit/d44f4664a550f4d34b2d1b14c7f376d1047514e0))
* clarify structured output map limitations ([#726](https://github.com/openai/openai-java/issues/726)) ([e1e1161](https://github.com/openai/openai-java/commit/e1e1161d69d30bd6639ada5ead3a30f14c68cf8d))
* remove bad semicolon ([#725](https://github.com/openai/openai-java/issues/725)) ([b5dbd07](https://github.com/openai/openai-java/commit/b5dbd07e1147f5554509481798978717e22b03af))

## 4.34.0 (2026-05-01)

Full Changelog: [v4.33.0...v4.34.0](https://github.com/openai/openai-java/compare/v4.33.0...v4.34.0)
Expand Down
52 changes: 41 additions & 11 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.34.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.34.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.34.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/4.35.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.35.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.35.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.34.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.35.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.34.0")
implementation("com.openai:openai-java:4.35.0")
```

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

Expand Down Expand Up @@ -349,7 +349,7 @@ client.async().chat().completions().createStreaming(params)
.subscribe(chunk -> {
System.out.println(chunk);
})
.onCompleteFuture();
.onCompleteFuture()
.whenComplete((unused, error) -> {
if (error != null) {
System.out.println("Something went wrong!");
Expand Down Expand Up @@ -711,6 +711,8 @@ properties can be derived. This may occur if, for example:
- All fields and getter methods are non-`public`, but none are annotated with `@JsonProperty`.
- A field or getter method is declared with a `Map` type. A `Map` is treated like a separate class
with no named properties, so it will result in an empty `"properties"` field in the JSON schema.
If you need arbitrary key/value data, model it as a list of entry objects with named fields so the
generated schema still has concrete property names.

### Annotating classes and JSON schemas

Expand Down Expand Up @@ -1384,8 +1386,6 @@ while (true) {

## Logging

The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).

Enable logging by setting the `OPENAI_LOG` environment variable to `info`:

```sh
Expand All @@ -1398,6 +1398,19 @@ Or to `debug` for more verbose logging:
export OPENAI_LOG=debug
```

Or configure the client manually using the `logLevel` method:

```java
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.LogLevel;

OpenAIClient client = OpenAIOkHttpClient.builder()
.fromEnv()
.logLevel(LogLevel.INFO)
.build();
```

## ProGuard and R8

Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `openai-java-core` is published with a [configuration file](openai-java-core/src/main/resources/META-INF/proguard/openai-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).
Expand All @@ -1421,7 +1434,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.34.0")
implementation("com.openai:openai-java-spring-boot-starter:4.35.0")
```

#### Maven
Expand All @@ -1430,7 +1443,7 @@ implementation("com.openai:openai-java-spring-boot-starter:4.34.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java-spring-boot-starter</artifactId>
<version>4.34.0</version>
<version>4.35.0</version>
</dependency>
```

Expand Down Expand Up @@ -1597,6 +1610,21 @@ OpenAIClient client = OpenAIOkHttpClient.builder()
.build();
```

If the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:

```java
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.http.ProxyAuthenticator;

OpenAIClient client = OpenAIOkHttpClient.builder()
.fromEnv()
.proxy(...)
// Or a custom implementation of `ProxyAuthenticator`.
.proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))
.build();
```

### Connection pooling

To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:
Expand Down Expand Up @@ -1837,7 +1865,9 @@ In rare cases, the API may return a response that doesn't match the expected typ

By default, the SDK will not throw an exception in this case. It will throw [`OpenAIInvalidDataException`](openai-java-core/src/main/kotlin/com/openai/errors/OpenAIInvalidDataException.kt) only if you directly access the property.

If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:
Validating the response is _not_ forwards compatible with new types from the API for existing fields.

If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:

```java
import com.openai.models.chat.completions.ChatCompletion;
Expand Down
3 changes: 1 addition & 2 deletions 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.34.0" // x-release-please-version
version = "4.35.0" // x-release-please-version
}

subprojects {
Expand All @@ -21,7 +21,6 @@ subprojects {
group = "Verification"
description = "Verifies all source files are formatted."
}
apply(plugin = "org.jetbrains.dokka")
}

subprojects {
Expand Down
1 change: 0 additions & 1 deletion openai-java-client-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ dependencies {
api(project(":openai-java-core"))

implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")

testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.27.7")
Expand Down
Loading
Loading