About
Restyles a whole source video in one of Sume's styles, keeping its motion and sound · 480p to 1080p · source 4–15 s
Model id sume-remix-restyle, sent to POST https://api.sume.com/v1/sume/remix/restyle/v1.0.
1. Calling the API
Install the client
npm install @sume-com/client
Setup your API key
Set SUME_API_KEY as an environment variable in your server runtime. Make the key in Sume API → API keys.
export SUME_API_KEY="YOUR_API_KEY"
Submit a request
This sends the Playground's request, with the input it holds now. Change the input there and this updates. subscribe submits it, waits for the job and returns the result.
import { createSumeClient } from "@sume-com/client";
const sume = createSumeClient({ baseURL: "https://api.sume.com" });
const response = await sume.subscribe("/v1/sume/remix/restyle/v1.0", {
input: {
"video_url": "https://media.sume.com/assets/asset_b09c8d8569b347a5855baf3d90735000/source.mp4",
"duration": 10,
"resolution": "480p",
"preset_id": "knitted-yarn-world"
},
});
console.log(response.status, response.video?.url);2. Authentication
API key
Send your Sume API key as a bearer token from server code only. Keys made under Sume API → API keys spend the workspace balance, the same one Studio spends, and call the model API only.
Authorization: Bearer $SUME_API_KEY
3. Queue
A submit answers at once with the job. Poll its status until it is completed, failed or canceled. Failed and canceled jobs are refunded.
Fetch request status
const response = await fetch(`https://api.sume.com/v1/jobs/${jobId}/status`, {
headers: { authorization: `Bearer ${process.env.SUME_API_KEY}` },
});
const { data: job } = await response.json();Get the result
A completed job returns its media. A queued or running job answers 409 job_not_completed with the current status; a failed one 409 job_failed with the reason, and a canceled one 409 job_canceled.
const response = await fetch(`https://api.sume.com/v1/jobs/${jobId}/result`, {
headers: { authorization: `Bearer ${process.env.SUME_API_KEY}` },
});
const { data: result } = await response.json();Cancel a request
A job can be canceled until generation starts.
const response = await fetch(`https://api.sume.com/v1/jobs/${jobId}/cancel`, {
method: "POST",
headers: { authorization: `Bearer ${process.env.SUME_API_KEY}` },
});
const { data: job } = await response.json();4. Files
Hosted files (URL)
Fields that end in _url or _urls take public HTTPS URLs. Some hosts block or rate-limit fetches from servers.
Uploading files
Upload a local file to Sume's storage, then send the URL it returns.
import { readFile } from "node:fs/promises";
import { createSumeClient } from "@sume-com/client";
const sume = createSumeClient({ baseURL: "https://api.sume.com" });
const url = await sume.uploadImage(await readFile("input.png"), "png");5. Schema
Input
modelstringrequired- "sume-remix-restyle"
promptstring- Optional, any language: added after the style's own prompt.
video_urlstringrequired- The source video, 4–15 s, at most 200 MiB (HTTPS). The aspect ratio follows it.
durationinteger- Optional: the source video's length in seconds, rounded up. Left out, the API reads it from the file. The output follows the source's length.Range: 4–15
resolutionstring- Output resolution.Default value: "720p"Possible enum values: 480p, 720p, 1080p
preset_idstringrequired- One of Sume's styles (GET /v1/sume/remix/restyle/v1.0/presets). The source's first frame is redrawn in the style, with the prompt, and the edit restyles a depth video of the source from that frame and the style's plate.Possible enum values: cel-shaded-cg-anime, chunky-textured-low-poly, comic-3d, expressive-2d-animation, expressive-gouache-fashion, felt-puppet-stop-motion, graphic-cel, grotesque-street-cgi, hand-painted-cel-animation, knitted-yarn-world, neon-graphic-cinematic-3d, nighttime-anime-pixel-art, outline-free-cel, painterly-cinematic-3d, painterly-sculpted-animation, retro-game-3d, rounded-toy-cgi, sculptural-3d-fashion, textured-gouache-character-illustration, warm-painterly-3d-animation
{
"model": "sume-remix-restyle",
"video_url": "https://media.sume.com/assets/asset_b09c8d8569b347a5855baf3d90735000/source.mp4",
"duration": 10,
"resolution": "480p",
"preset_id": "knitted-yarn-world"
}Output
data.result.artifactsArtifact[]required- The generated media, in order.
data.jobJobrequired- The job record: id, status, model, input, created_at, started_at and completed_at.
Artifact
urlstringrequired- Public Sume CDN URL for the file. Do not parse the path.
typestringrequired- image, video, audio, model or file.
content_typestringrequired- The file's MIME type.
idstringrequired- Opaque artifact id, safe to log.
widthinteger- Pixels, when known.
heightinteger- Pixels, when known.
duration_msinteger- Length of a video or audio file, when known.
size_bytesinteger- File size, when known.
6. Price before you submit
The estimate is the charge: the same function prices both. This one prices the Playground's input.
const response = await fetch("https://api.sume.com/v1/open/estimate", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"model": "sume-remix-restyle",
"input": {
"video_url": "https://media.sume.com/assets/asset_b09c8d8569b347a5855baf3d90735000/source.mp4",
"duration": 10,
"resolution": "480p",
"preset_id": "knitted-yarn-world"
}
}),
});
const { data } = await response.json();
console.log(data.usd);Full reference: /docs
Remix