Seedream 3.0 t2i Serverless API
Seedream V3 generates high-resolution, bilingual images in seconds, enhancing creative workflows and marketing effectiveness.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/seedream-v3-text-to-image"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "aspect_ratio": "16:9",
12 "prompt": "A flourishing zen garden with cherry blossoms next to a calm koi pond, under a moonlit sky.",
13 "seed": 12345,
14 "guidance_scale": 2.5
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20 result = response.json()
21 print(json.dumps(result, indent=2))
22else:
23 print(f"Error: {response.status_code}")
24 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/seedream-v3-text-to-image"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "aspect_ratio": "16:9",
12 "prompt": "A flourishing zen garden with cherry blossoms next to a calm koi pond, under a moonlit sky.",
13 "seed": 12345,
14 "guidance_scale": 2.5
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20 result = response.json()
21 print(json.dumps(result, indent=2))
22else:
23 print(f"Error: {response.status_code}")
24 print(response.text)API Endpoint
https://api.segmind.com/v1/seedream-v3-text-to-imageParameters
aspect_ratiorequiredstringAspect ratio dictates the image dimensions. Use 16:9 for widescreen or 1:1 for square images.
"16:9""16:9""4:3""1:1""3:4""9:16"promptrequiredstringBriefly describe your desired scene. Be specific for best results, like 'sunset city skyline with neon lights'.
guidance_scaleoptionalnumberGuidance scale affects adherence to the prompt. Higher numbers increase prompt influence, up to 10.
2.5Range: 1 - 10seedoptionalintegerInput seed ensures consistent results. Keep consistent for replicable art or change for new variations.
Response 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