Get Video Generation Status
curl --request GET \
--url https://longstories.ai/api/v1/short \
--header 'x-api-key: <api-key>'import requests
url = "https://longstories.ai/api/v1/short"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://longstories.ai/api/v1/short', 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://longstories.ai/api/v1/short",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://longstories.ai/api/v1/short"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://longstories.ai/api/v1/short")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://longstories.ai/api/v1/short")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"status": "COMPLETED",
"isCompleted": true,
"isSuccess": true,
"output": {
"url": "https://storage.example.com/videos/abc123.mp4",
"size": 15728640
},
"error": null,
"projectId": "proj_123abc"
},
"requestId": "req_123abc"
}{
"error": {
"code": "VAL_MISSING_FIELD",
"message": "Required field is missing",
"details": {
"field": "runId",
"reason": "Run ID is required"
},
"requestId": "req_901stu"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "BIZ_RESOURCE_NOT_FOUND",
"message": "Run not found",
"requestId": "req_567yz",
"details": {
"runId": "invalid-run-id"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}API Reference
Get Video Status
Retrieves the current status of a video generation run by passing in the Run ID returned from the POST /short endpoint. Can be polled periodically to check if the video is completed.
GET
/
short
Get Video Generation Status
curl --request GET \
--url https://longstories.ai/api/v1/short \
--header 'x-api-key: <api-key>'import requests
url = "https://longstories.ai/api/v1/short"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://longstories.ai/api/v1/short', 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://longstories.ai/api/v1/short",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://longstories.ai/api/v1/short"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://longstories.ai/api/v1/short")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://longstories.ai/api/v1/short")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"status": "COMPLETED",
"isCompleted": true,
"isSuccess": true,
"output": {
"url": "https://storage.example.com/videos/abc123.mp4",
"size": 15728640
},
"error": null,
"projectId": "proj_123abc"
},
"requestId": "req_123abc"
}{
"error": {
"code": "VAL_MISSING_FIELD",
"message": "Required field is missing",
"details": {
"field": "runId",
"reason": "Run ID is required"
},
"requestId": "req_901stu"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "BIZ_RESOURCE_NOT_FOUND",
"message": "Run not found",
"requestId": "req_567yz",
"details": {
"runId": "invalid-run-id"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}Base URL
https://longstories.ai/api/v1
Authorizations
Your API key for authenticating requests. Example: 'x-api-key: MY_SECRET_KEY'
Query Parameters
The generation run ID previously returned by the POST /short call.
Response
Successfully retrieved the run's current status and, if complete, the video download URL and size.
⌘I