Automate AI Video & 300s Avatar Pipelines in n8n with AI Chili REST API
Build reliable, budget-guarded n8n video workflows using four standard HTTP Request nodes: inspect GET /api/v1/registry, quote exact credits via POST /api/v1/generations/plan, submit with execution-scoped idempotency_key, and poll GET /api/v1/generations/{id} until succeeded.
https://aichili.ai/api/v1 · Streamable HTTP MCP https://aichili.ai/mcp · OpenAPI 3.1 /openapi.json.Architecture & Endpoint Overview
| n8n Node Step | HTTP Method & URL | Key Expression / Guard | Failure & Retry Behavior |
|---|---|---|---|
| 1. Fetch Live Models | GET https://aichili.ai/api/v1/registry | No auth required; caches valid model_id list | Safe GET retry |
| 2. Dry-Run Quote ($0) | POST https://aichili.ai/api/v1/generations/plan | IF {{ $json.total_credits <= 40 }} | Halts workflow before any credit spend if out of bounds |
| 3. Enqueue Render | POST https://aichili.ai/api/v1/generations | idempotency_key: n8n-{{ $execution.id }}-{{ $itemIndex }} | Retries replay existing job without duplicate charge |
| 4. Wait + Poll Loop | GET https://aichili.ai/api/v1/generations/{{ $json.id }} | Wait 10s -> Switch on status (succeeded / failed / running) | Failed GPU jobs auto-refund 100% of credits |
4-Step Implementation Blueprint
01 · Store Bearer Credential in n8n Header Auth
Create an n8n Header Auth credential with Name 'Authorization' and Value 'Bearer chili_sk_...' plus header 'User-Agent: curl/8.4.0'.
02 · Wire $0 Plan Node + IF Budget Gate
Send your candidate prompt, model_id, duration_s, and ratio to POST https://aichili.ai/api/v1/generations/plan and route through an IF node checking $json.total_credits.
03 · Submit with Deterministic Execution Key
Pass idempotency_key: 'n8n-' + $execution.id + '-' + $itemIndex in POST /api/v1/generations so n8n node retries never double-bill.
04 · Loop Wait (10s) + Poll Until Succeeded
Connect a 10-second Wait node to GET /api/v1/generations/{{ $json.id }}; route 'queued'/'running' back to Wait, and 'succeeded' to S3, Google Drive, Slack, or social publishing.
1. n8n HTTP Request Node JSON Body (Plan & Submit Payload)
Paste into your n8n HTTP Request node (JSON/RAW mode) with Header Auth + User-Agent: curl/8.4.0:
{
"mode": "t2v",
"model_id": "seedance-2.5",
"idempotency_key": "n8n-{{ $execution.id }}-item-{{ $itemIndex }}",
"params": {
"prompt": "{{ $json.hook_prompt }}",
"duration_s": 10,
"resolution": "1080p",
"ratio": "9:16"
}
}
2. Importable n8n Nodes Snippet (Plan -> Budget IF -> Generate -> Poll)
Copy into an n8n canvas to scaffold the 4-stage plan-before-spend polling loop:
{
"nodes": [
{
"name": "Quote Credits ($0)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [240, 300],
"parameters": {
"method": "POST",
"url": "https://aichili.ai/api/v1/generations/plan",
"sendHeaders": true,
"headerParameters": {
"parameters": [{ "name": "User-Agent", "value": "curl/8.4.0" }]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ mode: 't2v', model_id: 'h3-vdn', params: { prompt: $json.prompt, duration_s: 15, resolution: '768p', ratio: '9:16' } }) }}"
}
},
{
"name": "Submit Generation",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [680, 300],
"parameters": {
"method": "POST",
"url": "https://aichili.ai/api/v1/generations",
"sendHeaders": true,
"headerParameters": {
"parameters": [{ "name": "User-Agent", "value": "curl/8.4.0" }]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ mode: 't2v', model_id: 'h3-vdn', idempotency_key: 'n8n-' + $execution.id, params: { prompt: $('Quote Credits ($0)').item.json.prompt || 'Rainy neon street, 35mm dolly', duration_s: 15, resolution: '768p', ratio: '9:16' } }) }}"
}
}
]
}
Recommended AI Chili Engines for n8n Workflows
Avatar-Talk
Script-driven billing: 0.2 credits per 5 script units on 'talk' (video loop), plus a +10 credit 768p base-clip charge on 'photo' (portrait still).
Model Spec → seedance-2.5Seedance 2.5
Live pre-calculated quote via POST /v1/generations/plan; reference videos scale proportionally by max(1, 0.6 × (out_s + ref_s) / out_s).
Model Spec → h3-vdnH3-VDN
Deterministic per-second rate: 0.6 cr/s (480p), 1.0 cr/s (768p), 1.8 cr/s (1080p), 2.5 cr/s (2K), rounded up to whole credits (also accepts alias h3-sol).
Model Spec →Frequently Asked Questions
Why is non-expiring PAYG pricing ideal for scheduled n8n automations?
Triggered CRM or e-commerce n8n workflows often fire in bursts around product launches and sit quiet in between; non-expiring $9.90-$49.90 credit packs ensure idle weeks cost $0.
How should n8n handle HTTP 429 rate_limited responses?
Enable Retry On Fail on the HTTP Request node and honor the Retry-After response header; keeping the same idempotency_key guarantees safe retries.
Can n8n automate 9:16 talking-avatar reels from Airtable or Notion scripts?
Yes. Upload your presenter photo or studio loop once to obtain its asset UUID, then pass model_id: 'avatar-talk', mode: 'i2v', workflow: 'talk' (or 'photo'), and each row's script in params.prompt.
Explore Other Stack Integrations
Claude Code
Attach AI Chili's remote Streamable HTTP MCP server (https://aichili.ai/mcp) to Claude Code in one command, install…
View Integration → AI IDE & Composer IntegrationCursor IDE
Add https://aichili.ai/mcp (or npx -y @aichili/mcp) to .cursor/mcp.json so Cursor Agent generates promo reels, UI…
View Integration → Hosted MCP & OpenAPI 3.1 Tool CallingOpenAI Agents
Point OpenAI's Responses API Hosted MCP tool directly at https://aichili.ai/mcp with require_approval: 'always' on…
View Integration → Backend Python 3.10+ IntegrationPython (SDK, urllib & httpx)
Install the official zero-dependency Python SDK, CLI & stdio MCP server via pip install…
View Integration → Next.js, Workers & Edge Runtime GuideTypeScript & Node 22
Run AI Chili across Node.js 22, Next.js Route Handlers, Cloudflare Workers, and Vercel Edge using standard Web Fetch…
View Integration →