vivix-farmGenerateAPI docs

API

Pooled gateway over Vivix A1 and W1. One key of ours, accounts are handled for you.

Authentication

Send Authorization: Bearer $FARM_TOKEN on every call. The same token works for every endpoint below.

export BASE=https://vivix-farm.gabriel-salem2008.workers.dev
export FARM_TOKEN=<your token>

Upload a first frame

curl -X POST $BASE/v1/files/images \
  -H "Authorization: Bearer $FARM_TOKEN" \
  -F file=@frame.png

Returns data.url. Use 1280x672 (landscape) or 672x1280 (portrait) for 720p. Max 10 MB.

A1 — avatar, silent

Animates the character in your image. With no dialogue the gateway attaches a silent audio track, so the clip has no speech at all.

curl -X POST $BASE/v1/videos/generations \
  -H "Authorization: Bearer $FARM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "vivix-a1",
    "prompt": "A presenter turns slightly and gestures, soft window light",
    "first_frame_image": "<url from upload>",
    "seconds": 6,
    "resolution": "720p"
  }'

Add "dialogue": "..." plus "voice_id" only if you want speech. Voices: JBFqnCBsd6RMkjVDRZzb (m), IKne3meq5aSn9XLyUdCD (m), cgSgspJ2msm6clMCkdW9 (f).

W1 — world / scene

Builds a whole scene from the prompt. seconds must be 5–15. first_frame_image is optional and pins the opening frame. W1 bills W credits (1 per second on vivix-w1), which are separate from A credits.

curl -X POST $BASE/v1/videos/generations \
  -H "Authorization: Bearer $FARM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "vivix-w1",
    "prompt": "A traveler crosses a salt flat at sunset, camera pulls back, one continuous shot",
    "seconds": 8,
    "aspect_ratio": "16:9"
  }'

W credits come from the onboarding survey (+120 per account) and are granted automatically once a Turnstile solver key is configured. Without one, W1 jobs stay queued instead of failing.

Faster, pricier variants: vivix-w1-fast (3/s), vivix-w1-ultrafast (4/s).

Poll a job

curl $BASE/v1/videos/generations/<video_id> \
  -H "Authorization: Bearer $FARM_TOKEN"

Poll every 3–5 s. data.status is queued / processing / succeeded / failed. Play or download data.playback_url when it succeeds (HLS for A1, MP4 for W1).

Errors

codemeaning
401bad or missing token
400missing first_frame_image on A1, or bad seconds
data.errorupstream failure, echoed verbatim

Capacity and credit errors are retried internally, so a queued job rarely needs a resubmit.

Admin

GET  $BASE/admin/pool              pool size, credits, banned domains
POST $BASE/admin/replenish?n=5     queue N new accounts
POST $BASE/admin/retry/<id>        requeue a failed job
POST $BASE/admin/survey             {acctId, token} claim the survey bonus with your own token

Limits

Throughput is bounded by pooled credits: 600 A credits per account (~10 min of 720p) and 120 W credits. The cron keeps at least 6 funded accounts and retires drained ones, so sustained load keeps refilling on its own.