MirrorCast
Chen

API Service

Use the same model via HTTP in your production workflow. Create tasks, poll for status, and retrieve result URLs.

Base URL

https://api.jiyingjing.example.com

Sample address; real key not enabled

Authentication Method

Authorization: Bearer <KEY>

Use after configuring keys in "Manage → Key Management".

Request Format

application/json

Request body must be JSON; response must be JSON.

Callable capabilities

The following path is an interface contract sample; a real key has not been activated.

Text-to-Video

Convert points to seconds

Generate 5–15 second videos directly, with support for aspect ratio and duration parameters.

POST /v1/videos

Image to Video

Convert points to seconds

Generate a shot with the first frame and prompt; optionally use the last frame to close it.

POST /v1/videos/image

Text-to-Image / Image-to-Image

Points per sheet

Single or batch generation with reference images and inpainting support

POST /v1/images

Video Super-Resolution

Convert points to seconds

Generative upscaling to 2K, preserving original frame rate and audio track.

POST /v1/videos/upscale

Music Generation

Pay-per-use

Generate background music by mood and duration. Includes commercial-use licensing tag.

POST /v1/music

Task Query

No charge

Poll task status and result URL; supports batch queries

GET /v1/tasks/{id}

Endpoints

Table scrolls horizontally

MethodPathDescriptionParameters
POST/v1/videosCreate Video Generation Taskmodel · prompt · ratio · duration · refs
POST/v1/imagesCreate Image Generation Taskmodel · prompt · size · count
POST/v1/videos/upscaleSubmit Super-Resolution Taskvideo_url · target · keep_audio
GET/v1/tasks/{id}Check task statusid
GET/v1/modelsList Available Models and Quotastype

Request and Response

Request example

curl -X POST https://api.jiyingjing.example.com/v1/videos \
  -H "Authorization: Bearer <KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jiying-video-v3",
    "prompt": "深夜便利店门口,雨中霓虹,35mm 中景,轻微手持",
    "ratio": "9:16",
    "duration": 10,
    "refs": { "images": [], "videos": [] }
  }'

Key Retrieval: Configure your key under **Manage > Key Management**, then include it in the request header as a Bearer token.

Response Example

Task Created · 202 Accepted

HTTP/1.1 202 Accepted

{
  "id": "task_8f21c4",
  "status": "queued",
  "model": "jiying-video-v3",
  "estimated_seconds": 42
}

Task completed · 200 OK

HTTP/1.1 200 OK

{
  "id": "task_8f21c4",
  "status": "succeeded",
  "model": "jiying-video-v3",
  "output": {
    "url": "https://cdn.jiyingjing.example.com/v1/task_8f21c4.mp4",
    "cover": "https://cdn.jiyingjing.example.com/v1/task_8f21c4.jpg",
    "duration": 10,
    "ratio": "9:16",
    "width": 1080,
    "height": 1920
  },
  "usage": { "seconds": 10, "credits": 11 },
  "created_at": "2026-11-16T09:12:03Z",
  "finished_at": "2026-11-16T09:12:51Z"
}

The successful response includes the MP4 file, thumbnail, and resolution. Usage details the actual seconds deducted and credits consumed for this transaction, suitable for reconciliation.

Task Polling and Status

Video tasks return asynchronously; retrieve results once the final status is reached.

Polling Example: Backoff and Final State Determination

async function waitTask(id) {
  let interval = 2;
  for (let i = 0; i < 300; i += 1) {
    await new Promise((resolve) => setTimeout(resolve, interval * 1000));
    const res = await fetch(`https://api.jiyingjing.example.com/v1/tasks/${id}`, {
      headers: { Authorization: "Bearer <KEY>" },
    });
    if (res.status === 429) {
      interval = Number(res.headers.get("retry-after") || interval * 2);
      continue;
    }
    const task = await res.json();
    if (["succeeded", "failed", "canceled"].includes(task.status)) return task;
    interval = Math.min(Math.round(interval * 1.5), 10);
  }
  throw new Error("轮询超过 15 分钟,请改用回调查询");
}

Obtain the ID after creating the task and start polling immediately. Do not wait synchronously for results on the creation request.

In Progress · 200 OK

HTTP/1.1 200 OK

{
  "id": "task_8f21c4",
  "status": "running",
  "model": "jiying-video-v3",
  "progress": 0.62,
  "suggested_poll_interval": 3,
  "estimated_seconds_remaining": 16
}

suggested_poll_interval is determined by the server based on queue pressure and takes precedence over the local fixed interval.

StatusFinal stateClient Action
queuedQueuingNoPolling can start once creation is successful. We recommend a 2-second interval; avoid fixed high-frequency requests.
runningGeneratingNoAdjust the interval based on `suggested_poll_interval` from the response, and drive the frontend progress bar using `progress`.
SuccessCompletedYesSave output.url and output.cover to your own storage. The example URL is valid for 24 hours.
failedFailedYesRebuild the task after correcting parameters by reading error.code and error.message. Pre-allocated slots are automatically returned.
canceledCancelledYesFinal state after canceling the call or timeout cleanup; polling stops. You can recreate it.
  • Polling interval starts at 2 seconds with exponential backoff of 1.5, capped at 10 seconds; maximum polling duration per task is 15 minutes.
  • On receiving 429, read the retry-after header before making the next request; do not perform concurrent polling.
  • Points are settled only after the final status: successful transactions are credited based on actual duration, while failed ones are automatically refunded.
  • The result URL is temporary. The integrator must save it to their own storage before distributing it externally.

Error Code

Status CodeMeaningRecommended Action
401Invalid or unconfigured keyRegenerate the key under **Settings → API Keys** and include it in the request header using Bearer authentication.
402Insufficient lightingRetry after adding the fuel pack in Membership and Screen Points.
429Concurrency or rate limit exceededBack off based on the returned `retry-after` header, or reduce concurrency.
422Parameter validation failedCheck if duration, ratio, and reference asset count are within the model's supported range.

Speed and Billing

Concurrency

Default to 4 concurrent tasks per account. Requests exceeding this limit return 429 and are silently dropped without queuing.

Retreat

On rate limiting, back off using the `retry-after` header. We recommend exponential backoff starting at 2 seconds, with a maximum of three retries.

Deduct points

Task creation reserves a node upfront. Successful tasks are billed based on actual duration; failed tasks release the reservation upon polling result return.

The demo site does not have key issuance or billing enabled. The above is a contract illustration for the API.

Validate the end-to-end flow before integration.

First, use the workflow to understand how tasks are created, polled, and retrieved before deciding which endpoint to call.