Segmind Orbiton Serverless API
Turn one photo into a shot with the camera move you choose: orbit, push in, rise, track, dolly zoom and more, with the amount and pace you set, or Auto to let Segmind Orbiton pick. For filmmakers, brands and creators. Up to 1080p.
1import requests
2import time
3import json
4
5api_key = "YOUR_API_KEY"
6url = "https://api.segmind.com/workflows/v2/6af7725d4d438d04dd364fab-v2"
7
8data = {
9 "image": "https://images.segmind.com/public/16d3a7fc460f582d48d46ecef78e39d4.jpg",
10 "camera_move": "Orbit right",
11 "amount": "Auto",
12 "pace": "Auto",
13 "then_move": "None",
14 "shot_notes": "She holds her pose while the camera circles her.",
15 "duration": "5",
16 "resolution": "1080p"
17}
18
19def poll_for_result(poll_url):
20 """Poll the API until the generation is complete"""
21 while True:
22 response = requests.get(
23 poll_url,
24 headers={'x-api-key': api_key}
25 )
26 result = response.json()
27
28 if result['status'] == 'COMPLETED':
29 # Parse the output (it's a JSON string)
30 outputs = json.loads(result['output'])
31 return outputs
32 elif result['status'] == 'FAILED':
33 raise Exception(result.get('error', 'Generation failed'))
34
35 # Wait 7 seconds before polling again
36 time.sleep(7)
37
38# Make the initial request
39response = requests.post(
40 url,
41 json=data,
42 headers={
43 'x-api-key': api_key,
44 'Content-Type': 'application/json'
45 }
46)
47
48if response.status_code == 200:
49 result = response.json()
50 print('Request queued:', result)
51
52 # Start polling for results
53 outputs = poll_for_result(result['poll_url'])
54 print('Generation complete:', outputs)
55else:
56 print(f"Error: {response.status_code}")
57 print(response.text) 1import requests
2import time
3import json
4
5api_key = "YOUR_API_KEY"
6url = "https://api.segmind.com/workflows/v2/6af7725d4d438d04dd364fab-v2"
7
8data = {
9 "image": "https://images.segmind.com/public/16d3a7fc460f582d48d46ecef78e39d4.jpg",
10 "camera_move": "Orbit right",
11 "amount": "Auto",
12 "pace": "Auto",
13 "then_move": "None",
14 "shot_notes": "She holds her pose while the camera circles her.",
15 "duration": "5",
16 "resolution": "1080p"
17}
18
19def poll_for_result(poll_url):
20 """Poll the API until the generation is complete"""
21 while True:
22 response = requests.get(
23 poll_url,
24 headers={'x-api-key': api_key}
25 )
26 result = response.json()
27
28 if result['status'] == 'COMPLETED':
29 # Parse the output (it's a JSON string)
30 outputs = json.loads(result['output'])
31 return outputs
32 elif result['status'] == 'FAILED':
33 raise Exception(result.get('error', 'Generation failed'))
34
35 # Wait 7 seconds before polling again
36 time.sleep(7)
37
38# Make the initial request
39response = requests.post(
40 url,
41 json=data,
42 headers={
43 'x-api-key': api_key,
44 'Content-Type': 'application/json'
45 }
46)
47
48if response.status_code == 200:
49 result = response.json()
50 print('Request queued:', result)
51
52 # Start polling for results
53 outputs = poll_for_result(result['poll_url'])
54 print('Generation complete:', outputs)
55else:
56 print(f"Error: {response.status_code}")
57 print(response.text)API Endpoint
https://api.segmind.com/workflows/v2/6af7725d4d438d04dd364fab-v2Parameters
imageoptionalstring (uri)Photo
"https://images.segmind.com/public/16d3a7fc460f582d48d46ecef78e39d4.jpg"camera_moveoptionalstringCamera move
"Orbit right"amountoptionalstringAmount
"Auto"paceoptionalstringPace
"Auto"then_moveoptionalstringThen
"None"shot_notesoptionalstringShot notes (optional)
"She holds her pose while the camera circles her."durationoptionalstringLength in seconds
"5"resolutionoptionalstringResolution
"1080p"Response Format
Returns: Polling-based asynchronous response
Initial request returns a poll_url. Poll every 7 seconds until status is COMPLETED.
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
Workflow 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