1. Image (OpenAI compatible)
Ark-Docs
  • Video (Doubao native)
    • Submit a video generation task (Doubao native)
      POST
    • Retrieve a video generation task (Doubao native)
      GET
  • Video (OpenAI compatible)
    • Submit a video generation task (OpenAI compatible)
      POST
    • Retrieve a video generation task
      GET
    • Submit a video generation task (OpenAI Video alias)
      POST
    • Retrieve a video generation task (OpenAI Video alias)
      GET
  • Video content
    • Download the generated video file
      GET
  • Image (Doubao native)
    • Generate an image (Doubao native)
      POST
  • Image (OpenAI compatible)
    • Generate an image (OpenAI compatible)
      POST
    • Edit an image (OpenAI compatible)
      POST
  • Asset library (Doubao native)
    • Manage the asset library (Doubao native)
      POST
  • 数据模型
    • VideoGenerationRequest
    • VideoFormDataRequest
    • VideoMetadata
    • DoubaoNativeVideoRequest
    • DoubaoNativeContentItem
    • VideoTaskResponse
    • DoubaoNativeVideoResponse
    • VideoTaskError
    • DoubaoImageRequest
    • ImageEditFormDataRequest
    • DoubaoImageResponse
    • ErrorResponse
    • DoubaoAssetRequest
    • DoubaoAssetResponse
  1. Image (OpenAI compatible)

Generate an image (OpenAI compatible)

POST
/v1/images/generations
OpenAI Images API compatible image generation.
Same request body, response body and billing as
POST /doubao/api/v3/images/generations; only the path and the accepted
response_format values differ.
Use this route when your client already speaks the OpenAI Images API.
Differences from the native route:
response_format: b64_json is supported here. The gateway downloads the
generated image and returns it inline.
multipart/form-data is accepted, so reference images can be uploaded as
files instead of URLs.
n must be 1; request several images with sequential_image_generation.
For parameter details, see the native route above.

请求参数

Authorization
JWT Bearer
在 Header 添加参数
Authorization
示例:
Authorization: ********************
or
Body 参数application/json必填

示例
{
    "model": "doubao-seedream-5-0-flash-260915",
    "prompt": "A cyberpunk city at night, wet streets reflecting neon signs",
    "size": "2K"
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location '/v1/images/generations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "doubao-seedream-5-0-flash-260915",
    "prompt": "A cyberpunk city at night, wet streets reflecting neon signs",
    "size": "2K"
}'

返回响应

🟢200
application/json
Images generated.
Bodyapplication/json

示例
{
    "data": [
        {
            "url": "https://ark-content-generation-v2-cn-beijing.tos-cn-beijing.volces.com/seedream/xxx.jpeg",
            "size": "2048x2048",
            "output_format": "jpeg"
        }
    ],
    "created": 1757469067,
    "usage": {
        "generated_images": 1,
        "output_tokens": 15908,
        "total_tokens": 15908
    }
}
🟠400BadRequest
🟠401Unauthorized
修改于 2026-10-28 04:38:45
上一页
Generate an image (Doubao native)
下一页
Edit an image (OpenAI compatible)
Built with