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.40.0"
".": "4.41.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: 263
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-4db8edc05bd5503d4aaad74e8b9c783aa1f4d40382a8075c53355bd18dfaf68c.yml
openapi_spec_hash: 2466f6ad496b27334217999202e185c0
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-b5b621065906a2579dc180db1236ee3b08a4fca9539accc2fbbf88da0ca3923f.yml
openapi_spec_hash: 45b1b4692b26e714008d8120ccfc7433
config_hash: ef3ce17315a31703e7af0567b3e9738c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.41.0 (2026-06-17)

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

### Features

* **api:** update OpenAPI spec or Stainless config ([ce1d334](https://github.com/openai/openai-java/commit/ce1d334a2856395d95491db52a26c15472598896))

## 4.40.0 (2026-06-16)

Full Changelog: [v4.39.1...v4.40.0](https://github.com/openai/openai-java/compare/v4.39.1...v4.40.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.40.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.40.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.40.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/4.41.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.41.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.41.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.40.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.41.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.40.0")
implementation("com.openai:openai-java:4.41.0")
```

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

Expand Down Expand Up @@ -1433,7 +1433,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.40.0")
implementation("com.openai:openai-java-spring-boot-starter:4.41.0")
```

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

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private constructor(
private val requireApproval: JsonField<RequireApproval>,
private val serverDescription: JsonField<String>,
private val serverUrl: JsonField<String>,
private val tunnelId: JsonField<String>,
private val additionalProperties: MutableMap<String, JsonValue>,
) {

Expand Down Expand Up @@ -77,6 +78,7 @@ private constructor(
@ExcludeMissing
serverDescription: JsonField<String> = JsonMissing.of(),
@JsonProperty("server_url") @ExcludeMissing serverUrl: JsonField<String> = JsonMissing.of(),
@JsonProperty("tunnel_id") @ExcludeMissing tunnelId: JsonField<String> = JsonMissing.of(),
) : this(
serverLabel,
type,
Expand All @@ -88,6 +90,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
tunnelId,
mutableMapOf(),
)

Expand Down Expand Up @@ -131,8 +134,8 @@ private constructor(
fun authorization(): Optional<String> = authorization.getOptional("authorization")

/**
* Identifier for service connectors, like those available in ChatGPT. One of `server_url` or
* `connector_id` must be provided. Learn more about service connectors
* Identifier for service connectors, like those available in ChatGPT. One of `server_url`,
* `connector_id`, or `tunnel_id` must be provided. Learn more about service connectors
* [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
*
* Currently supported `connector_id` values are:
Expand Down Expand Up @@ -184,13 +187,23 @@ private constructor(
fun serverDescription(): Optional<String> = serverDescription.getOptional("server_description")

/**
* The URL for the MCP server. One of `server_url` or `connector_id` must be provided.
* The URL for the MCP server. One of `server_url`, `connector_id`, or `tunnel_id` must be
* provided.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun serverUrl(): Optional<String> = serverUrl.getOptional("server_url")

/**
* The Secure MCP Tunnel ID to use instead of a direct server URL. One of `server_url`,
* `connector_id`, or `tunnel_id` must be provided.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun tunnelId(): Optional<String> = tunnelId.getOptional("tunnel_id")

/**
* Returns the raw JSON value of [serverLabel].
*
Expand Down Expand Up @@ -269,6 +282,13 @@ private constructor(
*/
@JsonProperty("server_url") @ExcludeMissing fun _serverUrl(): JsonField<String> = serverUrl

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

@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
Expand Down Expand Up @@ -308,6 +328,7 @@ private constructor(
private var requireApproval: JsonField<RequireApproval> = JsonMissing.of()
private var serverDescription: JsonField<String> = JsonMissing.of()
private var serverUrl: JsonField<String> = JsonMissing.of()
private var tunnelId: JsonField<String> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
Expand All @@ -322,6 +343,7 @@ private constructor(
requireApproval = realtimeResponseCreateMcpTool.requireApproval
serverDescription = realtimeResponseCreateMcpTool.serverDescription
serverUrl = realtimeResponseCreateMcpTool.serverUrl
tunnelId = realtimeResponseCreateMcpTool.tunnelId
additionalProperties = realtimeResponseCreateMcpTool.additionalProperties.toMutableMap()
}

Expand Down Expand Up @@ -396,8 +418,8 @@ private constructor(
}

/**
* Identifier for service connectors, like those available in ChatGPT. One of `server_url`
* or `connector_id` must be provided. Learn more about service connectors
* Identifier for service connectors, like those available in ChatGPT. One of `server_url`,
* `connector_id`, or `tunnel_id` must be provided. Learn more about service connectors
* [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
*
* Currently supported `connector_id` values are:
Expand Down Expand Up @@ -502,7 +524,10 @@ private constructor(
this.serverDescription = serverDescription
}

/** The URL for the MCP server. One of `server_url` or `connector_id` must be provided. */
/**
* The URL for the MCP server. One of `server_url`, `connector_id`, or `tunnel_id` must be
* provided.
*/
fun serverUrl(serverUrl: String) = serverUrl(JsonField.of(serverUrl))

/**
Expand All @@ -514,6 +539,20 @@ private constructor(
*/
fun serverUrl(serverUrl: JsonField<String>) = apply { this.serverUrl = serverUrl }

/**
* The Secure MCP Tunnel ID to use instead of a direct server URL. One of `server_url`,
* `connector_id`, or `tunnel_id` must be provided.
*/
fun tunnelId(tunnelId: String) = tunnelId(JsonField.of(tunnelId))

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

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
Expand Down Expand Up @@ -557,6 +596,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
tunnelId,
additionalProperties.toMutableMap(),
)
}
Expand Down Expand Up @@ -590,6 +630,7 @@ private constructor(
requireApproval().ifPresent { it.validate() }
serverDescription()
serverUrl()
tunnelId()
validated = true
}

Expand Down Expand Up @@ -617,7 +658,8 @@ private constructor(
(headers.asKnown().getOrNull()?.validity() ?: 0) +
(requireApproval.asKnown().getOrNull()?.validity() ?: 0) +
(if (serverDescription.asKnown().isPresent) 1 else 0) +
(if (serverUrl.asKnown().isPresent) 1 else 0)
(if (serverUrl.asKnown().isPresent) 1 else 0) +
(if (tunnelId.asKnown().isPresent) 1 else 0)

/** List of allowed tool names or a filter object. */
@JsonDeserialize(using = AllowedTools.Deserializer::class)
Expand Down Expand Up @@ -1071,8 +1113,8 @@ private constructor(
}

/**
* Identifier for service connectors, like those available in ChatGPT. One of `server_url` or
* `connector_id` must be provided. Learn more about service connectors
* Identifier for service connectors, like those available in ChatGPT. One of `server_url`,
* `connector_id`, or `tunnel_id` must be provided. Learn more about service connectors
* [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
*
* Currently supported `connector_id` values are:
Expand Down Expand Up @@ -2468,6 +2510,7 @@ private constructor(
requireApproval == other.requireApproval &&
serverDescription == other.serverDescription &&
serverUrl == other.serverUrl &&
tunnelId == other.tunnelId &&
additionalProperties == other.additionalProperties
}

Expand All @@ -2483,12 +2526,13 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
tunnelId,
additionalProperties,
)
}

override fun hashCode(): Int = hashCode

override fun toString() =
"RealtimeResponseCreateMcpTool{serverLabel=$serverLabel, type=$type, allowedTools=$allowedTools, authorization=$authorization, connectorId=$connectorId, deferLoading=$deferLoading, headers=$headers, requireApproval=$requireApproval, serverDescription=$serverDescription, serverUrl=$serverUrl, additionalProperties=$additionalProperties}"
"RealtimeResponseCreateMcpTool{serverLabel=$serverLabel, type=$type, allowedTools=$allowedTools, authorization=$authorization, connectorId=$connectorId, deferLoading=$deferLoading, headers=$headers, requireApproval=$requireApproval, serverDescription=$serverDescription, serverUrl=$serverUrl, tunnelId=$tunnelId, additionalProperties=$additionalProperties}"
}
Loading
Loading