Skip to main content

ALLGATE / DEVELOPER WORKFLOW GUIDE

Integrate an asynchronous AI video generation API.

A video generation API usually creates a task rather than returning a finished film immediately. Build your application around submission, status polling and result retrieval. Text-to-video and image-to-video inputs depend on the selected live model and its published generation capabilities.

01 / WORKFLOW

Choose the input and supported generation settings

Start with a scene brief: subject, movement, camera direction and intended duration. Check whether your selected model accepts a text prompt, reference image, video input or another supported format. Duration, aspect ratio, resolution and audio settings must follow the model configuration. A request field appearing in an example is not evidence that every model accepts it.

02 / WORKFLOW

Submit once and persist the task ID

Send the generation request and save the returned task identifier in your application database. Associate it with your own user and job so a reload does not create a second video. Use the compatible video task API or the documented native ARK contract as appropriate; their paths and payloads differ. Never blindly repeat a paid POST because the connection timed out.

03 / WORKFLOW

Poll status, finish cleanly and recover after disconnects

Poll the saved task with bounded intervals and an overall waiting limit. Keep pending work distinguishable from a terminal failure in your UI. When generation completes, retrieve the documented result and store the asset if your product needs it later. After a network interruption, resume the status GET using the same ID. Report a failed task instead of leaving a progress spinner running forever.

Request example

This example does not execute automatically. Verify the current model and parameters, then set these environment variables on your server. Replace any YOUR_* placeholders with confirmed supported values.

Server environment
export ALLGATE_BASE_URL='https://api.allgate.ai/v1'
export ALLGATE_API_KEY='YOUR_API_KEY'
HTTP · curl
# Submit once; a lost response is not permission to repeat a paid POST.
curl --fail-with-body --silent --show-error "$ALLGATE_BASE_URL/videos/generations" \
  -H "Authorization: Bearer $ALLGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "doubao-seedance-2-0-fast",
  "prompt": "A sculptural glass sphere above a calm silver sea",
  "duration": 5,
  "resolution": "720p",
  "ratio": "16:9",
  "generate_audio": false,
  "output_format": "mp4"
}'

# Save the returned id. Resume this GET after a connection loss.
TASK_ID='YOUR_TASK_ID'
curl --fail-with-body --silent --show-error "$ALLGATE_BASE_URL/videos/generations/$TASK_ID" \
  -H "Authorization: Bearer $ALLGATE_API_KEY"

Check models and current availability

These entries come from the public catalogue build snapshot. A listing does not guarantee endpoint capability or continuing supply. For audio, verify synthesis or transcription support separately. Open a model to check its exact ID, settings and billing unit.

Catalogue snapshot:

Compare live models and API pricing →

Costs and workflow limits

Video rates can use seconds, requests or other published units. Read the exact unit and model settings before budgeting a clip. Generation time is not the same as billable video duration. A public price and a reference-library entry do not guarantee current supply; check account access and availability before enabling a production workflow.

Review API pricing and prepaid credits →

COMMON QUESTIONS

Before you integrate

Does a video request return the finished video immediately?
The asynchronous task workflow returns an identifier first. Poll its status and retrieve the result when it completes; handle both pending and failed states.
How do I recover a lost polling connection?
Keep the original task ID and resume the status GET. Do not submit a second generation request simply to recover a status response.
Do all video models support image-to-video?
No. Check the selected model’s supported inputs and settings. The live catalogue and generation configuration determine what can be submitted.