diff --git a/README.md b/README.md
index d2f28da..6bb978a 100644
--- a/README.md
+++ b/README.md
@@ -10,14 +10,14 @@ The official Java library for accessing ModelArk on Volcengine and BytePlus. It
com.volcengine
ark-runtime
- 0.5.0
+ 0.6.0
```
### Gradle
```groovy
-implementation 'com.volcengine:ark-runtime:0.5.0'
+implementation 'com.volcengine:ark-runtime:0.6.0'
```
## Choose Volcengine or BytePlus
diff --git a/VERSION b/VERSION
index 8f0916f..a918a2a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.5.0
+0.6.0
diff --git a/pom.xml b/pom.xml
index 9530796..c0f8c8a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.volcengine
ark-runtime
- 0.5.0
+ 0.6.0
jar
ark-runtime
diff --git a/src/main/java/com/volcengine/ark/runtime/models/images/Background.java b/src/main/java/com/volcengine/ark/runtime/models/images/Background.java
new file mode 100644
index 0000000..5f40c9a
--- /dev/null
+++ b/src/main/java/com/volcengine/ark/runtime/models/images/Background.java
@@ -0,0 +1,57 @@
+// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
+// SPDX-License-Identifier: Apache-2.0
+
+/*
+ * Ark Image Generation API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.1.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.volcengine.ark.runtime.models.images;
+
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Background of the generated image.
+ */
+public enum Background {
+
+ OPAQUE("opaque"),
+
+ TRANSPARENT("transparent");
+
+ private String value;
+
+ Background(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static Background fromValue(String value) {
+ for (Background b : Background.values()) {
+ if (b.value.equalsIgnoreCase(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+}
diff --git a/src/main/java/com/volcengine/ark/runtime/models/images/CreateImageGenerationRequest.java b/src/main/java/com/volcengine/ark/runtime/models/images/CreateImageGenerationRequest.java
index ea22756..c8b654d 100644
--- a/src/main/java/com/volcengine/ark/runtime/models/images/CreateImageGenerationRequest.java
+++ b/src/main/java/com/volcengine/ark/runtime/models/images/CreateImageGenerationRequest.java
@@ -42,6 +42,7 @@
CreateImageGenerationRequest.JSON_PROPERTY_OPTIMIZE_PROMPT_OPTIONS,
CreateImageGenerationRequest.JSON_PROPERTY_TOOLS,
CreateImageGenerationRequest.JSON_PROPERTY_OUTPUT_FORMAT,
+ CreateImageGenerationRequest.JSON_PROPERTY_BACKGROUND,
CreateImageGenerationRequest.JSON_PROPERTY_LAYER_DECOMPOSITION
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
@@ -51,12 +52,12 @@ public class CreateImageGenerationRequest {
private String model;
public static final String JSON_PROPERTY_PROMPT = "prompt";
- @javax.annotation.Nonnull
+ @javax.annotation.Nullable
private String prompt;
public static final String JSON_PROPERTY_IMAGE = "image";
@javax.annotation.Nullable
- private List image;
+ private CreateImageGenerationRequestImage image;
public static final String JSON_PROPERTY_STREAM = "stream";
@javax.annotation.Nullable
@@ -106,6 +107,10 @@ public class CreateImageGenerationRequest {
@javax.annotation.Nullable
private OutputFormat outputFormat;
+ public static final String JSON_PROPERTY_BACKGROUND = "background";
+ @javax.annotation.Nullable
+ private Background background;
+
public static final String JSON_PROPERTY_LAYER_DECOMPOSITION = "layer_decomposition";
@javax.annotation.Nullable
private Boolean layerDecomposition;
@@ -138,61 +143,53 @@ public void setModel(@javax.annotation.Nonnull String model) {
this.model = model;
}
- public CreateImageGenerationRequest prompt(@javax.annotation.Nonnull String prompt) {
+ public CreateImageGenerationRequest prompt(@javax.annotation.Nullable String prompt) {
this.prompt = prompt;
return this;
}
/**
- * Text prompt describing the desired image.
+ * Text prompt describing the desired image. Required for standard generation; may be omitted for automatic layer decomposition when `layer_decomposition=true`.
* @return prompt
*/
- @javax.annotation.Nonnull
- @JsonProperty(value = JSON_PROPERTY_PROMPT, required = true)
- @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ @javax.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_PROMPT, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getPrompt() {
return prompt;
}
- @JsonProperty(value = JSON_PROPERTY_PROMPT, required = true)
- @JsonInclude(value = JsonInclude.Include.ALWAYS)
- public void setPrompt(@javax.annotation.Nonnull String prompt) {
+ @JsonProperty(value = JSON_PROPERTY_PROMPT, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setPrompt(@javax.annotation.Nullable String prompt) {
this.prompt = prompt;
}
- public CreateImageGenerationRequest image(@javax.annotation.Nullable List image) {
+ public CreateImageGenerationRequest image(@javax.annotation.Nullable CreateImageGenerationRequestImage image) {
this.image = image;
return this;
}
- public CreateImageGenerationRequest addImageItem(String imageItem) {
- if (this.image == null) {
- this.image = new ArrayList<>();
- }
- this.image.add(imageItem);
- return this;
- }
-
/**
- * Reference / edit images. Each entry is a URL or a `data:` URI.
+ * Get image
* @return image
*/
@javax.annotation.Nullable
@JsonProperty(value = JSON_PROPERTY_IMAGE, required = false)
- @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public List getImage() {
+ public CreateImageGenerationRequestImage getImage() {
return image;
}
@JsonProperty(value = JSON_PROPERTY_IMAGE, required = false)
- @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
- public void setImage(@javax.annotation.Nullable List image) {
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setImage(@javax.annotation.Nullable CreateImageGenerationRequestImage image) {
this.image = image;
}
@@ -504,6 +501,31 @@ public void setOutputFormat(@javax.annotation.Nullable OutputFormat outputFormat
this.outputFormat = outputFormat;
}
+ public CreateImageGenerationRequest background(@javax.annotation.Nullable Background background) {
+
+ this.background = background;
+ return this;
+ }
+
+ /**
+ * Output background. Defaults to `opaque`. `transparent` requires exactly one PNG reference image with an alpha channel and PNG output.
+ * @return background
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_BACKGROUND, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+
+ public Background getBackground() {
+ return background;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_BACKGROUND, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setBackground(@javax.annotation.Nullable Background background) {
+ this.background = background;
+ }
+
public CreateImageGenerationRequest layerDecomposition(@javax.annotation.Nullable Boolean layerDecomposition) {
this.layerDecomposition = layerDecomposition;
@@ -554,12 +576,13 @@ public boolean equals(Object o) {
Objects.equals(this.optimizePromptOptions, createImageGenerationRequest.optimizePromptOptions) &&
Objects.equals(this.tools, createImageGenerationRequest.tools) &&
Objects.equals(this.outputFormat, createImageGenerationRequest.outputFormat) &&
+ Objects.equals(this.background, createImageGenerationRequest.background) &&
Objects.equals(this.layerDecomposition, createImageGenerationRequest.layerDecomposition);
}
@Override
public int hashCode() {
- return Objects.hash(model, prompt, image, stream, responseFormat, seed, guidanceScale, imageGuidanceScale, size, watermark, sequentialImageGeneration, sequentialImageGenerationOptions, optimizePromptOptions, tools, outputFormat, layerDecomposition);
+ return Objects.hash(model, prompt, image, stream, responseFormat, seed, guidanceScale, imageGuidanceScale, size, watermark, sequentialImageGeneration, sequentialImageGenerationOptions, optimizePromptOptions, tools, outputFormat, background, layerDecomposition);
}
@Override
@@ -581,6 +604,7 @@ public String toString() {
sb.append(" optimizePromptOptions: ").append(toIndentedString(optimizePromptOptions)).append("\n");
sb.append(" tools: ").append(toIndentedString(tools)).append("\n");
sb.append(" outputFormat: ").append(toIndentedString(outputFormat)).append("\n");
+ sb.append(" background: ").append(toIndentedString(background)).append("\n");
sb.append(" layerDecomposition: ").append(toIndentedString(layerDecomposition)).append("\n");
sb.append("}");
return sb.toString();
@@ -614,7 +638,7 @@ public CreateImageGenerationRequest.Builder prompt(String prompt) {
this.instance.prompt = prompt;
return this;
}
- public CreateImageGenerationRequest.Builder image(List image) {
+ public CreateImageGenerationRequest.Builder image(CreateImageGenerationRequestImage image) {
this.instance.image = image;
return this;
}
@@ -666,6 +690,10 @@ public CreateImageGenerationRequest.Builder outputFormat(OutputFormat outputForm
this.instance.outputFormat = outputFormat;
return this;
}
+ public CreateImageGenerationRequest.Builder background(Background background) {
+ this.instance.background = background;
+ return this;
+ }
public CreateImageGenerationRequest.Builder layerDecomposition(Boolean layerDecomposition) {
this.instance.layerDecomposition = layerDecomposition;
return this;
@@ -719,6 +747,7 @@ public CreateImageGenerationRequest.Builder toBuilder() {
.optimizePromptOptions(getOptimizePromptOptions())
.tools(getTools())
.outputFormat(getOutputFormat())
+ .background(getBackground())
.layerDecomposition(getLayerDecomposition());
}
diff --git a/src/main/java/com/volcengine/ark/runtime/models/images/CreateImageGenerationRequestImage.java b/src/main/java/com/volcengine/ark/runtime/models/images/CreateImageGenerationRequestImage.java
new file mode 100644
index 0000000..ddfb6ed
--- /dev/null
+++ b/src/main/java/com/volcengine/ark/runtime/models/images/CreateImageGenerationRequestImage.java
@@ -0,0 +1,120 @@
+// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
+// SPDX-License-Identifier: Apache-2.0
+
+/*
+ * Ark Image Generation API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.1.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.volcengine.ark.runtime.models.images;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.io.IOException;
+import java.util.Objects;
+
+/**
+ * CreateImageGenerationRequestImage
+ *
+ * Naked-union holder generated by gen/java/postprocess.py from the openapi
+ * anyOf schema (variants: String, java.util.List).
+ *
+ * The Jackson apache-httpclient template openapi-generator runs against
+ * does not support non-discriminated anyOf/oneOf — it either drops to a
+ * degenerate empty shell or flattens one variant's fields onto the class,
+ * losing the others. This postprocess rewrite replaces the parent with a
+ * @JsonValue holder + typed static factories for write-side, plus a custom
+ * @JsonDeserialize that dispatches by JsonNode shape on the read-side so
+ * round-trips preserve variant types (string -> typed primitive/enum,
+ * object -> typed model, array -> typed List).
+ */
+@JsonDeserialize(using = CreateImageGenerationRequestImage.Deserializer.class)
+public class CreateImageGenerationRequestImage {
+
+ private final Object value;
+
+ @JsonCreator
+ public CreateImageGenerationRequestImage(Object value) {
+ this.value = value;
+ }
+
+ public CreateImageGenerationRequestImage() {
+ this.value = null;
+ }
+
+ public static CreateImageGenerationRequestImage ofString(String value) {
+ return new CreateImageGenerationRequestImage(value);
+ }
+
+ public static CreateImageGenerationRequestImage ofList(java.util.List value) {
+ return new CreateImageGenerationRequestImage(value);
+ }
+
+ @JsonValue
+ public Object getValue() {
+ return this.value;
+ }
+
+ public static class Deserializer extends JsonDeserializer {
+ @Override
+ public CreateImageGenerationRequestImage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
+ ObjectMapper mapper = (ObjectMapper) p.getCodec();
+ JsonNode node = mapper.readTree(p);
+ if (node.isTextual()) {
+ return new CreateImageGenerationRequestImage(mapper.treeToValue(node, String.class));
+ }
+ if (node.isArray()) {
+ return new CreateImageGenerationRequestImage(
+ mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {}));
+ }
+ throw ctxt.weirdStringException(
+ node == null ? "null" : node.toString(),
+ CreateImageGenerationRequestImage.class,
+ "no CreateImageGenerationRequestImage variant matched JSON node shape");
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ CreateImageGenerationRequestImage other = (CreateImageGenerationRequestImage) o;
+ return Objects.equals(this.value, other.value);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(this.value);
+ }
+
+ @Override
+ public String toString() {
+ return "class CreateImageGenerationRequestImage {" + Objects.toString(value) + "}";
+ }
+
+ public static class Builder {
+ private Object value;
+ public Builder() {}
+ public Builder value(Object value) { this.value = value; return this; }
+ public CreateImageGenerationRequestImage build() { return new CreateImageGenerationRequestImage(this.value); }
+ }
+
+ public static CreateImageGenerationRequestImage.Builder builder() { return new CreateImageGenerationRequestImage.Builder(); }
+
+ public CreateImageGenerationRequestImage.Builder toBuilder() {
+ return new CreateImageGenerationRequestImage.Builder().value(this.value);
+ }
+}
diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/AgentWithUpgrades.java b/src/main/java/com/volcengine/ark/runtime/models/session/AgentWithUpgrades.java
new file mode 100644
index 0000000..c9dff13
--- /dev/null
+++ b/src/main/java/com/volcengine/ark/runtime/models/session/AgentWithUpgrades.java
@@ -0,0 +1,557 @@
+// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
+// SPDX-License-Identifier: Apache-2.0
+
+/*
+ * Ark Managed Agents Session API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.1.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.volcengine.ark.runtime.models.session;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Session upgrade 的目标 Agent 运行配置。 `id` 必须等于当前 Session 的 Agent ID —— upgrade 不支持换绑到另一个 Agent,不一致返回 403 `AgentMismatch`。 数组字段(`tools` / `mcp_servers` / `skills`)是**整组替换**语义:省略 表示保留原值,显式传 `[]` 表示清空。两者在 wire 上必须可区分,SDK 不能 把空数组优化成省略字段。
+ */
+@JsonPropertyOrder({
+ AgentWithUpgrades.JSON_PROPERTY_TYPE,
+ AgentWithUpgrades.JSON_PROPERTY_ID,
+ AgentWithUpgrades.JSON_PROPERTY_VERSION,
+ AgentWithUpgrades.JSON_PROPERTY_MODEL,
+ AgentWithUpgrades.JSON_PROPERTY_SYSTEM,
+ AgentWithUpgrades.JSON_PROPERTY_TOOLS,
+ AgentWithUpgrades.JSON_PROPERTY_MCP_SERVERS,
+ AgentWithUpgrades.JSON_PROPERTY_SKILLS,
+ AgentWithUpgrades.JSON_PROPERTY_MULTIAGENT,
+ AgentWithUpgrades.JSON_PROPERTY_DISPLAY_NAME
+})
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
+public class AgentWithUpgrades {
+ /**
+ * 固定 `\"agent_with_upgrades\"`。
+ */
+ public enum TypeEnum {
+ AGENT_WITH_UPGRADES(String.valueOf("agent_with_upgrades"));
+
+ private String value;
+
+ TypeEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static TypeEnum fromValue(String value) {
+ for (TypeEnum b : TypeEnum.values()) {
+ if (b.value.equalsIgnoreCase(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ @javax.annotation.Nonnull
+ private TypeEnum type;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ @javax.annotation.Nonnull
+ private String id;
+
+ public static final String JSON_PROPERTY_VERSION = "version";
+ @javax.annotation.Nullable
+ private Integer version;
+
+ public static final String JSON_PROPERTY_MODEL = "model";
+ @javax.annotation.Nullable
+ private ModelUpgrades model;
+
+ public static final String JSON_PROPERTY_SYSTEM = "system";
+ @javax.annotation.Nullable
+ private String system;
+
+ public static final String JSON_PROPERTY_TOOLS = "tools";
+ @javax.annotation.Nullable
+ private List