curl --request POST \
--url https://api.varg.ai/v2/jobs/{id}/rerun \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"step": "extend",
"overrides": {
"prompt": "the camera keeps pushing in"
}
}
'import requests
url = "https://api.varg.ai/v2/jobs/{id}/rerun"
payload = {
"step": "extend",
"overrides": { "prompt": "the camera keeps pushing in" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({step: 'extend', overrides: {prompt: 'the camera keeps pushing in'}})
};
fetch('https://api.varg.ai/v2/jobs/{id}/rerun', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.varg.ai/v2/jobs/{id}/rerun",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'step' => 'extend',
'overrides' => [
'prompt' => 'the camera keeps pushing in'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.varg.ai/v2/jobs/{id}/rerun"
payload := strings.NewReader("{\n \"step\": \"extend\",\n \"overrides\": {\n \"prompt\": \"the camera keeps pushing in\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.varg.ai/v2/jobs/{id}/rerun")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"step\": \"extend\",\n \"overrides\": {\n \"prompt\": \"the camera keeps pushing in\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/jobs/{id}/rerun")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step\": \"extend\",\n \"overrides\": {\n \"prompt\": \"the camera keeps pushing in\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "job_a1b2c3d4e5f6",
"status": "queued",
"stage": "queued",
"attempts": [
{
"n": 1,
"provider": "byteplus",
"model_key": "byteplus:dreamina-seedance-2-5-260628",
"status": "running",
"reason": "real person in the reference images",
"reason_code": "content_privacy",
"references_uploaded": 123,
"resubmitted": true,
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}
],
"tool": "tool_2001a2b3c4d5",
"input": {},
"output": {
"version": "v1",
"outputs": [
{
"url": "<string>",
"file_id": "<string>",
"media_type": "video/mp4",
"size_bytes": 123,
"thumbnail_url": "<string>",
"data": "<unknown>",
"raw": "<unknown>"
}
]
},
"error": "<string>",
"progress_message": "stitching 3/8 (40%)",
"progress": 123,
"progress_metadata": {},
"step_state": {
"current_step": "extend",
"steps": {}
},
"estimated_duration_ms": 123,
"estimated_cost_cents": 123,
"actual_cost_cents": 123,
"pricing": {
"estimated": 123,
"actual": 123,
"billing": "<string>",
"cached": true,
"billed_units": {
"images": 1
},
"pricing_id": "<string>"
},
"provider": "fal",
"provider_model": "fal:flux_schnell",
"provider_status": "<string>",
"provider_job_id": "<string>",
"completed_by_provider_model_id": "<string>",
"last_attempt_provider_model_id": "<string>",
"workspace_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"warnings": [
"<string>"
],
"urls": {
"self": "<string>",
"status": "<string>",
"refresh": "<string>",
"cancel": "<string>",
"retry": "<string>",
"confirm": "<string>",
"rerun": "<string>"
}
}Re-run a finished pipeline job from a later step
Regenerates one step of a finished multi-step pipeline job (“redo part
2”) without paying for the earlier steps again. Creates a new job
with the source job’s input (plus overrides); the steps before step
are carried over from the source job at no cost, and only step and
the steps after it run and bill. The source job is not changed.
The source job must be finished (completed, failed or cancelled)
and be a multi-step pipeline job. step must be a later step of that
pipeline, not the first one (re-running the first step is a new
pipeline job). overrides cannot switch the pipeline model.
The response is the same as creating a pipeline job: 202 with the new
job, or 200 when Idempotency-Key matches an existing job. Errors of
the pipeline create path (insufficient balance, rate limits) apply too.
curl --request POST \
--url https://api.varg.ai/v2/jobs/{id}/rerun \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"step": "extend",
"overrides": {
"prompt": "the camera keeps pushing in"
}
}
'import requests
url = "https://api.varg.ai/v2/jobs/{id}/rerun"
payload = {
"step": "extend",
"overrides": { "prompt": "the camera keeps pushing in" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({step: 'extend', overrides: {prompt: 'the camera keeps pushing in'}})
};
fetch('https://api.varg.ai/v2/jobs/{id}/rerun', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.varg.ai/v2/jobs/{id}/rerun",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'step' => 'extend',
'overrides' => [
'prompt' => 'the camera keeps pushing in'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.varg.ai/v2/jobs/{id}/rerun"
payload := strings.NewReader("{\n \"step\": \"extend\",\n \"overrides\": {\n \"prompt\": \"the camera keeps pushing in\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.varg.ai/v2/jobs/{id}/rerun")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"step\": \"extend\",\n \"overrides\": {\n \"prompt\": \"the camera keeps pushing in\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/jobs/{id}/rerun")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step\": \"extend\",\n \"overrides\": {\n \"prompt\": \"the camera keeps pushing in\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "job_a1b2c3d4e5f6",
"status": "queued",
"stage": "queued",
"attempts": [
{
"n": 1,
"provider": "byteplus",
"model_key": "byteplus:dreamina-seedance-2-5-260628",
"status": "running",
"reason": "real person in the reference images",
"reason_code": "content_privacy",
"references_uploaded": 123,
"resubmitted": true,
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}
],
"tool": "tool_2001a2b3c4d5",
"input": {},
"output": {
"version": "v1",
"outputs": [
{
"url": "<string>",
"file_id": "<string>",
"media_type": "video/mp4",
"size_bytes": 123,
"thumbnail_url": "<string>",
"data": "<unknown>",
"raw": "<unknown>"
}
]
},
"error": "<string>",
"progress_message": "stitching 3/8 (40%)",
"progress": 123,
"progress_metadata": {},
"step_state": {
"current_step": "extend",
"steps": {}
},
"estimated_duration_ms": 123,
"estimated_cost_cents": 123,
"actual_cost_cents": 123,
"pricing": {
"estimated": 123,
"actual": 123,
"billing": "<string>",
"cached": true,
"billed_units": {
"images": 1
},
"pricing_id": "<string>"
},
"provider": "fal",
"provider_model": "fal:flux_schnell",
"provider_status": "<string>",
"provider_job_id": "<string>",
"completed_by_provider_model_id": "<string>",
"last_attempt_provider_model_id": "<string>",
"workspace_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"warnings": [
"<string>"
],
"urls": {
"self": "<string>",
"status": "<string>",
"refresh": "<string>",
"cancel": "<string>",
"retry": "<string>",
"confirm": "<string>",
"rerun": "<string>"
}
}Authorizations
varg API key (varg_...). Get one at app.varg.ai
or run bunx vargai login. App sessions may alternatively send a
Supabase JWT.
Headers
Folder id (uuid) or slug. The job's output is filed into this folder
when the job completes. An unknown folder returns 404
workspace_not_found and no job is created. If you cannot set
headers, send a top-level workspace_id field in the JSON body
instead. Not part of the generation input, so it does not affect
caching.
Body
Response
Idempotency replay — the existing job for this Idempotency-Key (no new charge).
The status only moves forward: queued → running → completed,
failed or cancelled. Everything a running job goes through —
sending to the provider, uploading references, switching to another
provider — is a stage of running; a job never goes back to
queued. (Older API builds also reported submitting; treat it as
running.)
awaiting_confirmation (multi-step pipelines only): the job finished a
step that asks for review and waits for POST /jobs/{id}/confirm. It
is not terminal.
queued, running, awaiting_confirmation, completed, failed, cancelled What the job is doing right now. null once the job is terminal, and
while the job is awaiting_confirmation.
queued— waiting for a slot; no attempt yetsubmitting— being sent to the provideruploading_references— the provider is taking the reference files into its asset library (progress_messageshowsn/m)rendering— the provider accepted the task and is generatingretrying— an attempt failed (the provider refused, failed or rate limited it); the job waits for its next attempt, usually on another provider. Seeattempts.finalizing— the result is being saved and billed
queued, submitting, uploading_references, rendering, retrying, finalizing, null Was this page helpful?