Seedream 5.0 Lite: Text-to-Image Serverless API

Generate high-quality, instruction-following images with Seedream 5.0 Lite, Segmind's fast multimodal text-to-image model.

~35.84s
$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. Try 'A futuristic cityscape with flying cars at dusk'.

aspect_ratiooptional
string

Select the width-to-height ratio. Use '16:9' for panoramic views or '1:1' for squares.

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

Set number of images to generate. Use 1 for single or up to 15 for multiple 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

Choose resolution based on detail. '2K' for standard use or '3K' for extra 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