API index
Run frozen workflows with an account key. API base https://flow.dianwu.ai; site dianwu.ai; key prefix dwflow_.
1. Get a key
- After sign-in, open API keys and create a key (shown once).
- Freeze a flow under Workflows and copy the workflow ID (on the card: /api/v1/workflows/…/run).
Sign in to see your workflow IDs here.
2. Auth
All product APIs use this header:
Authorization: Bearer dwflow_YOUR_KEY
3. List workflows
GET https://flow.dianwu.ai/api/workflows
curl "https://flow.dianwu.ai/api/workflows" \ -H "Authorization: Bearer dwflow_xxx"
4. Run a workflow remotely
POST https://flow.dianwu.ai/api/v1/workflows/YOUR_WORKFLOW_ID/run
POST JSON columns and rows. Output follows the frozen layout and returns Excel base64 by default.
If the workflow has run params or file inputs, open its run page and see the Remote API examples (same params as the UI).
curl -X POST "https://flow.dianwu.ai/api/v1/workflows/YOUR_WORKFLOW_ID/run" \
-H "Authorization: Bearer dwflow_xxx" \
-H "Content-Type: application/json" \
-d '{
"fileName": "orders.xlsx",
"sheetName": "Sheet1",
"columns": ["Customer", "Amount"],
"rows": [
{"Customer": "A", "Amount": 1200},
{"Customer": "B", "Amount": 800}
],
"excel": true
}'Success fields:
layout— Applied layoutpreview— Preview row count, groups, and totalsexcelBase64— xlsx file (decode and save)quota— Monthly conversion quota usage
5. Save Excel (Node)
import fs from "fs";
const res = await fetch("https://flow.dianwu.ai/api/v1/workflows/YOUR_WORKFLOW_ID/run", {
method: "POST",
headers: {
Authorization: "Bearer dwflow_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
columns: ["Customer", "Amount"],
rows: [{ Customer: "A", Amount: 1200 }],
}),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error);
fs.writeFileSync(data.excelFileName, Buffer.from(data.excelBase64, "base64"));6. Model API (metered USD)
Some pool models are callable via an OpenAI-compatible API. Official list price in USD times a top-up tier markup is billed to wallet. Default DeepSeek official: deepseek-chat / deepseek-reasoner / deepseek-v4-flash / deepseek-v4-pro, plus embeddings qwen3.7-text-embedding-flash.
Markup: Default ×1.5 · $1,000 lifetime (约 ¥7,200) → ×1.3 · $5,000 (约 ¥3.6万) → ×1.1. List CNY is converted at mid-market plus ~1% buffer; see GET https://flow.dianwu.ai/api/v1/models for the live rate. Insufficient balance returns 402. Top up USD in Dashboard first.
GET https://flow.dianwu.ai/api/v1/models
curl "https://flow.dianwu.ai/api/v1/models" \ -H "Authorization: Bearer dwflow_xxx"
POST https://flow.dianwu.ai/api/v1/chat/completions
curl -X POST "https://flow.dianwu.ai/api/v1/chat/completions" \
-H "Authorization: Bearer dwflow_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat",
"messages": [{"role":"user","content":"Hello"}]
}'Success responses also include billing (this call’s USD and remaining balance).
Streaming: set "stream": true for OpenAI-compatible SSE (text/event-stream). We bill from usage after the stream (upstream usage, or a length estimate).
curl -N -X POST "https://flow.dianwu.ai/api/v1/chat/completions" \
-H "Authorization: Bearer dwflow_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat",
"stream": true,
"messages": [{"role":"user","content":"Hello"}]
}'Speech-to-text (OpenAI-compatible): POST https://flow.dianwu.ai/api/v1/audio/transcriptions. Default models whisper-1 / qwen3-asr-flash / seed-asr-auc; multipart audio — not chat/completions.
curl -X POST "https://flow.dianwu.ai/api/v1/audio/transcriptions" \ -H "Authorization: Bearer dwflow_xxx" \ -F "file=@./sample.wav" \ -F "model=whisper-1"
Voice clone then speech (Qwen CosyVoice): first POST https://flow.dianwu.ai/api/v1/audio/voices with model=cosyvoice-v3.5-plus and a public audio url; it returns voice_id. Then POST https://flow.dianwu.ai/api/v1/audio/speech with model, input, and voice. v3.5-plus has no system voices — clone first. Do not use chat/completions.
curl -X POST "https://flow.dianwu.ai/api/v1/audio/voices" \
-H "Authorization: Bearer dwflow_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "cosyvoice-v3.5-plus",
"url": "https://example.com/sample.wav",
"prefix": "dwflow"
}'curl -X POST "https://flow.dianwu.ai/api/v1/audio/speech" \
-H "Authorization: Bearer dwflow_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "cosyvoice-v3.5-plus",
"voice": "cosyvoice-v3.5-plus-dwflow-xxx",
"input": "点物 Flow,几小时的事,现在几分钟就能跑完。"
}'Music (Suno): POST https://flow.dianwu.ai/api/v1/music/generations. Default models suno-v5 / suno-v5-5 / suno-v4-5-plus / suno-v4-5 / suno-v4-5-all / suno-v4. Poll with GET using taskId. The same model also works on chat/completions (no stream).
curl -X POST "https://flow.dianwu.ai/api/v1/music/generations" \
-H "Authorization: Bearer dwflow_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "suno-v5",
"prompt": "A gentle piano lullaby, 90 seconds",
"title": "Night Song",
"wait": false
}'Video (Ark Seedance): POST https://flow.dianwu.ai/api/v1/videos/generations. Default models seedance-2-0 / seedance-2-mini / seedance-2-fast / seedance-2-5. Billed per second; poll GET ?taskId= for videoUrl. Requires platform ARK_API_KEY.
curl -X POST "https://flow.dianwu.ai/api/v1/videos/generations" \
-H "Authorization: Bearer dwflow_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-0",
"prompt": "一只柯基在草地上奔跑,慢镜头,阳光逆光",
"durationSec": 5,
"wait": false
}'docs.s6.image
curl -X POST "https://flow.dianwu.ai/api/v1/images/generations" \
-H "Authorization: Bearer dwflow_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5.0",
"prompt": "一只柯基坐在窗边,柔和自然光,写实摄影",
"size": "2K"
}'Embeddings (OpenAI-compatible): POST https://flow.dianwu.ai/api/v1/embeddings. Default model qwen3.7-text-embedding-flash (Qwen, ~¥0.125/M input, 1024-d); text-embedding-v4 also works. input is a string or string array, max 10 items. Do not use chat/completions.
curl -X POST "https://flow.dianwu.ai/api/v1/embeddings" \
-H "Authorization: Bearer dwflow_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.7-text-embedding-flash",
"input": ["发票汇总", "按客户对账"]
}'7. Error codes
401— Not signed in or invalid key402— Monthly conversion quota exhausted, or model balance too low403— Model is not open for API calls422— Uploaded columns do not match the workflow (missing columns)404— Workflow missing or not owned by this account