Skip to main content
POST
/
api
/
v3
/
images
/
generations
Text to Image
curl --request POST \
  --url https://gptproto.com/api/v3/images/generations \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "prompt": "<string>",
  "response_format": "<string>",
  "size": "<string>",
  "seed": 123,
  "guidance_scale": 123,
  "watermark": true
}'
{
  "error": {
    "message": "Invalid request parameters",
    "type": "invalid_request_error",
    "code": "invalid_parameters"
  }
}

Overview

This endpoint provides text to image functionality using Volcengine official format.

Authentication

This endpoint requires authentication using a Bearer token with your API key.
Authorization
string
required
Your API key in the format: Bearer YOUR_API_KEY

Request Body

model
string
default:"doubao-seedream-4-0-250828"
required
The model identifier for image generation/editing
prompt
string
required
Description of the desired image transformation or generation
response_format
string
default:"url"
Response format: “url” (image URL) or “b64_json” (base64 encoded)
size
string
default:"adaptive"
Output image resolution. Options: adaptive, 1024x1024, 2K, 4K
seed
integer
Random seed for reproducible results
guidance_scale
number
default:"5.5"
Controls adherence to the prompt. Range: 1.0-10.0, recommended: 3.0-7.0
watermark
boolean
default:"true"
Whether to add watermark to the generated image

Request Example

curl -X POST "https://gptproto.com/api/v3/images/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "doubao-seedream-4-0-250828",
  "prompt": "Fisheye lens, a cat'''s head, the picture shows the cat'''s facial features are distorted due to the shooting method.",
  
  "response_format": "url",
  "size": "adaptive",
  "seed": 12,
  "guidance_scale": 2.5,
  "watermark": true
}'

Response

Success
200
Successful response with image generation result
{
  "id": "img_xxxxxxxxxx",
  "object": "image",
  "created": 1234567890,
  "model": "doubao-seedream-4-0-250828",
  "data": [
    {
      "url": "https://example.com/generated_image.jpg",
      "index": 0
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "total_tokens": 10
  }
}

Error Responses

{
  "error": {
    "message": "Invalid request parameters",
    "type": "invalid_request_error",
    "code": "invalid_parameters"
  }
}