diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index a92bd0cac..807cc3abe 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.40.0"
+ ".": "4.41.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index ceecd31fa..fe88e03e3 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -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
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed847f582..3b43c539f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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)
diff --git a/README.md b/README.md
index d54a09e10..3fc418846 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.openai/openai-java/4.40.0)
-[](https://javadoc.io/doc/com.openai/openai-java/4.40.0)
+[](https://central.sonatype.com/artifact/com.openai/openai-java/4.41.0)
+[](https://javadoc.io/doc/com.openai/openai-java/4.41.0)
@@ -11,7 +11,7 @@ The OpenAI Java SDK provides convenient access to the [OpenAI REST API](https://
-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).
@@ -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
@@ -33,7 +33,7 @@ implementation("com.openai:openai-java:4.40.0")
com.openai
openai-java
- 4.40.0
+ 4.41.0
```
@@ -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
@@ -1442,7 +1442,7 @@ implementation("com.openai:openai-java-spring-boot-starter:4.40.0")
com.openai
openai-java-spring-boot-starter
- 4.40.0
+ 4.41.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index eb92da758..0a533a3ee 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -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 {
diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpTool.kt
index 34a6fad2a..3006f1578 100644
--- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpTool.kt
+++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpTool.kt
@@ -48,6 +48,7 @@ private constructor(
private val requireApproval: JsonField,
private val serverDescription: JsonField,
private val serverUrl: JsonField,
+ private val tunnelId: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -77,6 +78,7 @@ private constructor(
@ExcludeMissing
serverDescription: JsonField = JsonMissing.of(),
@JsonProperty("server_url") @ExcludeMissing serverUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("tunnel_id") @ExcludeMissing tunnelId: JsonField = JsonMissing.of(),
) : this(
serverLabel,
type,
@@ -88,6 +90,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
mutableMapOf(),
)
@@ -131,8 +134,8 @@ private constructor(
fun authorization(): Optional = 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:
@@ -184,13 +187,23 @@ private constructor(
fun serverDescription(): Optional = 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 = 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 = tunnelId.getOptional("tunnel_id")
+
/**
* Returns the raw JSON value of [serverLabel].
*
@@ -269,6 +282,13 @@ private constructor(
*/
@JsonProperty("server_url") @ExcludeMissing fun _serverUrl(): JsonField = 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 = tunnelId
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -308,6 +328,7 @@ private constructor(
private var requireApproval: JsonField = JsonMissing.of()
private var serverDescription: JsonField = JsonMissing.of()
private var serverUrl: JsonField = JsonMissing.of()
+ private var tunnelId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -322,6 +343,7 @@ private constructor(
requireApproval = realtimeResponseCreateMcpTool.requireApproval
serverDescription = realtimeResponseCreateMcpTool.serverDescription
serverUrl = realtimeResponseCreateMcpTool.serverUrl
+ tunnelId = realtimeResponseCreateMcpTool.tunnelId
additionalProperties = realtimeResponseCreateMcpTool.additionalProperties.toMutableMap()
}
@@ -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:
@@ -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))
/**
@@ -514,6 +539,20 @@ private constructor(
*/
fun serverUrl(serverUrl: JsonField) = 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) = apply { this.tunnelId = tunnelId }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -557,6 +596,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
additionalProperties.toMutableMap(),
)
}
@@ -590,6 +630,7 @@ private constructor(
requireApproval().ifPresent { it.validate() }
serverDescription()
serverUrl()
+ tunnelId()
validated = true
}
@@ -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)
@@ -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:
@@ -2468,6 +2510,7 @@ private constructor(
requireApproval == other.requireApproval &&
serverDescription == other.serverDescription &&
serverUrl == other.serverUrl &&
+ tunnelId == other.tunnelId &&
additionalProperties == other.additionalProperties
}
@@ -2483,6 +2526,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
additionalProperties,
)
}
@@ -2490,5 +2534,5 @@ private constructor(
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}"
}
diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnion.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnion.kt
index 7180d1535..3f80bb45c 100644
--- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnion.kt
+++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnion.kt
@@ -276,6 +276,7 @@ private constructor(
private val requireApproval: JsonField,
private val serverDescription: JsonField,
private val serverUrl: JsonField,
+ private val tunnelId: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -307,6 +308,9 @@ private constructor(
@JsonProperty("server_url")
@ExcludeMissing
serverUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("tunnel_id")
+ @ExcludeMissing
+ tunnelId: JsonField = JsonMissing.of(),
) : this(
serverLabel,
type,
@@ -318,6 +322,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
mutableMapOf(),
)
@@ -361,8 +366,8 @@ private constructor(
fun authorization(): Optional = 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:
@@ -416,13 +421,23 @@ private constructor(
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 = 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 = tunnelId.getOptional("tunnel_id")
+
/**
* Returns the raw JSON value of [serverLabel].
*
@@ -505,6 +520,13 @@ private constructor(
*/
@JsonProperty("server_url") @ExcludeMissing fun _serverUrl(): JsonField = 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 = tunnelId
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -543,6 +565,7 @@ private constructor(
private var requireApproval: JsonField = JsonMissing.of()
private var serverDescription: JsonField = JsonMissing.of()
private var serverUrl: JsonField = JsonMissing.of()
+ private var tunnelId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -557,6 +580,7 @@ private constructor(
requireApproval = mcp.requireApproval
serverDescription = mcp.serverDescription
serverUrl = mcp.serverUrl
+ tunnelId = mcp.tunnelId
additionalProperties = mcp.additionalProperties.toMutableMap()
}
@@ -636,7 +660,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
+ * `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:
@@ -743,7 +768,8 @@ private constructor(
}
/**
- * 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))
@@ -756,6 +782,21 @@ private constructor(
*/
fun serverUrl(serverUrl: JsonField) = 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) = apply { this.tunnelId = tunnelId }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -799,6 +840,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
additionalProperties.toMutableMap(),
)
}
@@ -833,6 +875,7 @@ private constructor(
requireApproval().ifPresent { it.validate() }
serverDescription()
serverUrl()
+ tunnelId()
validated = true
}
@@ -861,7 +904,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)
@@ -1322,8 +1366,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:
@@ -2750,6 +2794,7 @@ private constructor(
requireApproval == other.requireApproval &&
serverDescription == other.serverDescription &&
serverUrl == other.serverUrl &&
+ tunnelId == other.tunnelId &&
additionalProperties == other.additionalProperties
}
@@ -2765,6 +2810,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
additionalProperties,
)
}
@@ -2772,6 +2818,6 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Mcp{serverLabel=$serverLabel, type=$type, allowedTools=$allowedTools, authorization=$authorization, connectorId=$connectorId, deferLoading=$deferLoading, headers=$headers, requireApproval=$requireApproval, serverDescription=$serverDescription, serverUrl=$serverUrl, additionalProperties=$additionalProperties}"
+ "Mcp{serverLabel=$serverLabel, type=$type, allowedTools=$allowedTools, authorization=$authorization, connectorId=$connectorId, deferLoading=$deferLoading, headers=$headers, requireApproval=$requireApproval, serverDescription=$serverDescription, serverUrl=$serverUrl, tunnelId=$tunnelId, additionalProperties=$additionalProperties}"
}
}
diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/RealtimeSessionCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/RealtimeSessionCreateResponse.kt
index 9af03c912..34b2484cb 100644
--- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/RealtimeSessionCreateResponse.kt
+++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/RealtimeSessionCreateResponse.kt
@@ -4719,6 +4719,7 @@ private constructor(
private val requireApproval: JsonField,
private val serverDescription: JsonField,
private val serverUrl: JsonField,
+ private val tunnelId: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -4752,6 +4753,9 @@ private constructor(
@JsonProperty("server_url")
@ExcludeMissing
serverUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("tunnel_id")
+ @ExcludeMissing
+ tunnelId: JsonField = JsonMissing.of(),
) : this(
serverLabel,
type,
@@ -4763,6 +4767,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
mutableMapOf(),
)
@@ -4808,7 +4813,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
+ * `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:
@@ -4862,13 +4868,23 @@ private constructor(
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 = 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 = tunnelId.getOptional("tunnel_id")
+
/**
* Returns the raw JSON value of [serverLabel].
*
@@ -4956,6 +4972,14 @@ private constructor(
@ExcludeMissing
fun _serverUrl(): JsonField = 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 = tunnelId
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -4994,6 +5018,7 @@ private constructor(
private var requireApproval: JsonField = JsonMissing.of()
private var serverDescription: JsonField = JsonMissing.of()
private var serverUrl: JsonField = JsonMissing.of()
+ private var tunnelId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -5008,6 +5033,7 @@ private constructor(
requireApproval = mcpTool.requireApproval
serverDescription = mcpTool.serverDescription
serverUrl = mcpTool.serverUrl
+ tunnelId = mcpTool.tunnelId
additionalProperties = mcpTool.additionalProperties.toMutableMap()
}
@@ -5089,8 +5115,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
+ * `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:
@@ -5203,8 +5229,8 @@ private constructor(
}
/**
- * 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))
@@ -5217,6 +5243,21 @@ private constructor(
*/
fun serverUrl(serverUrl: JsonField) = 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) = apply { this.tunnelId = tunnelId }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -5263,6 +5304,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
additionalProperties.toMutableMap(),
)
}
@@ -5298,6 +5340,7 @@ private constructor(
requireApproval().ifPresent { it.validate() }
serverDescription()
serverUrl()
+ tunnelId()
validated = true
}
@@ -5326,7 +5369,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)
@@ -5795,7 +5839,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
+ * `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:
@@ -7256,6 +7301,7 @@ private constructor(
requireApproval == other.requireApproval &&
serverDescription == other.serverDescription &&
serverUrl == other.serverUrl &&
+ tunnelId == other.tunnelId &&
additionalProperties == other.additionalProperties
}
@@ -7271,6 +7317,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
additionalProperties,
)
}
@@ -7278,7 +7325,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "McpTool{serverLabel=$serverLabel, type=$type, allowedTools=$allowedTools, authorization=$authorization, connectorId=$connectorId, deferLoading=$deferLoading, headers=$headers, requireApproval=$requireApproval, serverDescription=$serverDescription, serverUrl=$serverUrl, additionalProperties=$additionalProperties}"
+ "McpTool{serverLabel=$serverLabel, type=$type, allowedTools=$allowedTools, authorization=$authorization, connectorId=$connectorId, deferLoading=$deferLoading, headers=$headers, requireApproval=$requireApproval, serverDescription=$serverDescription, serverUrl=$serverUrl, tunnelId=$tunnelId, additionalProperties=$additionalProperties}"
}
}
diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/Tool.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/Tool.kt
index 266d951fc..d69809bdf 100644
--- a/openai-java-core/src/main/kotlin/com/openai/models/responses/Tool.kt
+++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/Tool.kt
@@ -796,6 +796,7 @@ private constructor(
private val requireApproval: JsonField,
private val serverDescription: JsonField,
private val serverUrl: JsonField,
+ private val tunnelId: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -827,6 +828,9 @@ private constructor(
@JsonProperty("server_url")
@ExcludeMissing
serverUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("tunnel_id")
+ @ExcludeMissing
+ tunnelId: JsonField = JsonMissing.of(),
) : this(
serverLabel,
type,
@@ -838,6 +842,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
mutableMapOf(),
)
@@ -881,8 +886,8 @@ private constructor(
fun authorization(): Optional = 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:
@@ -936,13 +941,23 @@ private constructor(
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 = 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 = tunnelId.getOptional("tunnel_id")
+
/**
* Returns the raw JSON value of [serverLabel].
*
@@ -1025,6 +1040,13 @@ private constructor(
*/
@JsonProperty("server_url") @ExcludeMissing fun _serverUrl(): JsonField = 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 = tunnelId
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -1063,6 +1085,7 @@ private constructor(
private var requireApproval: JsonField = JsonMissing.of()
private var serverDescription: JsonField = JsonMissing.of()
private var serverUrl: JsonField = JsonMissing.of()
+ private var tunnelId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -1077,6 +1100,7 @@ private constructor(
requireApproval = mcp.requireApproval
serverDescription = mcp.serverDescription
serverUrl = mcp.serverUrl
+ tunnelId = mcp.tunnelId
additionalProperties = mcp.additionalProperties.toMutableMap()
}
@@ -1156,7 +1180,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
+ * `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:
@@ -1263,7 +1288,8 @@ private constructor(
}
/**
- * 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))
@@ -1276,6 +1302,21 @@ private constructor(
*/
fun serverUrl(serverUrl: JsonField) = 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) = apply { this.tunnelId = tunnelId }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -1319,6 +1360,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
additionalProperties.toMutableMap(),
)
}
@@ -1353,6 +1395,7 @@ private constructor(
requireApproval().ifPresent { it.validate() }
serverDescription()
serverUrl()
+ tunnelId()
validated = true
}
@@ -1381,7 +1424,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)
@@ -1842,8 +1886,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:
@@ -3270,6 +3314,7 @@ private constructor(
requireApproval == other.requireApproval &&
serverDescription == other.serverDescription &&
serverUrl == other.serverUrl &&
+ tunnelId == other.tunnelId &&
additionalProperties == other.additionalProperties
}
@@ -3285,6 +3330,7 @@ private constructor(
requireApproval,
serverDescription,
serverUrl,
+ tunnelId,
additionalProperties,
)
}
@@ -3292,7 +3338,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Mcp{serverLabel=$serverLabel, type=$type, allowedTools=$allowedTools, authorization=$authorization, connectorId=$connectorId, deferLoading=$deferLoading, headers=$headers, requireApproval=$requireApproval, serverDescription=$serverDescription, serverUrl=$serverUrl, additionalProperties=$additionalProperties}"
+ "Mcp{serverLabel=$serverLabel, type=$type, allowedTools=$allowedTools, authorization=$authorization, connectorId=$connectorId, deferLoading=$deferLoading, headers=$headers, requireApproval=$requireApproval, serverDescription=$serverDescription, serverUrl=$serverUrl, tunnelId=$tunnelId, additionalProperties=$additionalProperties}"
}
/** A tool that runs Python code to help generate a response to a prompt. */
diff --git a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateParams.kt
index 67f37c054..f9f43fa3b 100644
--- a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateParams.kt
+++ b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateParams.kt
@@ -764,6 +764,10 @@ private constructor(
/** Optional reference asset upload or reference object that guides generation. */
fun stream(): Optional = Optional.ofNullable(stream)
+ /**
+ * Optional reference asset upload or reference object that guides generation. Provide
+ * exactly one of `image_url` or `file_id` when using an object.
+ */
fun imageInputReferenceParam(): Optional =
Optional.ofNullable(imageInputReferenceParam)
@@ -774,6 +778,10 @@ private constructor(
/** Optional reference asset upload or reference object that guides generation. */
fun asStream(): InputStream = stream.getOrThrow("stream")
+ /**
+ * Optional reference asset upload or reference object that guides generation. Provide
+ * exactly one of `image_url` or `file_id` when using an object.
+ */
fun asImageInputReferenceParam(): ImageInputReferenceParam =
imageInputReferenceParam.getOrThrow("imageInputReferenceParam")
@@ -880,6 +888,10 @@ private constructor(
/** Optional reference asset upload or reference object that guides generation. */
@JvmStatic fun ofStream(stream: InputStream) = InputReference(stream = stream)
+ /**
+ * Optional reference asset upload or reference object that guides generation. Provide
+ * exactly one of `image_url` or `file_id` when using an object.
+ */
@JvmStatic
fun ofImageInputReferenceParam(imageInputReferenceParam: ImageInputReferenceParam) =
InputReference(imageInputReferenceParam = imageInputReferenceParam)
@@ -894,6 +906,10 @@ private constructor(
/** Optional reference asset upload or reference object that guides generation. */
fun visitStream(stream: InputStream): T
+ /**
+ * Optional reference asset upload or reference object that guides generation. Provide
+ * exactly one of `image_url` or `file_id` when using an object.
+ */
fun visitImageInputReferenceParam(imageInputReferenceParam: ImageInputReferenceParam): T
/**
diff --git a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoEditParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoEditParams.kt
index 3e3f5f637..e04ecd653 100644
--- a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoEditParams.kt
+++ b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoEditParams.kt
@@ -522,7 +522,7 @@ private constructor(
/** Reference to the completed video to edit. */
fun inputStream(): Optional = Optional.ofNullable(inputStream)
- /** Reference to the completed video. */
+ /** Reference to the completed video to edit. */
fun referenceInputParam(): Optional =
Optional.ofNullable(referenceInputParam)
@@ -533,7 +533,7 @@ private constructor(
/** Reference to the completed video to edit. */
fun asInputStream(): InputStream = inputStream.getOrThrow("inputStream")
- /** Reference to the completed video. */
+ /** Reference to the completed video to edit. */
fun asReferenceInputParam(): VideoReferenceInputParam =
referenceInputParam.getOrThrow("referenceInputParam")
@@ -639,7 +639,7 @@ private constructor(
@JvmStatic
fun ofInputStream(inputStream: InputStream) = Video(inputStream = inputStream)
- /** Reference to the completed video. */
+ /** Reference to the completed video to edit. */
@JvmStatic
fun ofReferenceInputParam(referenceInputParam: VideoReferenceInputParam) =
Video(referenceInputParam = referenceInputParam)
@@ -651,7 +651,7 @@ private constructor(
/** Reference to the completed video to edit. */
fun visitInputStream(inputStream: InputStream): T
- /** Reference to the completed video. */
+ /** Reference to the completed video to edit. */
fun visitReferenceInputParam(referenceInputParam: VideoReferenceInputParam): T
/**
@@ -686,7 +686,7 @@ private constructor(
}
}
- /** Reference to the completed video. */
+ /** Reference to the completed video to edit. */
class VideoReferenceInputParam
private constructor(
private val id: MultipartField,
diff --git a/openai-java-core/src/test/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpToolTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpToolTest.kt
index b702e9710..66cac84c2 100644
--- a/openai-java-core/src/test/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpToolTest.kt
+++ b/openai-java-core/src/test/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpToolTest.kt
@@ -29,6 +29,7 @@ internal class RealtimeResponseCreateMcpToolTest {
)
.serverDescription("server_description")
.serverUrl("https://example.com")
+ .tunnelId("tunnel_210b9798ad53ecc4y69z31e1071cx03v")
.build()
assertThat(realtimeResponseCreateMcpTool.serverLabel()).isEqualTo("server_label")
@@ -52,6 +53,8 @@ internal class RealtimeResponseCreateMcpToolTest {
)
assertThat(realtimeResponseCreateMcpTool.serverDescription()).contains("server_description")
assertThat(realtimeResponseCreateMcpTool.serverUrl()).contains("https://example.com")
+ assertThat(realtimeResponseCreateMcpTool.tunnelId())
+ .contains("tunnel_210b9798ad53ecc4y69z31e1071cx03v")
}
@Test
@@ -74,6 +77,7 @@ internal class RealtimeResponseCreateMcpToolTest {
)
.serverDescription("server_description")
.serverUrl("https://example.com")
+ .tunnelId("tunnel_210b9798ad53ecc4y69z31e1071cx03v")
.build()
val roundtrippedRealtimeResponseCreateMcpTool =
diff --git a/openai-java-core/src/test/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnionTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnionTest.kt
index eb9dd0297..fc3308a4e 100644
--- a/openai-java-core/src/test/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnionTest.kt
+++ b/openai-java-core/src/test/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnionTest.kt
@@ -71,6 +71,7 @@ internal class RealtimeToolsConfigUnionTest {
)
.serverDescription("server_description")
.serverUrl("https://example.com")
+ .tunnelId("tunnel_210b9798ad53ecc4y69z31e1071cx03v")
.build()
val realtimeToolsConfigUnion = RealtimeToolsConfigUnion.ofMcp(mcp)
@@ -100,6 +101,7 @@ internal class RealtimeToolsConfigUnionTest {
)
.serverDescription("server_description")
.serverUrl("https://example.com")
+ .tunnelId("tunnel_210b9798ad53ecc4y69z31e1071cx03v")
.build()
)
diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ToolTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ToolTest.kt
index 2c6d83bcf..d75330f22 100644
--- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ToolTest.kt
+++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ToolTest.kt
@@ -316,6 +316,7 @@ internal class ToolTest {
.requireApproval(Tool.Mcp.RequireApproval.McpToolApprovalSetting.ALWAYS)
.serverDescription("server_description")
.serverUrl("https://example.com")
+ .tunnelId("tunnel_210b9798ad53ecc4y69z31e1071cx03v")
.build()
val tool = Tool.ofMcp(mcp)
@@ -356,6 +357,7 @@ internal class ToolTest {
.requireApproval(Tool.Mcp.RequireApproval.McpToolApprovalSetting.ALWAYS)
.serverDescription("server_description")
.serverUrl("https://example.com")
+ .tunnelId("tunnel_210b9798ad53ecc4y69z31e1071cx03v")
.build()
)