← 返回 Skills 市场
binkes

Chanjing Avatar

作者 BinKes · GitHub ↗ · v1.0.7 · MIT-0
cross-platform ✓ 安全检测通过
213
总下载
0
收藏
1
当前安装
8
版本数
在 OpenClaw 中安装
/install chanjing-avatar
功能描述
Use Chanjing Avatar API for lip-syncing video generation (upload audio/video, create tasks, poll results).
使用说明 (SKILL.md)

Chanjing Avatar (Lip-Syncing)

功能说明

调用蝉镜 Avatar Open API:上传音视频素材、创建对口型任务、轮询与获取结果链接。脚本为 Python HTTP/上传客户端,依赖 ffmpeg/ffprobe。

运行依赖

  • python3 与同仓库 scripts/*.py
  • ffmpeg/ffprobe 门控

环境变量与机器可读声明

  • 环境变量键名与说明:manifest.yamlenvironment 段)及本文
  • 变量、凭据、合规 permissionsclientPermissionsagentPolicymanifest.yaml

使用命令

  • ClawHub(slug 以注册表为准):clawhub run chanjing-avatar
  • 本仓库python skills/chanjing-avatar/scripts/create_task.py …(流程见正文 How to Use

登记与审稿(单一事实来源)

主凭据、上传/下载边界、浏览器引导等:manifest.yaml 为准。本篇 How to Use 起为 API 步骤说明。

When to Use This Skill

Use this skill when the user needs to create lip-syncing videos (digital avatar videos) with synchronized mouth movements.

Chanjing Avatar supports:

  • Text-driven or audio-driven lip-syncing
  • Multiple system voices for TTS
  • Video resolution customization
  • Task status polling and callback

How to Use This Skill

前置条件:执行本 Skill 前,必须先通过 chanjing-credentials-guard 完成 AK/SK 与 Token 校验。凭据与审稿对表见 manifest.yaml

Security & credentials(引用)

详见 manifest.yamlcredentialsclientPermissions(含本地上传、结果 URL、浏览器行为;合规见顶层 permissions)。

Multiple APIs need to be invoked. All share the domain: "https://open-api.chanjing.cc". All requests communicate using json. You should use utf-8 to encode and decode text throughout this task.

  1. Obtain an access_token, which is required for all subsequent API calls
  2. Upload your video/audio files using the File Management API to get file_id
  3. Create a lip-syncing task with video and audio/text using these file_id values
  4. Poll the Query Task Detail API or use Task List API to check status
  5. Download the generated video using the url in response when status is completed

Obtain AccessToken

~/.chanjing/credentials.json 读取 app_idsecret_key,若无有效 Token 则调用:

POST /open/v1/access_token
Content-Type: application/json

请求体(使用本地配置的 app_id、secret_key):

{
  "app_id": "\x3C从 credentials.json 读取>",
  "secret_key": "\x3C从 credentials.json 读取>"
}

Response example:

{
  "trace_id": "8ff3fcd57b33566048ef28568c6cee96",
  "code": 0,
  "msg": "success",
  "data": {
    "access_token": "1208CuZcV1Vlzj8MxqbO0kd1Wcl4yxwoHl6pYIzvAGoP3DpwmCCa73zmgR5NCrNu",
    "expire_in": 1721289220
  }
}

Response field description:

First-level Field Second-level Field Description
code Response status code
msg Response message
data Response data
access_token Valid for one day, previous token will be invalidated
expire_in Token expiration time

Response Status Code Description

Code Description
0 Success
400 Invalid parameter format
40000 Parameter error
50000 System internal error

Upload Media Files (File Management)

Before creating a lip-syncing task, you must upload your video (and optional audio) files using the File Management API to obtain file_id values.

The full documentation is here: [File Management](https://doc.chanjing.cc/api/file/file-management.html).

Step 1: Get upload URL

GET /open/v1/common/create_upload_url
access_token: {{access_token}}

Query params:

Key Example Description
service lip_sync_video / lip_sync_audio File usage purpose. Use lip_sync_video for driving video, lip_sync_audio for audio (if audio-driven).
name 1.mp4 Original file name including extension

You will get a response containing sign_url, mime_type, and file_id. Use the sign_url with HTTP PUT to upload the file, setting Content-Type to the returned mime_type. After the PUT completes, poll the file detail API until the file is ready (do not assume a fixed wait). Keep the returned file_id for video_file_id / audio_file_id below.

Polling: Call GET /open/v1/common/file_detail?id={{file_id}} with access_token until the response data.status indicates success (e.g. status === 2). Only then use the file_id for the create task API.

Create Lip-Syncing Task

Submit a lip-syncing video creation task, which returns a video ID for polling later.

POST /open/v1/video_lip_sync/create
access_token: {{access_token}}
Content-Type: application/json

Request body example (TTS-driven):

{
  "video_file_id": "e284db4d95de4220afe78132158156b5",
  "screen_width": 1080,
  "screen_height": 1920,
  "callback": "https://example.com/openapi/callback",
  "model": 0,
  "audio_type": "tts",
  "tts_config": {
    "text": "君不见黄河之水天上来,奔流到海不复回。",
    "audio_man_id": "C-f2429d07554749839849497589199916",
    "speed": 1,
    "pitch": 1
  }
}

Request body example (Audio-driven):

{
  "video_file_id": "e284db4d95de4220afe78132158156b5",
  "screen_width": 1080,
  "screen_height": 1920,
  "model": 0,
  "audio_type": "audio",
  "audio_file_id": "audio_file_id_from_file_management"
}

Request field description:

Parameter Name Type Required Description
video_file_id string Yes Video file ID from File Management (data.file_id). Supports mp4, mov, webm
screen_width int No Screen width, default 1080
screen_height int No Screen height, default 1920
backway int No Playback order when reaching end: 1-normal, 2-reverse. Default 1
drive_mode string No Drive mode: ""-normal, "random"-random frame. Default ""
callback string No Callback URL for async notification
model int No Model version: 0-basic, 1-high quality. Default 0
audio_type string No Audio type: "tts"-text driven, "audio"-audio driven. Default "tts"
tts_config object Yes (for tts) TTS configuration when audio_type="tts"
tts_config.text string Yes (for tts) Text to synthesize
tts_config.audio_man_id string Yes (for tts) Voice ID
tts_config.speed number No Speech speed: 0.5-2, default 1
tts_config.pitch number No Pitch, default 1
audio_file_id string Yes (for audio) Audio file ID from File Management (data.file_id) when audio_type="audio". Supports mp3, m4a, wav
volume int No Volume: 1-100, default 100

Response example:

{
  "trace_id": "8d10659438827bd4d59eaa2696f9d391",
  "code": 0,
  "msg": "success",
  "data": "9499ed79995c4bdb95f0d66ca84419fd"
}

Response field description:

Field Description
code Response status code
msg Response message
data Video ID for subsequent polling

Query Task List

Get a list of lip-syncing tasks.

POST /open/v1/video_lip_sync/list
access_token: {{access_token}}
Content-Type: application/json

Request body:

{
  "page": 1,
  "page_size": 10
}

Request field description:

Parameter Type Required Description
page int No Page number, default 1
page_size int No Page size, default 10

Response example:

{
  "trace_id": "8d10659438827bd4d59eaa2696f9d391",
  "code": 0,
  "msg": "success",
  "data": {
    "list": [
      {
        "id": "9499ed79995c4bdb95f0d66ca84419fd",
        "status": 20,
        "progress": 100,
        "msg": "success",
        "video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
        "preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
        "duration": 300,
        "create_time": 1738636800
      }
    ],
    "page_info": {
      "page": 1,
      "size": 10,
      "total_count": 1,
      "total_page": 1
    }
  }
}

Response field description:

First-level Field Second-level Field Description
code Response status code
msg Response message
data Response data
list Task list
id: Video ID
status: Task status (0-pending, 10-generating, 20-success, 30-failed)
progress: Progress 0-100
msg: Task message
video_url: Video download URL
preview_url: Cover image URL
duration: Video duration in ms
create_time: Creation time (unix timestamp)
page_info Pagination info

Query Task Detail

Poll the following API to check task status until completed.

GET /open/v1/video_lip_sync/detail
access_token: {{access_token}}

Query params:

Parameter Description
id Video ID

Example: GET /open/v1/video_lip_sync/detail?id=9499ed79995c4bdb95f0d66ca84419fd

Response example:

{
  "trace_id": "8d10659438827bd4d59eaa2696f9d391",
  "code": 0,
  "msg": "success",
  "data": {
    "id": "9499ed79995c4bdb95f0d66ca84419fd",
    "status": 20,
    "progress": 100,
    "msg": "success",
    "video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
    "preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
    "duration": 300,
    "create_time": 1738636800
  }
}

Response field description:

First-level Field Second-level Field Description
code Response status code
msg Response message
data Response data
id Video ID
status Task status: 0-pending, 10-generating, 20-success, 30-failed
progress Progress 0-100
msg Task message
video_url Video download URL
preview_url Cover image URL
duration Video duration in ms
create_time Creation time (unix timestamp)

Callback Notification

When a callback URL is provided, the system will send a POST request when the task completes:

{
  "trace_id": "8d10659438827bd4d59eaa2696f9d391",
  "code": 0,
  "msg": "success",
  "data": {
    "id": "9499ed79995c4bdb95f0d66ca84419fd",
    "status": 20,
    "progress": 100,
    "msg": "success",
    "video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
    "preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
    "duration": 300,
    "create_time": 1738636800
  }
}

Scripts

本 Skill 提供脚本(skills/chanjing-avatar/scripts/),与 chanjing-credentials-guard 使用同一配置文件(~/.chanjing/credentials.json)获取 Token。

脚本 说明
get_upload_url.py 获取上传链接,输出 sign_urlmime_typefile_id
upload_file.py 上传本地文件,轮询 file_detail 直到就绪后输出 file_id
create_task.py 创建对口型任务(TTS 或音频驱动),输出视频任务 id
poll_task.py 轮询任务直到完成,输出 video_url

示例(在项目根或 skill 目录下执行):

# 1. 上传驱动视频,得到 video_file_id
VIDEO_FILE_ID=$(python skills/chanjing-avatar/scripts/upload_file.py --service lip_sync_video --file ./my_video.mp4)

# 2. 创建 TTS 对口型任务(需先通过 list_common_audio 获取 audio_man_id)
TASK_ID=$(python skills/chanjing-avatar/scripts/create_task.py \
  --video-file-id "$VIDEO_FILE_ID" \
  --text "君不见黄河之水天上来" \
  --audio-man-id "C-f2429d07554749839849497589199916")

# 3. 轮询直到完成,得到视频下载链接
python skills/chanjing-avatar/scripts/poll_task.py --id "$TASK_ID"

音频驱动时:先上传音频得到 audio_file_id,再 create_task.py --video-file-id \x3Cid> --audio-file-id \x3Caudio_file_id>

Response Status Code Description

Code Description
0 Response successful
10400 AccessToken verification failed
40000 Parameter error
40001 Exceeds RPM/QPS limit
50000 System internal error
安全使用建议
This skill appears coherent and implements the described Chanjing Avatar workflow. Before installing: (1) Ensure you trust the chanjing service because the skill uploads your local media to a sign_url returned by the API (that URL may be on storage hosts not explicitly listed in the manifest). (2) Be aware the skill reads and writes ~/.chanjing/credentials.json (stores access_token on disk) — keep that file private and do not commit it to source control. (3) If you use the companion chanjing-credentials-guard, review it too. If any of these behaviors (persisting tokens, uploading media to third-party storage) are unacceptable for your environment, do not install or restrict usage accordingly.
功能分析
Type: OpenClaw Skill Name: chanjing-avatar Version: 1.0.7 The chanjing-avatar skill bundle is a legitimate integration for the Chanjing Avatar lip-syncing API. It provides scripts (create_task.py, upload_file.py, etc.) to interact with official endpoints at open-api.chanjing.cc. Authentication is handled securely via a local credentials.json file as defined in manifest.yaml, and the code lacks any signs of data exfiltration, obfuscation, or malicious intent.
能力评估
Purpose & Capability
Name/description match the implemented behavior: the Python scripts obtain an access_token, upload media, create lip-sync tasks, poll status, and download results. The code only contacts the documented Chanjing API and uses a local credentials.json for app_id/secret_key — these are expected for this integration.
Instruction Scope
Instructions and scripts read and write the credentials.json (by default ~/.chanjing/credentials.json), read user-provided media files to upload, and may open a browser to the vendor login page. The upload flow uses a returned sign_url (PUT) which can point to storage hosts outside open-api.chanjing.cc; the manifest permits following API response URLs for downloads but does not enumerate potential upload targets — this is typical but worth noticing because upload destinations may be third-party storage endpoints.
Install Mechanism
No install spec is provided (instruction-only + included Python scripts). Scripts are plain Python and do not pull remote archives or run arbitrary installers — lowest-risk install approach.
Credentials
No unexpected credentials or environment variables are required. Optional env vars (credentials dir and base URL) are appropriate. The skill persists an access_token to the same credentials.json file (documented in manifest) — this is expected but note it stores sensitive tokens on disk.
Persistence & Privilege
always:false and agentPolicy indicates it does not modify other skills or global agent settings. It writes only its own credentials file and workspace paths declared in the manifest; no elevated or permanent global privileges are requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install chanjing-avatar
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /chanjing-avatar 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.7
Version 1.0.7 - Environment variable management updated: new keys added for credential and API base path, legacy keys retained for compatibility. - Metadata fields revised and expanded in SKILL.md for clearer machine-readable structure. - File and credential authority documentation now emphasizes manifest.yaml as single source of truth. - Permissions fields updated (now includes `clientPermissions` as well as `permissions/agentPolicy`). - Skill no longer mentions ffmpeg/ffprobe requirements (explicitly set as false). - Minor documentation cleanups and restructuring for clarity and accuracy.
v1.0.6
- Introduced machine-readable metadata with the addition of manifest.yaml; SKILL.md now references manifest.yaml for all environment variables, credentials, and permissions. - Updated SKILL.md to direct users and reviewers to manifest.yaml as the single source of truth for configuration and policy details. - Clarified documentation sections, reducing redundancy in credential and permission description. - No code changes; documentation consistency and automation improvements only. - Improved guidance for reviewers by consolidating security, credential, network, and behavior statements in manifest.yaml.
v1.0.5
- Added bilingual (Chinese & English) documentation, including usage commands and capability description. - Declared author, category, tags, and env variables in the skill metadata header. - Clarified that the skill does not require ffmpeg/ffprobe dependencies. - Described usage both for ClawHub and local Python scripts. - No changes to API usage or workflow; documentation improved for clarity and localization.
v1.0.4
- Added scripts for file upload, task creation, upload URL retrieval, and task polling: `create_task.py`, `get_upload_url.py`, `poll_task.py`, and `upload_file.py`. - Updated documentation in `SKILL.md` to reflect new helper scripts and clarify usage steps. - No breaking changes to existing API or skill usage.
v1.0.3
chanjing-avatar 1.0.3 - Internal update to scripts/_auth.py (details not specified) - No user-facing feature or documentation changes detected
v1.0.2
Chanjing Avatar 1.0.2 - Completely revised documentation for clarity and brevity, with a structured summary of credentials, API workflow, and security. - Consolidated and clarified environment variable usage and credential locations. - Improved API usage instructions with step-by-step guidance and field tables. - Provided direct summaries for audience and registry consumption. - No changes to API endpoints or supported use cases.
v1.0.1
Chanjing Avatar v1.0.1 - Major SKILL.md rewrite: now concise, reorganized, and focused on environment variables, workflow, API coverage, and streamlined usage steps. - Skill now clearly documents support for credentials discovery via $CHANJING_CONFIG_DIR, and environment overrides for API base. - Adds metadata about required environment variables and homepage. - Documentation explicitly details what is returned by default (remote video URL only, no auto-download). - Clarifies handling of credentials, including opening the official login page if auth fails. - Table of covered APIs and script purposes added for quick reference.
v1.0.0
chanjing-avatar 1.0.0 - Initial release of the chanjing-avatar skill. - Supports creating digital avatar (lip-syncing) videos using the Chanjing Avatar API. - Allows both text-driven (TTS) and audio-driven lip-syncing video generation. - Offers video resolution customization, multiple system voices for TTS, and volume/speed/pitch controls. - Includes APIs for file upload, task creation, status polling, and video download.
元数据
Slug chanjing-avatar
版本 1.0.7
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 8
常见问题

Chanjing Avatar 是什么?

Use Chanjing Avatar API for lip-syncing video generation (upload audio/video, create tasks, poll results). 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 213 次。

如何安装 Chanjing Avatar?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install chanjing-avatar」即可一键安装,无需额外配置。

Chanjing Avatar 是免费的吗?

是的,Chanjing Avatar 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Chanjing Avatar 支持哪些平台?

Chanjing Avatar 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Chanjing Avatar?

由 BinKes(@binkes)开发并维护,当前版本 v1.0.7。

💬 留言讨论