endpoint
GET

/api/cogs/predictions/{id}

Poll a prediction by id — status, output, cost, timing

auth: API keybase https://app.nz
Request
curl -s "https://app.nz/api/cogs/predictions/{id}" \
  -H "Authorization: Bearer pk_live_..."

Cogs API — GPU model hosting

Run an arbitrary Cog (Replicate-style) container as an autoscaling, scale-to-zero GPU inference endpoint. Register a model once (image, hardware, optional input schema); the first prediction cold-starts a GPU pod (RunPod on-demand instances under the hood, or free local GPU headroom when the host opts in), proxies to the container’s /predictions endpoint, and an idle reaper scales it back to zero — an idle model costs nothing. Every prediction is billed at machine time times the same platform markup used across app.nz. GET /api/cogs/config is public so the studio can render before sign-in. One-click deploy: link (or badge) any cog with https://app.nz/deploy?image=…&name=…&hardware=… — the studio opens pre-filled, one press to register. Media in and out ride the JSON body as data: URIs or https URLs, so audio-to-audio models work first-class: the audex-s2s template (NVIDIA Nemotron-Labs-Audex-2B, source replicatecog/appnz-audex-s2s) takes a spoken turn and returns transcript, reply text, and reply audio in one prediction — it powers /spaces/audio-to-audio.

POST /api/cogs body
name*stringModel display name.
image*stringContainer image, e.g. r8.im/owner/model or your own registry image.
hardwarestringA GPU machine id (gpu-t4, gpu-rtx3090, gpu-rtx4090, gpu-a40, gpu-l40s, gpu-a100, gpu-h100), or "auto"/omitted to pick the cheapest GPU that fits minVramGb.
schemaobjectOptional { inputs: [{name,type,description,default,required,choices,min,max,order}], outputKind }. Omitted schemas are introspected from the container’s /openapi.json on first warm-up.
idleSecondsintegerIdle window before scale-to-zero (default 120).
minVramGbintegerModel’s VRAM floor, used for auto hardware selection.
Register fast-vfx and run a prediction
curl -sX POST https://app.nz/api/cogs \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"name":"fast-vfx","image":"r8.im/lee101/fast-vfx","hardware":"gpu-rtx4090"}'
# -> {"model":{"id":"cog_...","status":"idle",...}}

curl -sX POST https://app.nz/api/cogs/cog_.../predict \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"input":{"video":"https://example.com/clip.mp4","num_levels":25}}'
# -> {"prediction":{"id":"pred_...","status":"starting"}}

# Poll for the result (a cold start can take a couple of minutes)
curl -s https://app.nz/api/cogs/predictions/pred_... \
  -H "Authorization: Bearer pk_live_..."

# Audio-to-audio (audex-s2s template): one spoken turn per prediction
curl -sX POST https://app.nz/api/cogs/cog_.../predict \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"input":{"task":"converse","audio":"data:audio/webm;base64,...","system_prompt":"You are a cheerful pirate captain."}}'
# -> output: {"transcript":"...","response_text":"...","audio":"data:audio/mpeg;base64,..."}