> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crun.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ByteDance AI Effect Template API

> Generate AI effect template videos with ByteDance templates through Crun's unified task API. Some ByteDance templates are powered by Seedance 2.0 for high-quality motion, visual realism, and controllable video effects.

## Overview

Use this endpoint to generate a video from a ByteDance AI effect template through Crun's unified task creation API.

The outer request uses `model: "bytedance/template"`. The `input` object contains the selected template ID, one or more input image URLs, and the target output resolution:

```json theme={null}
{
  "model": "bytedance/template",
  "input": {
    "template_id": "104909826",
    "img_urls": [
      "https://static.crunai.com/u/example-image.png"
    ],
    "resolution": "720p"
  }
}
```

<Tip>
  To integrate all ByteDance AI effect templates at once, call <code>/api/v1/client/job/bytedance-templates</code> first, render the returned template catalog in your app, then submit the selected <code>TemplateId</code> as <code>template\_id</code> to this generation endpoint.
</Tip>

## Template Discovery

Before creating a task, query the Crun ByteDance template list endpoint:

<Card title="ByteDance Template List" icon="list" href="/templates/bytedance-template-list">
  Query available ByteDance AI effect templates, preview assets, input requirements, supported resolutions, and credits.
</Card>

The list endpoint is designed for one-click integration of all templates:

1. Query `/api/v1/client/job/bytedance-templates`
2. Display templates, covers, preview videos, supported resolutions, and credit costs
3. Use the selected `TemplateId`, image count requirement, and resolution options to call `bytedance/template`

## Official Template Gallery

You can also open the official ByteDance template gallery, choose a template, and copy its template ID:

* Official ByteDance template gallery: [TemplateAI](https://console.volcengine.com/kickart/templateAI)

## Query Task Status

After submitting a task, use the unified query endpoint to check progress and retrieve results:

<Card title="Get Task Info" icon="magnifying-glass" href="/models/common/get-task-info">
  Learn how to query task status and retrieve generation results
</Card>

<Tip>
  For production use, we recommend using the `callback_url` parameter to receive automatic notifications when generation completes, rather than polling the status endpoint.
</Tip>

## Related Resources

<CardGroup cols={2}>
  <Card title="ByteDance Template List" icon="list" href="/templates/bytedance-template-list">
    Query all available ByteDance AI effect templates and support one-click template integration.
  </Card>

  <Card title="Models Overview" icon="store" href="/models/quickstart">
    Explore all available generation models on Crun.
  </Card>
</CardGroup>


## OpenAPI

````yaml templates/bytedance-template.json post /api/v1/client/job/CreateTask
openapi: 3.0.0
info:
  title: Crun ByteDance AI Effect Template Video Generation API
  description: crun.ai ByteDance AI effect template video generation API documentation
  version: 1.0.0
  contact:
    name: Technical Support
    email: support@crun.ai
servers:
  - url: https://api.crun.ai
    description: API Server
security:
  - ApiKeyAuth: []
paths:
  /api/v1/client/job/CreateTask:
    post:
      summary: Generate video with a ByteDance AI effect template
      operationId: bytedance-template-video-generation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - bytedance/template
                  description: |-
                    The model name to use for generation. Required field.

                    - Must be `bytedance/template` for this endpoint
                callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. Callback URL for receiving task completion
                    notifications.


                    - System will POST task status and results to this URL when
                    generation completes

                    - Callback payloads structure is consistent with the `data`
                    object returned by the task status query

                    - Your callback endpoint should accept POST requests with
                    JSON payload containing results

                    - It returns an HTTP 200 status code upon successful receipt
                  example: https://your-domain.com/api/callback
                input:
                  type: object
                  description: >-
                    Input parameters for ByteDance AI effect template video
                    generation.
                  required:
                    - template_id
                    - img_urls
                  properties:
                    template_id:
                      type: string
                      description: >-
                        ByteDance template ID. Query supported template IDs
                        through `/api/v1/client/job/bytedance-templates`, or
                        open the official ByteDance template gallery and copy
                        the selected template ID.
                      example: '104909826'
                    img_urls:
                      type: array
                      description: >-
                        Input image URLs for the selected template. The required
                        image count depends on the selected template's
                        `InputNum` and `InputRequirement` values in the template
                        list response.
                      items:
                        type: string
                        format: uri
                      minItems: 1
                      example:
                        - https://static.crunai.com/u/example-image.png
                    resolution:
                      type: string
                      description: >-
                        Output resolution. The selected template must support
                        the requested resolution in its `ConsumeItems` list.
                      enum:
                        - 480p
                        - 720p
                        - 1080p
                        - 2k
                      default: 480p
                      example: 720p
            example:
              model: bytedance/template
              callback_url: https://your-domain.com/api/callback
              input:
                template_id: '104909826'
                img_urls:
                  - https://static.crunai.com/u/example-image.png
                resolution: 720p
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          task_id:
                            type: string
                            description: >-
                              Task ID, can be used with Get Task Details
                              endpoint to query task status
                            example: task_12345678
              example:
                code: 200
                message: success
                data:
                  task_id: task_12345678
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      errors:
                        type: array
                        description: Detailed validation error messages
                        items:
                          type: string
                        example:
                          - Value error, template_id is invalid
                          - >-
                            Value error, template_id: 104909826 not support
                            resolution: 1080p
              example:
                code: 422
                message: Missing Params or Type Error
                errors:
                  - Value error, template_id is invalid
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          enum:
            - 200
            - 401
            - 402
            - 404
            - 422
            - 429
            - 455
            - 500
            - 501
            - 505
          description: >-
            Response status code


            - **200**: Success - Request has been processed successfully

            - **401**: Unauthorized - Authentication credentials are missing or
            invalid

            - **402**: Insufficient Credits - Account does not have enough
            credits to perform the operation

            - **404**: Not Found - The requested resource or endpoint does not
            exist

            - **422**: Validation Error - The request parameters failed
            validation checks

            - **429**: Rate Limited - Request limit has been exceeded for this
            resource

            - **455**: Service Unavailable - System is currently undergoing
            maintenance

            - **500**: Server Error - An unexpected error occurred while
            processing the request

            - **501**: Generation Failed - Content generation task failed

            - **505**: Feature Disabled - The requested feature is currently
            disabled
        message:
          type: string
          description: Response message, error description when failed
          example: success
  responses:
    Error:
      description: Server Error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        All APIs require authentication via API Key.


        Get API Key:

        1. Visit [API Key Management Page](https://crun.ai/user-api-key) to get
        your API Key


        Usage:

        Add to request header:


        x-api-key: YOUR_API_KEY


        Note:

        - Keep your API Key secure and do not share it with others

        - If you suspect your API Key has been compromised, reset it immediately
        in the management page

````