SuperAPI AI Directory

chanjing-ai-creation

Coding & development

View repository

Updated 10-15 20:11

About this skill

Chanjing AI Creation

Feature Description

Call Chanjing AI Creation Open API:Submit Task、Poll Status、List and Single Query; use only when the user explicitly requests download_result.py Optional DownloadOutput. Requiresread/writelocal credentials.json and access the Open API. Cross-model text-to-image/video etc. are determined by the submit_task.py parameters and passthrough body. This skill scriptdoes notdepend on ffmpeg/ffprobe.

Runtime Dependencies

  • python3 and same-repository scripts/*.py
  • No ffmpeg/ffprobe gating

Environment Variables and Machine-Readable Declarations

  • Environment variable keys and descriptions:manifest.yaml(environment section) and this document
  • Variables, Credentials, Compliance permissions、clientPermissions、agentPolicy:manifest.yaml

Usage Commands

  • ClawHub(slug subject to the registry):clawhub run chanjing-ai-creation
  • This Repository Examples:python skills/chanjing-ai-creation/scripts/submit_task.py …(see main text Standard Workflow)

Registration and Review (Single Source of Truth)

Primary credentials, optional env, download trust boundary, etc.:subject to manifest.yaml .This document starts from When to Use to describe business capabilities.

When to Use This Skill

Use this Skill when the user wants to do these things:

  • SubmitImage or video AI creation task (submit_task.py)
  • List / Single QueryTask (list_tasks.py、get_task.py)
  • PollAsynchronous results until completion (poll_task.py)
  • Only when the user explicitly requestsDownloadOutput (download_result.py)

The above process relies on reading and writing local credentials.json and calling open-api.chanjing.cc。

If the requirement is closer to "text-to-digital human", prefer chanjing-text-to-digital-person。
If the requirement is closer to "existing digital human video synthesis", prefer chanjing-video-compose。

Preconditions

Before executing this Skill, you must first pass chanjing-credentials-guard to complete AK/SK and Token verification.

This Skill is shared with guard:

  • ~/.chanjing/credentials.json
  • https://open-api.chanjing.cc

When there are no credentials, the script will automatically open the Chanjing login page and prompt the configuration command.

Review and Security (Credentials)

Item-by-item descriptions related to the trust boundary of Purpose / Credentials / Persistence、download_result.py see manifest.yaml。

Runtime Scope: The descriptions and scripts of this Skill only serve the declared purpose—reading local credentials.json, calling Chanjing Open API endpoint;does notautomatically persist generated artifacts on successful polling or query,onlywhen the user explicitly executes download_result.py to download resources.

_auth.py and Repository Layout: Authentication assistance may open the system browser, or call the same-repository chanjing-credentials-guard script by relative path (e.g., open_login_page.py). This assumes the current workspace is chan-skills-style multi-Skill directory structure, or the guard skill has been separately installed with an equivalent path; otherwise it will fall back to only opening the login page URL.

Sensitive Data and Persistence: Expected to only handle credentials.json in app_id、secret_key、access_token(and fields related to token lifecycle, see manifest.yaml). Writing access_token to disk is intentional and documented, and is generally acceptable for API clients; however, inmulti-user shared host、full-disk backup/sync to untrusted storageIn scenarios such as these, the token on disk willexpand the exposure surface, and you need to assess it yourself based on your environment.

Standard Workflow

The main interface for AI creation is the unified submitter:

  1. Call submit_task.py to submit an image or video generation task and get unique_id
  2. Call poll_task.py to poll until success and get output_url
  3. If you need to review task parameters or the error reason, call get_task.py
  4. If you need to view historical records, call list_tasks.py
  5. Only when the user explicitly requests saving locally should you call download_result.py

This skill is by default made into a "generic task submitter":

  • For common image/video models, prefer using the generic parameters provided by the script
  • For special model parameters, use --body-file or --body-json to pass through the complete request body

Covered APIs

This Skill currently covers:

  • POST /open/v1/ai_creation/task/submit
  • POST /open/v1/ai_creation/task/page
  • GET /open/v1/ai_creation/task

Scripts

Script directory:

  • skills/chanjing-ai-creation/scripts/
Script Description
_auth.py Read and write credentials.json, obtain or refresh access_token
submit_task.py Submit an AI creation task, output unique_id
get_task.py Get details for a single task
list_tasks.py List image or video tasks
poll_task.py Poll the task until completion, and by default output the first result URL
download_result.py Download the image or video to outputs/ai-creation/

Usage Examples

Example 1: Seedream 4.5 text-to-image

TASK_ID=$(python3 skills/chanjing-ai-creation/scripts/submit_task.py \
  --creation-type 3 \
  --model-code "doubao-seedream-4.5" \
  --prompt "赛博朋克城市夜景,霓虹灯,雨夜,电影镜头" \
  --aspect-ratio "16:9" \
  --clarity 2048 \
  --number-of-images 1)

python3 skills/chanjing-ai-creation/scripts/poll_task.py --unique-id "$TASK_ID"

Example 2: Tencent Kling v2.1 Master image-to-video

TASK_ID=$(python3 skills/chanjing-ai-creation/scripts/submit_task.py \
  --creation-type 4 \
  --model-code "tx_kling-v2-1-master" \
  --ref-img-url "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg" \
  --ref-img-url "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg" \
  --prompt "角色从静止到转身,镜头平滑移动,叙事感强" \
  --aspect-ratio "9:16" \
  --clarity 1080 \
  --quality-mode pro \
  --video-duration 5)

python3 skills/chanjing-ai-creation/scripts/poll_task.py --unique-id "$TASK_ID"

Example 3: Directly pass through the complete JSON

python3 skills/chanjing-ai-creation/scripts/submit_task.py \
  --body-file ./payload.json

Download Rule

Downloading is an explicit action, not a default action:

  • poll_task.py After success, you should first return the remote output_url
  • Do not automatically download the result file
  • Only when the user explicitly says "download locally", "save to outputs", or "save it to disk for me" should you execute download_result.py

Output Convention

Default local output directory:

  • outputs/ai-creation/

Additional Resources

For more interface details, see:

  • skills/chanjing-ai-creation/reference.md
  • skills/chanjing-ai-creation/examples.md