Create a render
POST/v1/renders
Queues a render of one version and charges its render seconds. Send projectId to render the head of a variation (variation, or main when it is left out), or versionId alone to render that version; an empty project is refused with 422 version_not_renderable. The answer's sourceVersionId is that version. replacements change text, fonts, images or video by layer for this render only: they are checked against the version at once, and versionId stays null until the render's own version is made from them, usually within seconds; a new file comes from an upload. The answer and a read of this one render show the replacements as sent; lists, statuses, cancels, batches and webhooks leave them out. A version longer or larger than the plan allows is refused with 403 plan_limit. The body may be up to 64 MB (413 too_large). Send an Idempotency-Key header (1 to 200 characters, no '/', not starting with 'share:') to make retries safe: for 24 hours the same request with the same key answers with the same render, with the header Idempotent-Replayed: true, rendering the version the first request rendered even if the head has moved since; the same key with a different request is 422 idempotency_key_reused.
Request
curl -s -X POST $BLITFRAME/renders \
-H "Authorization: Bearer $BLITFRAME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 8974531c-0835-b000-e7fb-6210e2195bcc" \
-d '{"projectId": "3f9b2c1d-8e4a-4d7b-b6c5-2a1e0f9d8c7b", "format": "mp4", "quality": "high"}'
import os, requests
response = requests.post(
f"{os.environ['BLITFRAME']}/renders",
headers={
"Authorization": f"Bearer {os.environ['BLITFRAME_API_KEY']}",
"Idempotency-Key": "8974531c-0835-b000-e7fb-6210e2195bcc",
},
json={"projectId": "3f9b2c1d-8e4a-4d7b-b6c5-2a1e0f9d8c7b", "format": "mp4", "quality": "high"},
)
print(response.json())
const response = await fetch(`${process.env.BLITFRAME}/renders`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BLITFRAME_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "8974531c-0835-b000-e7fb-6210e2195bcc",
},
body: JSON.stringify({ projectId: "3f9b2c1d-8e4a-4d7b-b6c5-2a1e0f9d8c7b", format: "mp4", quality: "high" }),
});
console.log(await response.json());
<?php
$request = curl_init(getenv("BLITFRAME") . "/renders");
curl_setopt_array($request, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("BLITFRAME_API_KEY"),
"Content-Type: application/json",
"Idempotency-Key: 8974531c-0835-b000-e7fb-6210e2195bcc",
],
CURLOPT_POSTFIELDS => '{"projectId": "3f9b2c1d-8e4a-4d7b-b6c5-2a1e0f9d8c7b", "format": "mp4", "quality": "high"}',
]);
$response = curl_exec($request);
echo $response;
require "net/http"
uri = URI(ENV["BLITFRAME"] + '/renders')
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer " + ENV["BLITFRAME_API_KEY"]
request["Content-Type"] = "application/json"
request['Idempotency-Key'] = '8974531c-0835-b000-e7fb-6210e2195bcc'
request.body = '{"projectId": "3f9b2c1d-8e4a-4d7b-b6c5-2a1e0f9d8c7b", "format": "mp4", "quality": "high"}'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{"projectId": "3f9b2c1d-8e4a-4d7b-b6c5-2a1e0f9d8c7b", "format": "mp4", "quality": "high"}`)
request, err := http.NewRequest("POST", os.Getenv("BLITFRAME")+"/renders", body)
if err != nil {
panic(err)
}
request.Header.Set("Authorization", "Bearer "+os.Getenv("BLITFRAME_API_KEY"))
request.Header.Set("Content-Type", "application/json")
request.Header.Set("Idempotency-Key", "8974531c-0835-b000-e7fb-6210e2195bcc")
response, err := http.DefaultClient.Do(request)
if err != nil {
panic(err)
}
defer response.Body.Close()
text, _ := io.ReadAll(response.Body)
fmt.Println(string(text))
}
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post,
Environment.GetEnvironmentVariable("BLITFRAME") + "/renders");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("BLITFRAME_API_KEY"));
request.Headers.Add("Idempotency-Key", "8974531c-0835-b000-e7fb-6210e2195bcc");
request.Content = new StringContent(
"""
{"projectId": "3f9b2c1d-8e4a-4d7b-b6c5-2a1e0f9d8c7b", "format": "mp4", "quality": "high"}
""", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder(URI.create(System.getenv("BLITFRAME") + "/renders"))
.header("Authorization", "Bearer " + System.getenv("BLITFRAME_API_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "8974531c-0835-b000-e7fb-6210e2195bcc")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"projectId": "3f9b2c1d-8e4a-4d7b-b6c5-2a1e0f9d8c7b",
"format": "mp4",
"quality": "high"
}
"""))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
Headers
AuthorizationBearer Blitframe API keyrequiredAPI key from the developer console.
Idempotency-KeystringOptional. A unique key you choose for this one request, 1 to 200 characters, such as a new UUID. Send the same key again only to retry this request after a lost answer: the retry answers with what the first one made instead of doing it again. Use a new key for every other request; the key in the samples is only an example.
Body
application/json · required · CreateRenderRequest
projectIdstring (uuid) or nullversionIdstring (uuid) or nullformatRenderFormatOne of
mp4hlsframesqualityRenderQualityOne of
lowmediumhighextraHighframesFrameRange or nullFrameRange fields
startintegerrequiredendintegerrequiredformatFrameFormatOne of
pngjpegtgaDefault
png
audioAudioTrack or nullAudioTrack fields
pathstringrequiredoffsetSecondsnumberDefault
0
namestring or nullreplacementsarray of Replacement or nullReplacement fields
variationstring or nullcodecVideoCodecOne of
h264hevcav1encodingRenderEncoding or nullEncoder settings a render asks for; without them its quality level sets a variable bitrate.
RenderEncoding fields
rateControlRateControlOne of
qualityvbrcbrbitrateKbpsinteger or nullmaxBitrateKbpsinteger or nullkeyframeIntervalSecondsnumber or nullh264ProfileH264Profile or nullOne of
baselinemainhigh
Responses
- 202 Accepted
application/json · RenderDto
idstring (uuid)projectIdstring (uuid)versionIdstring (uuid) or nullsourceVersionIdstring (uuid)formatRenderFormatOne of
mp4hlsframesqualityRenderQualityOne of
lowmediumhighextraHighframesFrameRange or nullFrameRange fields
startintegerendintegerformatFrameFormatOne of
pngjpegtga
audioAudioTrack or nullAudioTrack fields
pathstringoffsetSecondsnumber
statusRenderStatusOne of
queuedrenderingsucceededfailedcancellederrorApiError or nullApiError fields
codestringmessagestring
chargedSecondsinteger (int64)refundedSecondsinteger (int64)createdAtstring (date-time)startedAtstring (date-time) or nullfinishedAtstring (date-time) or nulloutputRenderOutputDto or nullRenderOutputDto fields
mp4Urlstring or nullhlsUrlstring or nullframeUrlsarray of string or nullexpiresAtstring (date-time)posterUrlstring or null
namestring or nullplaybackPlaybackState or nullOne of
preparingstreamingcompletereplacementsarray of Replacement or nullThe replacements the render was created with. Left out unless one render is read: only the answer to creating a render and
GET /v1/renders/{renderId}carry it, and only for a render with replacements.Replacement fields
codecVideoCodec or nullOne of
h264hevcav1encodingRenderEncoding or nullEncoder settings a render asks for; without them its quality level sets a variable bitrate.
RenderEncoding fields
rateControlRateControlOne of
qualityvbrcbrbitrateKbpsinteger or nullmaxBitrateKbpsinteger or nullkeyframeIntervalSecondsnumber or nullh264ProfileH264Profile or nullOne of
baselinemainhigh
Errors
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 409 Conflict
- 413 Payload Too Large
- 422 Unprocessable Entity
- 429 Too Many Requests
application/json · ErrorResponse
errorApiErrorApiError fields
codestringmessagestring
Errors lists the error codes and says when to retry.