Seedream 5.0 Lite: Text-to-Image Serverless API

Fast, affordable instruction-following image generation.

~36.40s
$0.035 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/seedream-v5-lite-text-to-image"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "A futuristic cityscape with flying cars at dusk",
12    "aspect_ratio": "16:9",
13    "size": "2K",
14    "max_images": 1,
15    "optimize_prompt": "standard",
16    "watermark": false
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22    result = response.json()
23    print(json.dumps(result, indent=2))
24else:
25    print(f"Error: {response.status_code}")
26    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/seedream-v5-lite-text-to-image

Parameters

promptrequired
string

Describe the image to create with subject and setting.

aspect_ratiooptional
string

Width-to-height ratio. 16:9 for panoramic, 1:1 for square.

Default: "16:9"
Allowed values :
"1:1""4:3""3:4""16:9""9:16""3:2""2:3""21:9"
max_imagesoptional
integer

Number of images to generate. Up to 15 for variations.

Default: 1Range: 1 - 15
optimize_promptoptional
string

Select prompt speed. 'Standard' for accuracy, 'Fast' for quicker outputs.

Default: "standard"
Allowed values :
"standard""fast"
sizeoptional
string

Output resolution. 2K for standard use, 3K for sharpness.

Default: "2K"
Allowed values :
"2K""3K"
watermarkoptional
boolean

Toggle watermark. Use 'true' to embed copyright or 'false' for no watermarking.

Default: false

Response Type

Returns: Text/JSON

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out