Skip to content

Image-to-video generation (create task)

POST /api/v5/video/generate

Call this endpoint to create a video generation task. If the call returns without an error, you can query the video generation result asynchronously using the request_id.

Supported access tokens

  • AtomGit user access tokens

Anonymous access allowed

This endpoint allows anonymous access.

Request parameters

Parameter Location Type Required Description
Authorization header string No User personal token; may be included or omitted for anonymous access

Request Body:

The request body is a JSON object containing the image, model, and prompt parameters.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "img_url": {
      "description": "Input image; accepts Base64 data or an image URL",
      "type": "string"
    },
    "model": {
      "description": "Model name",
      "type": "string"
    },
    "prompt": {
      "description": "Prompt",
      "type": "string"
    },
    "seed": {
      "description": "Random seed",
      "type": "integer",
      "format": "int64",
      "minimum": 0,
      "maximum": 2147483648,
      "default": 0
    }
  },
  "required": ["img_url", "model", "prompt"]
}

Response parameters

Field Type Always returned Nullable Description
request_id string Yes No Request ID used to query the video generation result asynchronously
status string Yes No Processing status, such as running
error_message string No Yes Error message (present only on failure)

Error response

This endpoint may return 400 / 401 when a parameter is missing or the credentials are invalid. The error structure follows what the backend actually returns; the examples below are illustrative only.

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "img_url cannot be empty",
  "field": "img_url"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

HTTP status codes

Status code Description
200 Success (OK)
400 Invalid parameters (Bad Request)
401 Authentication required (Requires authentication)
500 Internal system error (Internal Server Error)

Request example

Parameter notes

Replace <img_url> with the image address or Base64 data, <model> with the model name (such as Wan2.2-I2V-A14B), <prompt> with the prompt, and <seed> with the random seed (optional, defaults to 0, range 0 to 2147483648). This endpoint allows anonymous access, or you can pass a user token in the Authorization header.

cURL

curl -X POST 'https://api.atomgit.com/api/v5/video/generate' \
  -H 'Content-Type: application/json' \
  -d '{
    "img_url": "https://api.atomgit.com/images/example.png",
    "model": "Wan2.2-I2V-A14B",
    "prompt": "A kitten taking a walk",
    "seed": 0
  }'

JavaScript

// Native fetch (Node.js 18+ / browsers)
const response = await fetch("https://api.atomgit.com/api/v5/video/generate", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    img_url: "https://api.atomgit.com/images/example.png",
    model: "Wan2.2-I2V-A14B",
    prompt: "A kitten taking a walk",
    seed: 0,
  }),
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.post(
    "https://api.atomgit.com/api/v5/video/generate",
    headers={"Content-Type": "application/json"},
    json={
        "img_url": "https://api.atomgit.com/images/example.png",
        "model": "Wan2.2-I2V-A14B",
        "prompt": "A kitten taking a walk",
        "seed": 0,
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "request_id": "67a1b2c3d4e5f6789abcde01",
  "status": "running",
  "error_message": null
}

Error codes

Error code Description
400 Invalid parameters or the request cannot be parsed
401 Unauthenticated or invalid credentials (missing or invalid access credentials)
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc