# Submit and track a video task

Start a job, poll its status, and download the completed clip.

<a id="overview"></a>

## Before the request

Video generation is asynchronous: submit once, keep the returned task ID, then check the same task until it reaches a final state. This example uses seedance-2.0-fast.

Video generation uses the API. Registration is open; check your wallet balance and current top-up options, then select a compatible key group with available upstream capacity.

<a id="prepare-video"></a>

## 1. Check your group and specifications

Create a site API key in 快速生成｜Seedance Fast (seedance 2.0-fast（限时折扣）) for this example. Review the model page for current group rates and supported specifications before submitting.

- This example requests five seconds at 720p with a text prompt.
- The configured video route supports JSON and URL-reference multipart requests. Local binary uploads, draft references, and frames are not implemented.
- Duration and resolution affect estimated video tokens. Final billing uses the upstream usage when available; do not treat this as a fixed price per clip.

<a id="submit-video"></a>

## 2. Submit once and save the ID

Send the request below and save its JSON response. Read the id field from the successful response; you will use that same ID in every subsequent request.

If submission ends with an ambiguous timeout, inspect the task records before creating another job. A fresh POST can start a separate billable task.

```
export OHGROK_API_KEY='YOUR_API_KEY'

curl --fail-with-body --silent --show-error \
  'https://api.ohgrok.com/v1/videos' \
  -H "Authorization: Bearer $OHGROK_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "seedance-2.0-fast",
    "prompt": "Clouds moving slowly over a quiet mountain lake",
    "seconds": 5,
    "resolution": "720p"
  }' \
  -o video-response.json
```

<a id="check-status"></a>

## 3. Check the same task

Replace YOUR_VIDEO_ID with the id returned above. The public status can be queued, in_progress, completed, failed, or unknown. If it is still queued or in progress, wait before requesting the same task again.

Stop polling on completed or failed. An unknown status needs inspection rather than a blind resubmission. Progress is a status indicator, not a guaranteed time-to-completion estimate.

```
VIDEO_ID='YOUR_VIDEO_ID'

curl --fail-with-body --silent --show-error \
  "https://api.ohgrok.com/v1/videos/$VIDEO_ID" \
  -H "Authorization: Bearer $OHGROK_API_KEY"
```

<a id="download-video"></a>

## 4. Download the completed clip

After the same task reports completed, retrieve its content using the same site API key. A failed task should be investigated from its error and console record instead of being sent to the content endpoint.

The sample film on the landing page is an edited Big Buck Bunny excerpt, not an ohgrok-generated video or a result from this tutorial.

```
curl --fail-with-body --silent --show-error \
  "https://api.ohgrok.com/v1/videos/$VIDEO_ID/content" \
  -H "Authorization: Bearer $OHGROK_API_KEY" \
  -o result.mp4
```

