POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 const axios = require('axios'); const fs = require('fs'); const path = require('path'); async function toB64(imgPath) { const data = fs.readFileSync(path.resolve(imgPath)); return Buffer.from(data).toString('base64'); } const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/wan2.7-videoedit"; const data = { "prompt": "Convert the entire scene to a claymation style", "video": "https://segmind-resources.s3.amazonaws.com/input/wan27videoedit-input.mp4", "image": "toB64('undefined')", "resolution": "720P" }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


promptstr *

Text instruction describing the desired edit. Up to 5000 characters.


videostr *

URL of the video to edit. Duration 2-10s, resolution 240-4096px.


imageimage ( default: 1 )

Optional style reference image for style transfer.


negative_promptstr ( default: 1 )

Content to avoid.


resolutionenum:str ( default: 720P ) Affects Pricing

Output video resolution tier.

Allowed values:


seedint ( default: 1 )

Random seed.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.