Text-to-Video
Convert points to secondsGenerate 5–15 second videos directly, with support for aspect ratio and duration parameters.
POST /v1/videos
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.
The following path is an interface contract sample; a real key has not been activated.
Generate 5–15 second videos directly, with support for aspect ratio and duration parameters.
POST /v1/videos
Generate a shot with the first frame and prompt; optionally use the last frame to close it.
POST /v1/videos/image
Single or batch generation with reference images and inpainting support
POST /v1/images
Generative upscaling to 2K, preserving original frame rate and audio track.
POST /v1/videos/upscale
Generate background music by mood and duration. Includes commercial-use licensing tag.
POST /v1/music
Poll task status and result URL; supports batch queries
GET /v1/tasks/{id}
Table scrolls horizontally
| Method | Path | Description | Parameters |
|---|---|---|---|
| POST | /v1/videos | Create Video Generation Task | model · prompt · ratio · duration · refs |
| POST | /v1/images | Create Image Generation Task | model · prompt · size · count |
| POST | /v1/videos/upscale | Submit Super-Resolution Task | video_url · target · keep_audio |
| GET | /v1/tasks/{id} | Check task status | id |
| GET | /v1/models | List Available Models and Quotas | type |
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.
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.
| Status | Final state | Client Action |
|---|---|---|
| queuedQueuing | No | Polling can start once creation is successful. We recommend a 2-second interval; avoid fixed high-frequency requests. |
| runningGenerating | No | Adjust the interval based on `suggested_poll_interval` from the response, and drive the frontend progress bar using `progress`. |
| SuccessCompleted | Yes | Save output.url and output.cover to your own storage. The example URL is valid for 24 hours. |
| failedFailed | Yes | Rebuild the task after correcting parameters by reading error.code and error.message. Pre-allocated slots are automatically returned. |
| canceledCancelled | Yes | Final state after canceling the call or timeout cleanup; polling stops. You can recreate it. |
| Status Code | Meaning | Recommended Action |
|---|---|---|
| 401 | Invalid or unconfigured key | Regenerate the key under **Settings → API Keys** and include it in the request header using Bearer authentication. |
| 402 | Insufficient lighting | Retry after adding the fuel pack in Membership and Screen Points. |
| 429 | Concurrency or rate limit exceeded | Back off based on the returned `retry-after` header, or reduce concurrency. |
| 422 | Parameter validation failed | Check if duration, ratio, and reference asset count are within the model's supported range. |
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.
First, use the workflow to understand how tasks are created, polled, and retrieved before deciding which endpoint to call.