Route Operation
curl --request POST \
--url https://api.example.com/api/v1/assets/route \
--header 'Content-Type: application/json' \
--data '
{
"kind": "<string>",
"target_codec": "h264",
"source_codec": "h264",
"op": "encode",
"width": 1920,
"height": 1080,
"duration_ms": 0,
"bit_depth": 8,
"is_deliverable": false,
"is_batch": false,
"hdr": false,
"dolby_vision": false,
"hdr10_plus": false,
"client_caps": {
"hw_h264": false,
"hw_vp9": false,
"hw_av1": false,
"hw_av1_10bit": false,
"hw_hevc": false,
"webgpu": false,
"max_pixels": 2073600
}
}
'import requests
url = "https://api.example.com/api/v1/assets/route"
payload = {
"kind": "<string>",
"target_codec": "h264",
"source_codec": "h264",
"op": "encode",
"width": 1920,
"height": 1080,
"duration_ms": 0,
"bit_depth": 8,
"is_deliverable": False,
"is_batch": False,
"hdr": False,
"dolby_vision": False,
"hdr10_plus": False,
"client_caps": {
"hw_h264": False,
"hw_vp9": False,
"hw_av1": False,
"hw_av1_10bit": False,
"hw_hevc": False,
"webgpu": False,
"max_pixels": 2073600
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
kind: '<string>',
target_codec: 'h264',
source_codec: 'h264',
op: 'encode',
width: 1920,
height: 1080,
duration_ms: 0,
bit_depth: 8,
is_deliverable: false,
is_batch: false,
hdr: false,
dolby_vision: false,
hdr10_plus: false,
client_caps: {
hw_h264: false,
hw_vp9: false,
hw_av1: false,
hw_av1_10bit: false,
hw_hevc: false,
webgpu: false,
max_pixels: 2073600
}
})
};
fetch('https://api.example.com/api/v1/assets/route', 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.example.com/api/v1/assets/route",
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([
'kind' => '<string>',
'target_codec' => 'h264',
'source_codec' => 'h264',
'op' => 'encode',
'width' => 1920,
'height' => 1080,
'duration_ms' => 0,
'bit_depth' => 8,
'is_deliverable' => false,
'is_batch' => false,
'hdr' => false,
'dolby_vision' => false,
'hdr10_plus' => false,
'client_caps' => [
'hw_h264' => false,
'hw_vp9' => false,
'hw_av1' => false,
'hw_av1_10bit' => false,
'hw_hevc' => false,
'webgpu' => false,
'max_pixels' => 2073600
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/assets/route"
payload := strings.NewReader("{\n \"kind\": \"<string>\",\n \"target_codec\": \"h264\",\n \"source_codec\": \"h264\",\n \"op\": \"encode\",\n \"width\": 1920,\n \"height\": 1080,\n \"duration_ms\": 0,\n \"bit_depth\": 8,\n \"is_deliverable\": false,\n \"is_batch\": false,\n \"hdr\": false,\n \"dolby_vision\": false,\n \"hdr10_plus\": false,\n \"client_caps\": {\n \"hw_h264\": false,\n \"hw_vp9\": false,\n \"hw_av1\": false,\n \"hw_av1_10bit\": false,\n \"hw_hevc\": false,\n \"webgpu\": false,\n \"max_pixels\": 2073600\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/assets/route")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"<string>\",\n \"target_codec\": \"h264\",\n \"source_codec\": \"h264\",\n \"op\": \"encode\",\n \"width\": 1920,\n \"height\": 1080,\n \"duration_ms\": 0,\n \"bit_depth\": 8,\n \"is_deliverable\": false,\n \"is_batch\": false,\n \"hdr\": false,\n \"dolby_vision\": false,\n \"hdr10_plus\": false,\n \"client_caps\": {\n \"hw_h264\": false,\n \"hw_vp9\": false,\n \"hw_av1\": false,\n \"hw_av1_10bit\": false,\n \"hw_hevc\": false,\n \"webgpu\": false,\n \"max_pixels\": 2073600\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assets/route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"<string>\",\n \"target_codec\": \"h264\",\n \"source_codec\": \"h264\",\n \"op\": \"encode\",\n \"width\": 1920,\n \"height\": 1080,\n \"duration_ms\": 0,\n \"bit_depth\": 8,\n \"is_deliverable\": false,\n \"is_batch\": false,\n \"hdr\": false,\n \"dolby_vision\": false,\n \"hdr10_plus\": false,\n \"client_caps\": {\n \"hw_h264\": false,\n \"hw_vp9\": false,\n \"hw_av1\": false,\n \"hw_av1_10bit\": false,\n \"hw_hevc\": false,\n \"webgpu\": false,\n \"max_pixels\": 2073600\n }\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}media
Route Operation
Authoritative client-vs-server routing decision for a media op (doc 09 §2.2). The browser calls this with its probed capabilities to confirm the fast path before running WebCodecs; a headless caller (no client_caps) always routes to the server. Entitlements come from the caller’s plan (HEVC/E-AC-3/AC-4 gating).
POST
/
api
/
v1
/
assets
/
route
Route Operation
curl --request POST \
--url https://api.example.com/api/v1/assets/route \
--header 'Content-Type: application/json' \
--data '
{
"kind": "<string>",
"target_codec": "h264",
"source_codec": "h264",
"op": "encode",
"width": 1920,
"height": 1080,
"duration_ms": 0,
"bit_depth": 8,
"is_deliverable": false,
"is_batch": false,
"hdr": false,
"dolby_vision": false,
"hdr10_plus": false,
"client_caps": {
"hw_h264": false,
"hw_vp9": false,
"hw_av1": false,
"hw_av1_10bit": false,
"hw_hevc": false,
"webgpu": false,
"max_pixels": 2073600
}
}
'import requests
url = "https://api.example.com/api/v1/assets/route"
payload = {
"kind": "<string>",
"target_codec": "h264",
"source_codec": "h264",
"op": "encode",
"width": 1920,
"height": 1080,
"duration_ms": 0,
"bit_depth": 8,
"is_deliverable": False,
"is_batch": False,
"hdr": False,
"dolby_vision": False,
"hdr10_plus": False,
"client_caps": {
"hw_h264": False,
"hw_vp9": False,
"hw_av1": False,
"hw_av1_10bit": False,
"hw_hevc": False,
"webgpu": False,
"max_pixels": 2073600
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
kind: '<string>',
target_codec: 'h264',
source_codec: 'h264',
op: 'encode',
width: 1920,
height: 1080,
duration_ms: 0,
bit_depth: 8,
is_deliverable: false,
is_batch: false,
hdr: false,
dolby_vision: false,
hdr10_plus: false,
client_caps: {
hw_h264: false,
hw_vp9: false,
hw_av1: false,
hw_av1_10bit: false,
hw_hevc: false,
webgpu: false,
max_pixels: 2073600
}
})
};
fetch('https://api.example.com/api/v1/assets/route', 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.example.com/api/v1/assets/route",
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([
'kind' => '<string>',
'target_codec' => 'h264',
'source_codec' => 'h264',
'op' => 'encode',
'width' => 1920,
'height' => 1080,
'duration_ms' => 0,
'bit_depth' => 8,
'is_deliverable' => false,
'is_batch' => false,
'hdr' => false,
'dolby_vision' => false,
'hdr10_plus' => false,
'client_caps' => [
'hw_h264' => false,
'hw_vp9' => false,
'hw_av1' => false,
'hw_av1_10bit' => false,
'hw_hevc' => false,
'webgpu' => false,
'max_pixels' => 2073600
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/assets/route"
payload := strings.NewReader("{\n \"kind\": \"<string>\",\n \"target_codec\": \"h264\",\n \"source_codec\": \"h264\",\n \"op\": \"encode\",\n \"width\": 1920,\n \"height\": 1080,\n \"duration_ms\": 0,\n \"bit_depth\": 8,\n \"is_deliverable\": false,\n \"is_batch\": false,\n \"hdr\": false,\n \"dolby_vision\": false,\n \"hdr10_plus\": false,\n \"client_caps\": {\n \"hw_h264\": false,\n \"hw_vp9\": false,\n \"hw_av1\": false,\n \"hw_av1_10bit\": false,\n \"hw_hevc\": false,\n \"webgpu\": false,\n \"max_pixels\": 2073600\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/assets/route")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"<string>\",\n \"target_codec\": \"h264\",\n \"source_codec\": \"h264\",\n \"op\": \"encode\",\n \"width\": 1920,\n \"height\": 1080,\n \"duration_ms\": 0,\n \"bit_depth\": 8,\n \"is_deliverable\": false,\n \"is_batch\": false,\n \"hdr\": false,\n \"dolby_vision\": false,\n \"hdr10_plus\": false,\n \"client_caps\": {\n \"hw_h264\": false,\n \"hw_vp9\": false,\n \"hw_av1\": false,\n \"hw_av1_10bit\": false,\n \"hw_hevc\": false,\n \"webgpu\": false,\n \"max_pixels\": 2073600\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assets/route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"<string>\",\n \"target_codec\": \"h264\",\n \"source_codec\": \"h264\",\n \"op\": \"encode\",\n \"width\": 1920,\n \"height\": 1080,\n \"duration_ms\": 0,\n \"bit_depth\": 8,\n \"is_deliverable\": false,\n \"is_batch\": false,\n \"hdr\": false,\n \"dolby_vision\": false,\n \"hdr10_plus\": false,\n \"client_caps\": {\n \"hw_h264\": false,\n \"hw_vp9\": false,\n \"hw_av1\": false,\n \"hw_av1_10bit\": false,\n \"hw_hevc\": false,\n \"webgpu\": false,\n \"max_pixels\": 2073600\n }\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
A media op + the caller's client capabilities. The server returns the AUTHORITATIVE plan (the client mirrors the same logic but the server's verdict wins).
The browser's probed WebCodecs/WebGPU capabilities (advisory; None ⇒ headless).
Show child attributes
Show child attributes
Response
Successful Response
The response is of type Response Route Operation Api V1 Assets Route Post · object.
⌘I