UGC Video API: Generate AI Videos via REST API

First video free, no card

Developer

Most AI video tools lock you into a browser. agent-media exposes a public REST API. Send a prompt, get back a finished MP4 with native audio and subtitles burned in. Bearer token auth. JSON responses. Standard polling flow. See pricing.

Authentication

Every request requires a Bearer token. Generate an API key from your dashboard. Keys start with ma_ and are scoped to your account.

Authorization: Bearer ma_your_api_key_here

All endpoints return JSON. Error responses include a message field with a human-readable explanation.

API Endpoints

POST /api/v2/generate/video

Submit a video generation job. Returns a job ID immediately. The video renders asynchronously. Poll the status endpoint to check progress.

curl -X POST https://agent-media.ai/api/v2/generate/video \\
  -H "Authorization: Bearer ma_your_api_key" \\
  -H "Content-Type: application/json" \\
  -d '{
    "prompt": "Stop scrolling. This app saves me two hours every morning.",
    "seconds": 10,
    "aspect": "9:16"
  }'

Response (202 Accepted)

{
  "job_id": "job_abc123",
  "status": "submitted",
  "kind": "video",
  "model": "seedance-2.0",
  "credits_deducted": 600,
  "status_url": "https://agent-media.ai/api/v1/videos/job_abc123"
}

Request Body Parameters

GET /api/v1/videos/:id

Check the status of a video job. When status is completed, the output_url field contains a direct link to the MP4.

curl https://agent-media.ai/api/v1/videos/job_abc123 \\
  -H "Authorization: Bearer ma_your_api_key"

Response (completed)

{
  "id": "job_abc123",
  "status": "completed",
  "output_url": "https://media.agent-media.ai/videos/job_abc123.mp4",
  "duration": 10,
  "credits_charged": 600,
  "created_at": "2026-04-15T10:30:00Z",
  "completed_at": "2026-04-15T10:32:15Z"
}

Polling Flow: Submit, Poll, Download

Video generation takes 1 to 3 minutes. The recommended pattern: submit the job, then poll every 10 seconds until the status is completed or failed.

# Submit the video
JOB_ID=$(curl -s -X POST https://agent-media.ai/api/v2/generate/video \\
  -H "Authorization: Bearer ma_your_api_key" \\
  -H "Content-Type: application/json" \\
  -d '{"prompt":"This changed everything for me.","seconds":10,"aspect":"9:16"}' \\
  | jq -r '.job_id')

echo "Submitted: $JOB_ID"

# Poll until done
while true; do
  STATUS=$(curl -s https://agent-media.ai/api/v1/videos/$JOB_ID \\
    -H "Authorization: Bearer ma_your_api_key" \\
    | jq -r '.status')

  echo "Status: $STATUS"

  if [ "$STATUS" = "completed" ]; then
    OUTPUT=$(curl -s https://agent-media.ai/api/v1/videos/$JOB_ID \\
      -H "Authorization: Bearer ma_your_api_key" \\
      | jq -r '.output_url')
    echo "Download: $OUTPUT"
    break
  fi

  if [ "$STATUS" = "failed" ]; then
    echo "Video generation failed."
    break
  fi

  sleep 10
done

Status values: processing (rendering in progress), completed (MP4 ready at output_url), failed (check the error field for details).

API Pricing

The API uses the same credit system as the CLI and dashboard. generate_video on seedance-2.0 costs 30 credits per second at 480p, 60 credits per second at 720p (the default), or 150 credits per second at 1080p. The seedance-2.5 engine, the default, costs 60, 125, or 225 credits per second at those same tiers (its default is 480p). A finished talking-head video with a generated person and captions is 45 credits plus 28 per second (325 credits for 10 seconds). Failed jobs are refunded automatically.

AI script generation adds 5 credits per request. View full pricing plans.

Why the agent-media API

Related Pages

Last updated: April 2026

What do you sell?

First video free, no card