Appearance
n8n 接入
n8n 是开源工作流自动化引擎,可通过 HTTP 请求节点调用心流 API。
对话节点
在工作流中添加 HTTP Request 节点:
| 配置项 | 值 |
|---|---|
| Method | POST |
| URL | https://iliu.ai/v1/chat/completions |
| Header | Authorization: Bearer sk-xxxxxxxx |
| Header | Content-Type: application/json |
| Body (JSON) | {"model":"gpt-5.1","messages":[{"role":"user","content":"{{$json.input}}"}]} |
图像生成节点
同上,URL 改为 https://iliu.ai/v1/images/generations:
json
{"model":"gpt-image-2","prompt":"{{$json.prompt}}","size":"1024x1024","n":1}视频生成
分三步(三个 HTTP Request 节点串联):
- 提交 —
POST /v1/videos→ 提取task_id - 轮询 —
GET /v1/videos/{{task_id}}+ Wait 节点(间隔 10s)→ 判断 status - 下载 —
GET /v1/videos/{{task_id}}/content或直接下载url
