API reference / Renders

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 keyrequired

    API key from the developer console.

  • Idempotency-Keystring

    Optional. 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 null
  • versionIdstring (uuid) or null
  • One of mp4 hls frames

  • One of low medium high extraHigh

  • framesFrameRange or null
    FrameRange fields
    • startintegerrequired
    • endintegerrequired
    • One of png jpeg tga

      Default png

  • audioAudioTrack or null
    AudioTrack fields
    • pathstringrequired
    • offsetSecondsnumber

      Default 0

  • namestring or null
  • replacementsarray of Replacement or null
    Replacement fields
    • layerstringrequired
    • textstring or null
    • fontstring or null
    • pathstring or null
    • fileEditFile or null
      EditFile fields
      • pathstringrequired
      • contentstring or null
      • contentBase64string or null
      • uploadIdstring (uuid) or null
      • fromVersionIdstring (uuid) or null
      • fromPathstring or null
    • fitMediaFit or null

      One of contain cover

  • variationstring or null
  • One of h264 hevc av1

  • encodingRenderEncoding or null

    Encoder settings a render asks for; without them its quality level sets a variable bitrate.

    RenderEncoding fields
    • rateControlRateControl

      One of quality vbr cbr

    • bitrateKbpsinteger or null
    • maxBitrateKbpsinteger or null
    • keyframeIntervalSecondsnumber or null
    • h264ProfileH264Profile or null

      One of baseline main high

Try it

POST/v1/renders

Used for the requests you send from this page only. It is not saved.

This sends a real request to your workspace: a render spends render seconds, and a delete is final.

Response

Send the request to see the answer here.

Responses

  • 202 Accepted

application/json · RenderDto

  • idstring (uuid)
  • projectIdstring (uuid)
  • versionIdstring (uuid) or null
  • sourceVersionIdstring (uuid)
  • One of mp4 hls frames

  • One of low medium high extraHigh

  • framesFrameRange or null
    FrameRange fields
    • startinteger
    • endinteger
    • One of png jpeg tga

  • audioAudioTrack or null
    AudioTrack fields
    • pathstring
    • offsetSecondsnumber
  • One of queued rendering succeeded failed cancelled

  • errorApiError or null
    ApiError fields
    • codestring
    • messagestring
  • chargedSecondsinteger (int64)
  • refundedSecondsinteger (int64)
  • createdAtstring (date-time)
  • startedAtstring (date-time) or null
  • finishedAtstring (date-time) or null
  • outputRenderOutputDto or null
    RenderOutputDto fields
    • mp4Urlstring or null
    • hlsUrlstring or null
    • frameUrlsarray of string or null
    • expiresAtstring (date-time)
    • posterUrlstring or null
  • namestring or null
  • playbackPlaybackState or null

    One of preparing streaming complete

  • replacementsarray of Replacement or null

    The 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
    • layerstring
    • textstring or null
    • fontstring or null
    • pathstring or null
    • fileEditFile or null
      EditFile fields
      • pathstring
      • contentstring or null
      • contentBase64string or null
      • uploadIdstring (uuid) or null
      • fromVersionIdstring (uuid) or null
      • fromPathstring or null
    • fitMediaFit or null

      One of contain cover

  • codecVideoCodec or null

    One of h264 hevc av1

  • encodingRenderEncoding or null

    Encoder settings a render asks for; without them its quality level sets a variable bitrate.

    RenderEncoding fields
    • rateControlRateControl

      One of quality vbr cbr

    • bitrateKbpsinteger or null
    • maxBitrateKbpsinteger or null
    • keyframeIntervalSecondsnumber or null
    • h264ProfileH264Profile or null

      One of baseline main high

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

  • ApiError fields
    • codestring
    • messagestring

Errors lists the error codes and says when to retry.