VORQ Docs
Reference

Raw mappings

The request and response fields of a raw backend mapping, the template language, media results and the media policy keys.

A raw mapping describes a backend call directly. It takes the shared backend keys too.

backend:
  request:
    method: POST
    url: https://queue.example.com/v1/generate
    headers: { Authorization: "Key env:QUEUE_BACKEND_KEY" }
    body: { prompt: "{input.prompt}", num_images: "{input.num_images}" }
  response:
    mode: poll
    poll:
      status_url: "$.status_url"
      status_field: "$.status"
      done_values: [COMPLETED]
      failed_values: [FAILED]
      interval_s: 2
    result:
      media_urls: "$.images[*].url"

request

KeyMeaning
methodHTTP method. Default POST.
urlTemplated URL.
headersTemplated header map.
bodyTemplated JSON object or top-level array. Not sent with GET.
prepareRequests to run before the submit. See prepare.

prepare

A list of steps, run in order before the submit. Each step is a templated request.

KeyMeaning
nameRequired. A plain identifier, unique among the steps.
urlRequired.
method, headers, bodyAs in request.
extractRequired. Map of key to a $. JSONPath into the step's answer. Available later as {prepare.<name>.<key>}.
whenDot-path such as input.image. The step is skipped when it resolves to nothing or null.
for_eachDot-path to a list such as input.reference_images. The step runs once per element, in scope as {item}, and {prepare.<name>} is the list of results. Replaces when.

A step that runs but whose answer lacks an extract value fails the job. Steps are not run again when a poll is resumed after a restart.

response

KeyMeaning
modeRequired. sync: the submit answer is the result. poll: poll until done.
pollRequired with mode: poll. See poll.
resultRequired. See result.
okFor backends that report failure in the body. See ok.

poll

KeyMeaning
status_urlJSONPath into the submit answer yielding a URL to GET. Exactly one of status_url or request.
requestTemplated poll request. {submit.…} reads the submit answer.
handleWith request only. JSONPath into the submit answer naming the job at the backend, in scope as {handle}. Recorded in state_db so a restart resumes the poll. A poll request with handle cannot use {submit.…}.
status_fieldJSONPath into each poll answer giving the status.
done_valuesStatuses that end the poll with the result.
failed_valuesStatuses that fail the job.
failure_codeJSONPath to the backend's error code on a failed status; added to the failure reason.
failure_messageJSONPath to the backend's error message on a failed status; logged only.
interval_sFixed seconds between polls.
max_pollsPolls per SLA window when interval_s is unset: interval = sla / max_polls, at least 1 second. Default 60.
timeout_sGive up polling after this many seconds (retryable). Default: the job's deadline.

A poll tick that fails with a retryable error is absorbed and polled again; it never causes a second submit.

result

Exactly one of text, media_urls or media_b64.

KeyMeaning
textJSONPath to the output text. Requires completion_tokens.
completion_tokensJSONPath to the output token count that is settled.
media_urlsJSONPath to output URLs (absolute http(s)); the daemon downloads each.
media_b64JSONPath to base64 outputs; the daemon decodes each.
content_typeMedia only. Scalar JSONPath to the output media type.
seedMedia only. JSONPath to the seed the backend used. Default: the request's seed.

A media result's type is, in order: the content_type value, the type detected from the bytes, the type the file was served with, application/octet-stream.

ok

response:
  ok: { field: "$.code", values: [200], retry: [429, 503], message: "$.msg" }

field is a JSONPath evaluated on every JSON answer (prepare steps, submit, poll ticks); values is the non-empty list meaning success; retry lists values that are retried; message is a JSONPath logged, never sent. Other values fail the job. An answer without the field passes.

Template language

Strings in request, prepare and poll.request are rendered per job.

TokenValue
{input.<path>}A field of the job's decoded input, e.g. {input.prompt}, {input.image.b64}.
{job.id}, {job.owner}The job id and the address that posted it.
{job.units_out}The job's output cap in its unit (tokens, pixels or pixel-seconds).
{job.modality}The job's modality.
{submit.<path>}The submit answer, in a poll request.
{handle}The recorded handle, in a poll request.
{prepare.<name>.<key>}A value extracted by a prepare step.
{item}The current element, in a for_each step.
{uuid}A new random UUIDv4.
  • A string that is exactly one token keeps the value's JSON type; embedded tokens are stringified.
  • A trailing ? ({input.end_image.b64?}) marks a token as optional. If it resolves to nothing, the key or list element holding it is omitted. An embedded optional token that is missing drops the whole string. A list whose elements all drop is omitted.
  • A token without ? that resolves to nothing fails the job, naming the token.
  • A wildcard token ({prepare.clips[*].url}) renders a list; as a list element it is spliced in.
  • env:NAME works inside any string and is resolved at load.
  • Presets also expose their params ({base_url}, {model}, {api_key}) in headers. Raw mappings have no such params.

JSONPath. $. values are evaluated against answers. A wildcard ([*]) returns a list, otherwise the first match. A path that continues past a string field parses that string as JSON, for APIs that return JSON inside a string:

# { "data": { "result": "{\"urls\": [\"https://…/out.mp4\"]}" } }
media_urls: "$.data.result.urls[*]"

Media results

The sealed result of an image job:

{"images": [{"b64": "…", "content_type": "image/png", "width": 1024, "height": 1024}],
 "units": 1048576, "seed": 42, "vorq": {"job_id": "0x…"}}

A video job carries one video object with duration_secs instead of images. width, height and duration_secs are read from the delivered file's header (PNG, JPEG, WebP, MP4); if it cannot be read, the priced dimensions are used. units is the settled count: delivered pixels (times seconds), capped at the order's output limit.

Media policy

These keys sit on the backend block (preset or raw) and apply to image and video jobs. Every refusal happens before any upload or submit, and hands the job back for a refund.

KeyMeaning
param_capsMap of param to numeric ceiling, e.g. {steps: 40, fps: 24}.
resolutionsNon-empty list of tiers the backend renders, from 480p, 720p, 1080p, 4k. A request naming another tier, or raw pixels, is handed back.
durationsNon-empty list of whole-second clip lengths. A clip is lowered to the longest listed length its order covers, or handed back if none fits.
auto_durationValue sent as the duration when the client asks the model to choose. Without it such requests are handed back.
adaptive_aspectValue sent as aspect_ratio when the client asks to keep the reference's shape. Without it such requests are handed back.
reference.acceptNon-empty list narrowing the reference types taken, from image/png, image/jpeg, image/webp, video/mp4, audio/mpeg, audio/wav. Omit reference to take all.
reference.still, reference.clip, reference.audioBounds per kind of reference: min_side, max_side, min_ratio, max_ratio (width ÷ height), min_pixels, max_pixels, min_secs, max_secs, max_total_secs, max_bytes, max_count. Audio is only bounded by max_bytes and max_count.

image, end_image and reference_images are stills; video and reference_videos are clips; reference_audios is audio. Each reference is decoded and must have no more pixels and no longer runtime than the client declared, and together they must not exceed the order's input units. Areas are compared, not sides, so a rotated frame is accepted. Clip lengths are rounded up to whole seconds after a 100 ms allowance.

On this page