Use when generating speech from text (text-to-speech) via IMA Open API. Use for: voice synthesis, TTS,朗读, 语音合成, 配音, 有声内容. Output: audio URL (mp3/wav). Flow: query products → create task → poll until done. Requires IMA API key. This skill targets seed-tts-2.0 only (seed-tts-1.1 is not supported). Default model is seed-tts-2.0.
SKILL.md
IMA TTS (Text-to-Speech)
Overview
Call IMA Open API to create text-to-speech audio. Same flow as other IMA creation skills: query products → create task → poll until done. Task type is text_to_speech. This skill targets seed-tts-2.0 only — seed-tts-1.1 is not supported; the script defaults to seed-tts-2.0 when no model is specified.
⚙️ How This Skill Works
This skill uses a bundled Python script scripts/ima_tts_create.py to call the IMA Open API:
Sends text (prompt) to https://api.imastudio.com
Uses --user-id only locally for preference storage
Returns an audio URL when synthesis is complete
Reflection mechanism: on create failure, retries up to 3 times with parameter adjustments
What gets sent to IMA: prompt (text to speak), model selection, parameters (e.g. voice_id, speed). Not sent: API key in prompt body; user_id is local only.
Agent Execution
Use the bundled script:
# List available TTS models (optional; default is seed-tts-2.0)
python3 {baseDir}/scripts/ima_tts_create.py --api-key $IMA_API_KEY --list-models
# Generate speech (default model: seed-tts-2.0; omit --model-id to use default)
python3 {baseDir}/scripts/ima_tts_create.py \
--api-key $IMA_API_KEY \
--model-id seed-tts-2.0 \
--prompt "Text to be spoken here." \
--user-id {user_id} \
--output-json
Script outputs JSON; parse it for url and pass to the user via the UX protocol below.
Environment
Base URL: https://api.imastudio.com
Header
Required
Value
Authorization
✅
Bearer ima_your_api_key_here
x-app-source
✅
ima_skills
x_app_language
recommended
en / zh
⚠️ MANDATORY: Always Query Product List First
You MUST call /open/v1/product/list with category=text_to_speech before creating any task. attribute_id is required; if 0 or missing → "Invalid product attribute" and task fails.
GET /open/v1/product/list?app=ima&platform=web&category=text_to_speech
Then traverse the V2 tree: type=2 = model groups, type=3 = versions (leaves). Only type=3 nodes have credit_rules and form_config. Use a leaf’s model_id, id (= model_version), and credit_rules[0].attribute_id / points for create.
Core Flow
1. GET /open/v1/product/list?app=ima&platform=web&category=text_to_speech
→ Get attribute_id, credit, model_version, form_config
2. POST /open/v1/tasks/create
→ task_type: "text_to_speech", parameters[].parameters.prompt = text to speak
3. POST /open/v1/tasks/detail { "task_id": "..." }
→ Poll every 2–5s until medias[].resource_status == 1 and status != "failed"
→ Read medias[].url (and optional duration_str, format)
Task Detail API — Actual Response Shape
Poll POST /open/v1/tasks/detail until completion. Response uses the same structure as other IMA audio tasks:
prompt must be inside parameters[].parameters, not at top level. Extra fields (e.g. voice_id, speed) come from product form_config; include only those present in the product’s credit_rules/form_config.
Response: data.id = task_id for polling.
Supported Task Type & Models
category
Capability
Input
text_to_speech
Text → Speech
prompt (text to speak)
Models: This skill supports seed-tts-2.0 only (seed-tts-1.1 is not supported). The script defaults to --model-id seed-tts-2.0 when none is provided. For current attribute_id and credit, the script reads from the product list at runtime.
seed-tts-2.0 — Verified request parameters
The following parameters[].parameters shape has been verified to work for seed-tts-2.0 (attribute_id/credit come from product list and may differ by app/platform):
Parameter
Type
Required
Description
prompt
string
✅
Text to speak (合成文本).
n
int
✅
Usually 1.
model
string
✅
Sub-model: seed-tts-2.0-expressive (default) or seed-tts-2.0-standard.
Note: The script gets attribute_id and credit from the product list (e.g. app=ima&platform=web → often 2 pts / attribute_id 4419 for seed-tts-2.0). If you have a different app/platform (e.g. webAgent), the product list may return different credit_rules (e.g. 5 pts / attribute_id 8987); the script uses whatever the product list returns for the chosen model.
Speaker / 音色列表(seed-tts-2.0 兼容火山引擎音色): 完整音色 ID 与场景分类见项目内 volcengine_tts_timbre_list.json。该文件来自 火山引擎豆包语音合成音色列表,使用原生 voice_type 格式(如 zh_male_sophie_uranus_bigtts 魅力苏菲、zh_female_vv_uranus_bigtts Vivi)。⚠️ 注意: IMA API 只支持原生格式(*_uranus_bigtts 系列),不支持 BV*_streaming 豆包音色 ID。
If the user does not specify, use form_config defaults. Do not send parameters not present in the product’s credit_rules/attributes or form_config (reflection will strip them on retry).