Markdown ↗

OHGROK / Integration guide

Submit and track a video task

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

On this page

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 access is API-only. An existing account with sufficient balance, a compatible key group, and available upstream capacity is required. New registration and online top-ups are currently closed.

1. Check your group and specifications

Create a site API key in the enabled 渠道1 / seedance 2.0-fast(限时折扣) group for this example. Review the model page for current rates and supported specifications; the group name is not a promise of a permanent discount.

  1. This example requests five seconds at 720p with a text prompt.
  2. The configured video route supports JSON and URL-reference multipart requests. Local binary uploads, draft references, and frames are not implemented.
  3. 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.

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.

Terminal · submit a 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

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.

Terminal · check status
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"

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.

Terminal · download result
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