Segmind Antiquark Serverless API
Rebuild a proven ad, fashion film or product reel with your product: Segmind Antiquark keeps every shot, cut, camera move and the music, and puts your product in, true to its details. For brands, agencies and sellers. Up to 1080p, in H.264, HEVC 10-bit or ProRes.
1import requests
2import time
3import json
4
5api_key = "YOUR_API_KEY"
6url = "https://api.segmind.com/workflows/v2/6ae62f1b98a6abfbcf9507d4-v1"
7
8data = {
9 "reference_edit": "https://images.segmind.com/public/5efe2dabe878f485fd22d191d4b53dfc.mp4",
10 "product_photo": "https://images.segmind.com/public/af50bdbfbf73c0c66cfe36a181f300e6.jpeg",
11 "what_to_replace": "the woman's black coat",
12 "resolution": "720p",
13 "delivery": "H.264 mp4 (plays everywhere)",
14 "smooth_retime_and_grain_match": true
15}
16
17def poll_for_result(poll_url):
18 """Poll the API until the generation is complete"""
19 while True:
20 response = requests.get(
21 poll_url,
22 headers={'x-api-key': api_key}
23 )
24 result = response.json()
25
26 if result['status'] == 'COMPLETED':
27 # Parse the output (it's a JSON string)
28 outputs = json.loads(result['output'])
29 return outputs
30 elif result['status'] == 'FAILED':
31 raise Exception(result.get('error', 'Generation failed'))
32
33 # Wait 7 seconds before polling again
34 time.sleep(7)
35
36# Make the initial request
37response = requests.post(
38 url,
39 json=data,
40 headers={
41 'x-api-key': api_key,
42 'Content-Type': 'application/json'
43 }
44)
45
46if response.status_code == 200:
47 result = response.json()
48 print('Request queued:', result)
49
50 # Start polling for results
51 outputs = poll_for_result(result['poll_url'])
52 print('Generation complete:', outputs)
53else:
54 print(f"Error: {response.status_code}")
55 print(response.text) 1import requests
2import time
3import json
4
5api_key = "YOUR_API_KEY"
6url = "https://api.segmind.com/workflows/v2/6ae62f1b98a6abfbcf9507d4-v1"
7
8data = {
9 "reference_edit": "https://images.segmind.com/public/5efe2dabe878f485fd22d191d4b53dfc.mp4",
10 "product_photo": "https://images.segmind.com/public/af50bdbfbf73c0c66cfe36a181f300e6.jpeg",
11 "what_to_replace": "the woman's black coat",
12 "resolution": "720p",
13 "delivery": "H.264 mp4 (plays everywhere)",
14 "smooth_retime_and_grain_match": true
15}
16
17def poll_for_result(poll_url):
18 """Poll the API until the generation is complete"""
19 while True:
20 response = requests.get(
21 poll_url,
22 headers={'x-api-key': api_key}
23 )
24 result = response.json()
25
26 if result['status'] == 'COMPLETED':
27 # Parse the output (it's a JSON string)
28 outputs = json.loads(result['output'])
29 return outputs
30 elif result['status'] == 'FAILED':
31 raise Exception(result.get('error', 'Generation failed'))
32
33 # Wait 7 seconds before polling again
34 time.sleep(7)
35
36# Make the initial request
37response = requests.post(
38 url,
39 json=data,
40 headers={
41 'x-api-key': api_key,
42 'Content-Type': 'application/json'
43 }
44)
45
46if response.status_code == 200:
47 result = response.json()
48 print('Request queued:', result)
49
50 # Start polling for results
51 outputs = poll_for_result(result['poll_url'])
52 print('Generation complete:', outputs)
53else:
54 print(f"Error: {response.status_code}")
55 print(response.text)API Endpoint
https://api.segmind.com/workflows/v2/6ae62f1b98a6abfbcf9507d4-v1Parameters
reference_editoptionalstring (uri)Reference edit
"https://images.segmind.com/public/5efe2dabe878f485fd22d191d4b53dfc.mp4"product_photooptionalstring (uri)Product photo
"https://images.segmind.com/public/af50bdbfbf73c0c66cfe36a181f300e6.jpeg"what_to_replaceoptionalstringWhat to replace
"the woman's black coat"resolutionoptionalstringResolution
"720p"deliveryoptionalstringDelivery format
"H.264 mp4 (plays everywhere)"smooth_retime_and_grain_matchoptionalbooleanSmooth retime + grain match
trueResponse 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