Terza Inference
START

Media tasks

One asynchronous API for video, images, music and sound, whatever upstream a miner uses. Submit a task, poll it, download the outputs.

Create a task

curl https://terza.si/v1/media/tasks \
  -H "Authorization: Bearer $TERZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "operation": "image_to_video",
    "prompt": "A paper boat drifting down a rainy street",
    "inputs": [{"role": "first_frame", "media": "data:image/png;base64,..."}],
    "params": {"duration_seconds": 5, "resolution": "1080p", "audio": true}
  }'

The response is 202 with a task object (status: "queued"). Poll GET /v1/media/tasks/ID until succeeded or failed, then download each file from GET /v1/media/tasks/ID/outputs/N. Outputs are kept for 24 hours.

Operations

OperationInputsOutput
text_to_videopromptvideo
image_to_videofirst_framevideo
frames_to_videofirst_frame, last_framevideo
reference_to_videoreference_image and/or reference_videovideo
video_extendsource_videovideo
video_editsource_video, optional reference_image, maskvideo
lip_syncsource_video, plus audio or a script as promptvideo
text_to_imageprompt, optional reference_imageimage
image_editsource_image, optional maskimage
text_to_musicprompt and/or params.lyricsaudio
sound_effectprompt, optional source_videoaudio

Inputs, params and options

  • Inputs are inline data: URIs (images up to 24 MiB, video and audio up to 64 MiB, 96 MiB per request), or {"task_output": "TASK_ID#N"} to reuse an output of your own earlier task. External URLs are not accepted.
  • Params are a fixed set: duration_seconds, resolution (480p–2160p), aspect_ratio, count (1–4), seed, audio, lyrics, instrumental, style.
  • Options are model-specific settings the model declares (for example a camera motion). Anything a model has not declared is rejected before you are charged.

Billing

Each model quotes rates per task, per output, or per second of output, optionally by resolution and other settings. The maximum is reserved when you submit. When the task finishes, the gateway downloads and measures every output itself: type, count, duration and resolution. You pay for what was measured, never more than the reservation.

An output that does not match your request (wrong type, fewer outputs, shorter than 90% of the requested duration, lower resolution, or missing audio you asked for) fails the task with nonconforming_output, and you are not charged.

Task errors

CodeMeaning
nonconforming_outputThe output did not match the request. No charge.
miner_failedThe miner or its upstream failed. No charge.
timeoutNot finished within the model’s declared maximum wait. No charge.