Visual Workflow Orchestration

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.

Last updated: By AI Chili Platform & Developer Experience Team Entity: AI Chili Inc. (Vancouver, BC)
Key Endpoints: REST Gateway https://aichili.ai/api/v1 · Streamable HTTP MCP https://aichili.ai/mcp · OpenAPI 3.1 /openapi.json.

Architecture & Endpoint Overview

n8n Node StepHTTP Method & URLKey Expression / GuardFailure & Retry Behavior
1. Fetch Live ModelsGET https://aichili.ai/api/v1/registryNo auth required; caches valid model_id listSafe GET retry
2. Dry-Run Quote ($0)POST https://aichili.ai/api/v1/generations/planIF {{ $json.total_credits <= 40 }}Halts workflow before any credit spend if out of bounds
3. Enqueue RenderPOST https://aichili.ai/api/v1/generationsidempotency_key: n8n-{{ $execution.id }}-{{ $itemIndex }}Retries replay existing job without duplicate charge
4. Wait + Poll LoopGET 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

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