Image Generation API

Text-to-image APIs come in two styles depending on the model: the OpenAI Images API style (Doubao Seedream) and the Gemini generateContent style; image editing uploads the original image via multipart/form-data.

Text-to-Image (OpenAI Style, Seedream)

POST/api/v3/images/generations

图片生成

Bearer API KeyUse the Authorization: Bearer sk_live_... header; x-api-key is also supported.
Confirm the model call name firstFirst filter models that support this endpoint format on the Models page, then open a model detail page to copy its call name. Your account's final availability also depends on organization permissions.

Request structure

The section below confirms the method, URL and authentication scheme. It is an HTTP structure snippet, not a standalone runnable example.

HTTP
POST https://www.silvamux.com/api/v3/images/generations
Authorization: Bearer $SILVAMUX_API_KEY
Content-Type: application/json

Request body

application/json · ImageGenerationRequest · Required

FieldTypeRequiredDescription
modelstringYes从模型广场选择支持当前图片接口的模型并复制调用名。
nintegerNo
promptstringYes
response_formatstringNo
sizestringNo可用尺寸由模型决定;Seedream 5.0 的首次调用示例使用 2048x2048。

Response

200图片生成或编辑响应。

application/json · ImageResponse

FieldTypeRequiredDescription
createdinteger (int64)No
dataarray<object>No
data.b64_jsonstringNo
data.urlstring (uri)No

defaultVolcengine 兼容错误。

application/json · VolcengineError

FieldTypeRequiredDescription
errorFreeFormObjectNo

Examples

curl https://www.silvamux.com/api/v3/images/generations \
  -H "Authorization: Bearer $SILVAMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-5-0-260128",
    "prompt": "A shiba inu wearing sunglasses sitting in a café",
    "size": "2048x2048",
    "n": 1
  }'

Response:

{
  "created": 1234567890,
  "data": [{"url": "https://..."}],
  "usage": {"output_images": 1}
}

https://www.silvamux.com/api/v3 is the /api/v3 path under the access domain, routing to /api/v3/images/generations.

Text-to-Image (Gemini Style, Contract Example)

Gemini generateContent style, for Gemini image models.

There are currently no publicly discoverable Gemini image models in the model list or the Model Plaza. The content below only illustrates the request structure and cannot be executed directly; <MODEL_CALL_NAME> must be replaced with a real call name published later on the Model Plaza — do not guess model names.
POST /api/v1beta/models/{model}:generateContent

Authentication: Authorization: Bearer <API_KEY> or x-api-key: <API_KEY>

curl https://www.silvamux.com/api/v1beta/models/<MODEL_CALL_NAME>:generateContent \
  -H "Authorization: Bearer $SILVAMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"role": "user", "parts": [{"text": "Draw a cat sitting on a windowsill"}]}
    ],
    "generationConfig": {
      "responseModalities": ["TEXT", "IMAGE"],
      "imageConfig": {"aspectRatio": "1:1", "imageSize": "1K"}
    }
  }'

Responses keep the Gemini format; billing fields are in usageMetadata.

Image Editing (Image-to-Image)

Image editing is compatible with the OpenAI Images Edits style: upload images via multipart/form-data and edit them with a prompt.

POST/api/v3/images/edits

编辑图片(Volcengine v3)

使用 multipart/form-data 上传图片;请求体通过 #/components/requestBodies/ImageEdit 定义,解析后 model、prompt 和 image 为必填字段。

No publicly discoverable models yetThe current model list and Models page provide no public call names for this endpoint; this page is for OpenAPI contract reference only and is not a standalone runnable example. Do not guess model names — once matching models are published, use the call name from their detail page.
Bearer API KeyUse the Authorization: Bearer sk_live_... header; x-api-key is also supported.
Confirm the model call name firstFirst filter models that support this endpoint format on the Models page, then open a model detail page to copy its call name. Your account's final availability also depends on organization permissions.

Request structure

The section below confirms the method, URL and authentication scheme. It is an HTTP structure snippet, not a standalone runnable example.

HTTP
POST https://www.silvamux.com/api/v3/images/edits
Authorization: Bearer $SILVAMUX_API_KEY
Content-Type: multipart/form-data

Request body

multipart/form-data · ImageEditRequest · Required

图片编辑 v1/v3 共用的必填请求体。Content-Type 为 multipart/form-data;继续解析 ImageEditRequest 可获得 model、prompt、image 等字段。

FieldTypeRequiredDescription
imagestring (binary) | array<string (binary)>Yes
maskstring (binary)No
modelstringYes
nintegerNo
promptstringYes
sizestringNo

Response

200图片生成或编辑响应。

application/json · ImageResponse

FieldTypeRequiredDescription
createdinteger (int64)No
dataarray<object>No
data.b64_jsonstringNo
data.urlstring (uri)No

defaultOpenAI 兼容错误。

application/json · OpenAIError

FieldTypeRequiredDescription
errorobjectYes
error.codestring | integerNo
error.messagestringYes
error.typestringNo

Key Parameters

ParameterTypeRequiredDescription
modelstringYesModel call name; must come from the Model Plaza or the model list
imagefileYesInput images, up to 16 (repeat image=@...)
promptstringYesEditing instruction
sizestringNoSize, e.g. 1024x1024
maskfileNoMask image
nintegerNoNumber of output images
streambooleanNoModel pass-through field, currently not part of the unified OpenAPI contract; support depends on future public models

OpenAPI Contract Notes

Image edit v1 and v3 share the #/components/requestBodies/ImageEdit request body in the OpenAPI and keep referencing #/components/schemas/ImageEditRequest for field definitions. Reading the contract or generating an SDK requires recursive resolution of local $refs; fields are not inlined directly under the endpoint node, which does not mean the request body is missing.

The resolved request body is a required multipart/form-data where model, prompt, and image are required, and image is one or more binary files.

Examples

There are currently no publicly discoverable image editing models in the model list or the Model Plaza. The content below is a request structure example and cannot be executed directly; <MODEL_CALL_NAME> must be replaced with a real call name published later on the Model Plaza — do not guess model names.
curl https://www.silvamux.com/api/v3/images/edits \
  -H "Authorization: Bearer $SILVAMUX_API_KEY" \
  -F "model=<MODEL_CALL_NAME>" \
  -F "image=@photo.png" \
  -F "prompt=Add some decorative text to the image" \
  -F "size=1024x1024"

Fields such as background and partial_images are model pass-through fields and currently not part of the unified OpenAPI contract. Whether they are supported follows the details of future public models.

Upload Limits

Request bodies must not exceed 64 MB. Larger requests return 413 (REQUEST_TOO_LARGE).

Available Models

Sample models usable today: doubao-seedream-5-0-260128 (Seedream). There are no publicly discoverable call names for Gemini image models or image editing models yet; usable call names must come from the Model Plaza or the model list API.

Billing

Text-to-image and image-to-image are both billed per generated image; check current unit prices on the corresponding model detail page in the Model Plaza.