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.
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) 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
https://api.segmind.com/v1/seedream-v5-lite-text-to-imageParameters
promptrequiredstringDescribe the image to create. Try 'A futuristic cityscape with flying cars at dusk'.
aspect_ratiooptionalstringSelect the width-to-height ratio. Use '16:9' for panoramic views or '1:1' for squares.
"16:9""1:1""4:3""3:4""16:9""9:16""3:2""2:3""21:9"max_imagesoptionalintegerSet number of images to generate. Use 1 for single or up to 15 for multiple variations.
1Range: 1 - 15optimize_promptoptionalstringSelect prompt speed. 'Standard' for accuracy, 'Fast' for quicker outputs.
"standard""standard""fast"sizeoptionalstringChoose resolution based on detail. '2K' for standard use or '3K' for extra sharpness.
"2K""2K""3K"watermarkoptionalbooleanToggle watermark. Use 'true' to embed copyright or 'false' for no watermarking.
falseResponse Type
Returns: Text/JSON
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out