Skill streaming (45 configurations)
POST/v1/skills/stream
Call a Skill with a platform API key. Returns streamed SSE events. Documentation is split into the following 45 fixed configurations:
- fashion-campaign-director(Aris-AI Fashion Creative Director)
- street-style-photographer(Wesley-AI Street Photographer)
- icon-designer(Soren-AI Fashion Designer)
- beauty-photography-master(Astor-AI Beauty Photographer)
- beverage-photography(Kairos-AI Drinks & Beverage Photographer)
- ecom_shoe_image_shotlist(Modus-AI Footwear Photographer)
- app-beauty-storyboard-artist(Aura7-AI Beauty Creative Director)
- beverage-ecom-detail-page(Ayn-AI Beverage Detail Page Expert)
- home-appliance-detail-page(Adian-AI Appliance Detail Page Expert)
- product-animation-video(Kara-AI Product Animation Video Director)
- xhs-kol-product-photos(Willa-AI Xiaohongshu Product Seeding Expert)
- appliance-photography(Elias-AI Small Appliance Photographer)
- fashion-shoot(Viora-AI Women's Fashion Photographer)
- kidswear-photography-master(Tania-AI Kidswear Photographer)
- product-motion(Nina-AI Image Animation Expert)
- app-ppt-structure-preserving-polisher(Mia-AI PPT Structure-Preserving Polisher)
- ai-comic-drama-screenwriter(Belle-AI Comic Drama Screenwriter)
- social-media-creator-ops(Yvonne-AI Social Media Strategist)
- ai-comic-drama-video(Mann-AI Comic Drama Video Producer)
- ai-comic-drama-role-image(Sylvia-AI Comic Drama Character Designer)
- xiaohongshu-content-expert(Blade-AI Footwear & Apparel Xiaohongshu Content Expert)
- brand-content-strategy(Roy-AI Content Strategy)
- generic-ai-koc(Awon-AI Virtual KOC Customization Expert)
- mixed-editing-sop-portable-flat-with-voice(Carter-AI Batch Remixing Expert)
- app-video-remix-prep(Pat-AI Batch Video Repurposing Expert)
- app-data-analysis-orchestrator(Yuyu-AI E-commerce Data Analyst)
- app-live-stream-analysis-master(Tutu-AI Live Stream Data Analyst)
- app-fancy-ops-review-delivery(Kitty-Taobao Content Data Analyst)
- app-ppt-framework-master-genready-colleague(Fenton-AI PPT Framework Architect)
- app-mall-leasing-proposal-master(Sion-AI Investment Proposal Planner)
- snacks-product-video(Candy-AI Snack Video Generation Expert)
- skincare-kol-product-video(Mancy-AI Skincare KOL Video Generation Expert)
- fizzy-drink-product-video(Chase-AI Sparkling Drink Product Video Expert)
- women-clothing-detail-page(Shana-AI Women's Clothing Detail Page Expert)
- fizzy-drink-kol-video(Bubble-AI Sparkling Water KOL Video Expert)
- kidswear-detail-page(Togen-AI Kidswear Detail Page Expert)
- app-fashion-product-video(Easeen-AI Fashion Video Generation Expert)
- app-footwear-product-video(Wanford-AI Shoes Video Generation Expert)
- app-alcohol-product-video(Orin-AI Liquor Video Generation Expert)
- app-product-manager(Product Manager)
- app-backend-engineer(Backend Engineer)
- app-frontend-engineer(Frontend Engineer)
- app-qa-test-engineer(QA Test Engineer)
- app-devops-sre-engineer(DevOps SRE Engineer)
- app-software-architect(Software Architect)
Request
Responses
- 200
- 400
- 401
- 402
- 403
Streamed SSE response.
Invalid request body, missing skill_key, or both prompt and attachments are empty.
API key is invalid or missing.
Insufficient balance.
API key is disabled, expired, or not allowed to call this Skill.
SSE Streaming Event Reference (Generic)
Each business message is pushed through SSE as data: {json}\n\n. Parse messages by top-level type.
type | Meaning | Frontend handling suggestion |
|---|---|---|
system | Stream initialization event (usually subtype=init) | Extract session_id (platform-issued) and pass it as session_id on later requests |
assistant | Assistant output chunks (text/image/thinking, etc.) | Render as the main assistant stream |
user | Tool execution output | Mark as "tool output", do not treat as manually typed user input |
file_upload_request | Ask the user to upload images or files | Show an upload UI; after upload, send the file URLs as attachments on the next /v1/skills/stream request with the same session_id |
ask_user_question | Ask the user a question or to pick options | Show questions/options; send the answer as prompt on the next /v1/skills/stream request with the same session_id |
token_stats | Per-turn token usage delta (input/output/cache tokens) | Use for usage UI; do not render as assistant content. Billed immediately |
turn_media_stats | Newly billed generated images/videos for this request | Use for usage UI; do not render as assistant content. Billed immediately. Sum events yourself |
result | Success end signal for the current turn | Stop concatenating the stream and mark completion |
error | Failure end signal for the current turn | Stop concatenating, show the error, and allow retry |
done | Optional end hint | Can close loading; business completion still follows result / error |
heartbeat | Keep-alive JSON data event (about every 15s) | Ignore for rendering |
low_balance | Remaining quota is below the Skill threshold (may be sent after the turn) | Warn the user to top up; do not treat as a stream failure |
Client billing flow
What you receive is already the billable increment. Sum the events you see; do not parse assistant text for URLs.
- First
POST /v1/skills/stream: omitsession_id. - On
system: savesession_id. Send it on every later request. - On
token_stats: chargeinputTokens/outputTokens/ cache fields immediately (this segment’s delta). - On
turn_media_stats: chargemedia_summary.image_count,video_count, andimages/videosimmediately (newly billed assets only). If nothing new was billed, this event is not sent. - If the stream drops: call
GET /v1/skills/usage?session_id=...with the same API key. Reconnect with thatsession_id; already-billed media will not be sent again.
Use billing_event_id as an idempotency key if you persist charges locally.
Notes
- Handle
{"type":"heartbeat"}as keep-alive. Ignore it for rendering. - The stream may end with
data: [DONE]. Treat it as a transport close, not a business event. - Follow-up user input (answers, uploaded files) continues via the next
POST /v1/skills/streamwith the samesession_id. - Ignore unknown
typevalues (log them, do not crash or block the stream). Extra events such asstream_eventmay appear; log them and skip rendering. token_statsandturn_media_statsare deltas for that turn segment. Sum them yourself for session totals. Usage events includerequest_id,session_id,sequence(monotonic in this HTTP request),billing_event_id,billing_mode: "delta", andbillable.turn_media_statsis sent only when this request has newly billed image/video URLs.media_summary.images/videosand the counts are that billed increment. Already-billed URLs are not sent again on reconnect and are not billed again.- Usage events are billed as they arrive. If the stream never sends those two event types, usage is billed once at the end from aggregated totals.
- First request: omit
session_id(or leave it empty). After the firstsystemevent, store the issuedsession_idand send it on every follow-up. After the 200 SSE connection opens, also storeX-Oneapi-Request-Id. If the connection drops after billing, queryGET /v1/skills/usagewith the same API key. Prefer the issuedsession_id; userequest_idif you already have the header;billing_event_idonly matches one event you already received.
file_upload_request example:
{
"type": "file_upload_request",
"questionId": "d7078aab-b67a-427d-ac0c-a87bb7e07dcf",
"uploads": [
{
"prompt": "Upload a garment or lookbook image to start (JPG/PNG, multiple files allowed)",
"header": "Garment images",
"accept": "image/*",
"description": "JPG, PNG, and WebP are supported"
}
]
}
ask_user_question example:
{
"type": "ask_user_question",
"toolUseId": "eabec243-a985-458d-a3e0-50f7fa8e128e",
"questionId": "eabec243-a985-458d-a3e0-50f7fa8e128e",
"questions": [
{
"question": "Which designer should work on this brief today?",
"header": "Choose a designer",
"options": [
{
"label": "Coco Chanel",
"value": "Coco Chanel",
"description": "Liberate the body through simplicity"
},
{
"label": "Christian Dior",
"value": "Christian Dior",
"description": "The New Look — architecture of femininity"
}
]
}
]
}
token_stats example:
{
"type": "token_stats",
"turn_id": "turn-1",
"inputTokens": 500,
"outputTokens": 100,
"cacheReadInputTokens": 0,
"cacheCreationInputTokens": 0,
"request_id": "req-123",
"session_id": "sess_abc123",
"sequence": 1,
"billing_event_id": "skill:req-123:sess_abc123:turn-1:token_stats:1",
"billing_mode": "delta",
"billable": true
}
turn_media_stats example:
{
"type": "turn_media_stats",
"turn_id": "turn-1",
"media_summary": {
"image_count": 1,
"video_count": 1,
"images": [
{
"url": "https://assets.example.com/a.png"
}
],
"videos": [
{
"url": "https://assets.example.com/v.mp4",
"duration_seconds": 3.5
}
]
},
"request_id": "req-123",
"session_id": "sess_abc123",
"sequence": 2,
"billing_event_id": "skill:req-123:sess_abc123:turn-1:turn_media_stats:2",
"billing_mode": "delta",
"billable": true
}