aisplice

API reference

Videos

POST/v1/videos
GET/v1/videos/{task_id}
GET/v1/videos/{task_id}/content

Async video generation (Seedance, Kling, Veo, Wan, Grok Imagine …). /v1/videos accepts text-to-video and image-to-video inputs in one OpenAI-shaped request. It returns a task_id you poll — or register a webhook at submit time.

#Request parameters

  • modelstringrequired

    A video model ID from the models page, e.g. doubao-seedance-2.5.

  • promptstringrequired

    Scene description; for image2video it steers the motion.

  • imagestringoptional

    image2video only: first-frame image as URL or base64.

  • imagesarrayoptional

    Reference frames for vendors that accept multiple images in one task.

  • durationnumberoptional

    Clip length in seconds — a pricing-tier dimension; supported values per model card.

  • secondsnumberoptional

    Alias used by some model families for clip length; treat duration as the preferred field.

  • resolutionstringoptional

    Output resolution tier such as 720p or 1080p when the model exposes it.

  • sizestringoptional

    Aspect-ratio or size selector for model families that use width x height style sizing.

  • webhook_urlstringoptional

    HTTPS URL called once the task reaches a terminal state — see the video guide for the callback contract.

  • webhook_secretstringoptional

    If set, deliveries carry X-Xiaoxiang-Signature: sha256=hex(HMAC-SHA256(body, secret)).

Vendor pass-through

Model families accept extra vendor parameters (aspect_ratio, cfg_scale, negative_prompt …) that pass through unchanged — the model card documents them; unknown fields are rejected upstream, not by the gateway.

Failed tasks refund automatically

Video tasks pre-charge at submit and refund in full if the task ends in failed — the ledger records the refund with a link back to the original charge.

#Cancel a running task

DELETE/v1/videos/:task_id

Stops a task that has not reached a terminal state. On success the reserved quota is refunded, the task is recorded as failed with the reason "cancelled by user", and any webhook you registered fires as task.failed.

Most providers cannot cancel

Cancellation is forwarded to the upstream provider, and only some expose it. Everything else answers 501 task_cancel_not_supported. Treat cancelling as best-effort in your UI: keep polling, and do not promise the user a refund before the call returns 200.
curl -X DELETE https://www.aisplice.store/v1/videos/task_xxx \
  -H "Authorization: Bearer sk-YOUR_KEY"
cancelled.json
{
  "id": "task_xxx",
  "task_id": "task_xxx",
  "status": "cancelled"
}

Note that "cancelled" appears only in this response. A later poll reports the task as failed, because that is the state it was moved to.

  • 404 task_not_existUnknown task id, or it belongs to another account.
  • 409 task_not_cancellableThe task already finished — there is nothing to stop.
  • 501 task_cancel_not_supportedThis provider exposes no cancellation API.

Full error-code table →

#Remix an existing video

POST/v1/videos/:video_id/remix

Re-renders a finished video with a new prompt, on models that support it. Send prompt and nothing else: the model, duration, resolution and pricing factors are all inherited from the original task, and the request is pinned to the channel that produced it.

curl https://www.aisplice.store/v1/videos/task_xxx/remix \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: remix-of-task_xxx" \
  -d '{"prompt": "Same shot, at night"}'
remix.json
{
  "task_id": "task_yyy",
  "status": "queued",
  "remixed_from_video_id": "task_xxx"
}

A remix is a new billable task

It costs what the original cost, follows the same lifecycle, and returns its own task_id. Poll the new id — the original is untouched.
  • 400 invalid_requestprompt is required on a remix.
  • 400 task_not_existThe source video id is unknown or belongs to another account.
  • 400 task_channel_disableThe channel that produced the original video is no longer enabled.

Full error-code table →

#Related errors

  • 404 not_foundUnknown path, unknown model name, or an expired / foreign task_id.
  • 422 unprocessable_entityThe vendor rejected parameter values the gateway forwarded (e.g. unsupported size or duration).
  • 401Invalid or missing bearer token. No error.code on this path — match the status.
  • 402 insufficient_user_quotaWallet balance cannot cover the pre-reserved estimate.
  • 429Per-key throttle. Empty body; wait for Retry-After. A 429 that does carry insufficient_user_quota is a daily spend cap instead.
  • 503 model_not_foundUnknown model, or no healthy channel serves it right now.

Full error-code table →

#Request example

# submit
curl https://www.aisplice.store/v1/videos \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "doubao-seedance-2.5", "prompt": "A drone shot of a lighthouse at dawn"}'

# poll every 5s
curl https://www.aisplice.store/v1/videos/$TASK_ID -H "Authorization: Bearer sk-YOUR_KEY"

# download when completed
curl -L https://www.aisplice.store/v1/videos/$TASK_ID/content -o out.mp4 -H "Authorization: Bearer sk-YOUR_KEY"

#Response

response.json
// POST — submit accepted
{"task_id": "task_xxx", "status": "queued"}

// GET /v1/videos/{task_id}
{
  "task_id": "task_xxx",
  "status": "in_progress",      // queued | in_progress | completed | failed
  "progress": "45%"
}

// terminal state
{
  "task_id": "task_xxx",
  "status": "completed",
  "metadata": {"url": "https://…"}
}

Still stuck?

Send us the request ID or the error message and we will look into it.