Media Jobs

POST /v1/jobs — the async API for video, image, and audio models: submit with the model in the body, poll until completed, read outputs and exact cost.

Submit a job

Media generation is asynchronous. Submit the model id and input in the body — same mental model as chat/completions, one endpoint for every media model.

curl https://api.companyfabric.com/v1/jobs \
  -H "Authorization: Bearer $COMPANYFABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bytedance/seedance-2-5-text-to-video",
    "input": { "prompt": "A slow dolly-in on a matte-black espresso machine." }
  }'
# → { "id": "job_abc123", "object": "job", "status": "queued", … }

Poll for the result

Poll GET /v1/jobs/{id} with backoff. Status moves queued → processing → completed | failed | cancelled. On completion the response carries outputs (URLs) and cost_usd — the exact metered price of the run.

curl https://api.companyfabric.com/v1/jobs/job_abc123 \
  -H "Authorization: Bearer $COMPANYFABRIC_API_KEY"
# → { "status": "completed", "outputs": [{ "url": "…", "type": "video" }], "cost_usd": 0.27 }

Webhooks instead of polling

Pass webhook_url at submit time and the terminal state is POSTed to you — no polling loop. Poll access stays available either way.

Input fields

  • prompt — text prompt (all models)
  • image_url — source image for image-to-video / editing models
  • duration_seconds — clip length where the model supports it
  • resolution — output resolution where the model supports it