π¦ ClawHub
Tomoviee Text to Music
by @wondershare-boop
Generate background music from text prompts using Tomoviee Text-to-Music API (`tm_text2music`) through Wondershare OpenAPI gateway (`https://openapi.wondersh...
TERMINAL
clawhub install tomoviee-text-to-musicπ About This Skill
name: tomoviee-text-to-music description: Generate background music from text prompts using Tomoviee Text-to-Music API (
tm_text2music) through Wondershare OpenAPI gateway (https://openapi.wondershare.cc). Use when users request text-to-music generation with duration and quantity control.
Tomoviee AI Text-to-Music
Overview
Generate background music from text prompts.
tm_text2musichttps://openapi.wondershare.cc/v1/open/capacity/application/tm_text2musichttps://openapi.wondershare.cc/v1/open/pub/taskProvider and Endpoint Provenance
Use this mapping to verify provider identity and runtime endpoints:
https://www.tomoviee.ai and https://www.tomoviee.cnhttps://openapi.wondershare.ccopenapi.wondershare.ccCredential Handling
app_key and app_secret are only used to construct Authorization: Basic .SKILL.md, scripts, or repository files.Quick Start
Install dependencies
pip install -r requirements.txt
Authentication helper
python scripts/generate_auth_token.py YOUR_APP_KEY YOUR_APP_SECRET
Python Client
from scripts.tomoviee_text2music_client import TomovieeText2MusicClientclient = TomovieeText2MusicClient("app_key", "app_secret")
API Usage
Basic Example
task_id = client.text_to_music(
prompt="Upbeat tech music, modern and energetic electronic pop",
duration=30,
qty=1,
disable_translate=False,
)result = client.poll_until_complete(task_id)
import json
audio_url = json.loads(result["result"])["audio_path"][0]
print(audio_url)
Parameters
prompt (required): Prompt text. Supports up to 77 tokens; extra content is truncated.duration (required): Target music duration in seconds, range 0-95.qty (required): Number of generated music outputs, range 1-4.disable_translate (optional): Whether to disable translation.callback (optional): Callback URL.params (optional): Transparent callback parameter.Async Workflow
1. Create task and get task_id
2. Poll with poll_until_complete(task_id)
3. Parse output URL from result
Status codes:
1 queued2 processing3 success4 failed5 cancelled6 timeoutResources
scripts/tomoviee_text2music_client.py - main API clientscripts/tomoviee_text_to_music_client.py - compatibility import shimscripts/generate_auth_token.py - auth token helperreferences/audio_apis.md - API reference and parameter constraintsreferences/prompt_guide.md - prompt writing guidanceExternal Resources
https://www.tomoviee.ai/developers.htmlhttps://www.tomoviee.ai/doc/https://www.tomoviee.cn/developers.htmlhttps://www.tomoviee.cn/doc/https://openapi.wondershare.ccπ‘ Examples
Install dependencies
pip install -r requirements.txt
Authentication helper
python scripts/generate_auth_token.py YOUR_APP_KEY YOUR_APP_SECRET
Python Client
from scripts.tomoviee_text2music_client import TomovieeText2MusicClientclient = TomovieeText2MusicClient("app_key", "app_secret")