Seedream 5.0 Lite: Text-to-Image Serverless API
Fast, affordable instruction-following image 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) 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 with subject and setting.
aspect_ratiooptionalstringWidth-to-height ratio. 16:9 for panoramic, 1:1 for square.
"16:9""1:1""4:3""3:4""16:9""9:16""3:2""2:3""21:9"max_imagesoptionalintegerNumber of images to generate. Up to 15 for variations.
1Range: 1 - 15optimize_promptoptionalstringSelect prompt speed. 'Standard' for accuracy, 'Fast' for quicker outputs.
"standard""standard""fast"sizeoptionalstringOutput resolution. 2K for standard use, 3K for 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