Field SOP
Field SOP

Zero-Cost AI Multimodal Workflow SOP: Free API + Chinese Models + Local Models

Stack three layers to build a zero-cost multimodal pipeline in 2026: Agnes's free OpenAI-compatible API (one key for text/image/video), Chinese pay-as-you-go models (DeepSeek/Qwen/Jimeng/Kling), and local open-weight models (Wan2.1/Hunyuan/CogVideo). Includes a five-step SOP, runnable Python with async video polling and local fallback, plus five pitfalls.

Published August 10, 20268 min read
<!-- zero-cost-ai-multimodal-workflow-sop | sop | Zero-Cost AI Multimodal Workflow SOP: Free API + Chinese Models + Local Models -->

Building an AI workflow that emits text, images, and video in 2026 no longer requires paying OpenAI a monthly fee. Three shifts collapsed the cost structure: OpenAI-compatible multimodal APIs with free tiers appeared (Agnes covers text, image, and video behind one key); Chinese model APIs matured into a full matrix (DeepSeek, Tongyi Qwen, Jimeng, Doubao, Kling span text to audio/video); and open-weight video models became usable locally (Wan2.1, Hunyuan, CogVideo run on consumer GPUs). Three legs--when one falters, the other two hold. That is what makes "zero cost" real, not betting that any single provider stays free forever.

This SOP gives a copyable flow: audit needs -> unify access -> build a minimal pipeline -> local fallback -> cost control, in five steps. Code is compiled from Agnes's official docs, OpenMontage's PROVIDERS.md (the Chinese/local model registry), and each provider's official docs, current as of 2026-08-10; API shapes follow the official source, and free quotas are subject to each platform's announcements. It complements this batch's Agnes 5-model review (which Agnes model to pick), OpenMontage as a domestic alternative (its PROVIDERS list feeds this SOP's model mapping), and the Hy3 free-window hotspot (another free text-model option, free before 8/31). Read them together.


1. Why Zero Cost Works in 2026: Three Layers, Each Covering a Gap

"Zero cost" is not freeloading one API. It is three layers stacked so single-provider dependency drops to zero:

  • Free API layer: An OpenAI-compatible multimodal gateway like Agnes covers text/image/video behind one key with RPM and quota. Low integration cost (swap base_url), but limited quota that may change. See this batch's Agnes review.
  • Chinese model layer: DeepSeek (text/code), Tongyi Qwen via DashScope (image+TTS+ASR), Jimeng (ByteDance, video), Doubao Speech (TTS), Kling (Kuaishou, video). Pay-as-you-go but cheap--the first fallback when free quota runs out. Hy3 has a free window before 8/31 and can temporarily serve as a text workhorse.
  • Local model layer: Wan2.1 (Alibaba, video), Hunyuan (Tencent, video), CogVideo (Zhipu, video), WhisperX (subtitles). Zero API cost, GPU-hungry--the last-resort fallback when quota is fully spent.

The layers are not "pick one." They form a degradation chain: free tier maxed -> switch to Chinese pay-as-you-go -> switch to local. No single layer is stable alone; stacked, they are.


2. Need -> Model Mapping Table

Before coding, list the modalities you need and rank each by "free first -> Chinese next -> local fallback." This table aligns with OpenMontage's PROVIDERS.md and is reusable:

ModalityFree firstChinese alternative (usage-based)Local fallback (zero cost)
Text/codeAgnes agnes-2.5-flashDeepSeek / Qwen-Max / Hy3 (in free window)Qwen local / llama.cpp
Text-to-imageAgnes agnes-image-2.1-flashQwen-Image (DashScope) / JimengSD / Flux local
Image/text-to-videoAgnes agnes-video-v2.0Jimeng / KlingWan2.1 / Hunyuan / CogVideo
TTSAgnes (if offered)Doubao Speech / Qwen TTSedge-tts / XTTS local
Subtitles--WhisperX local

How to use: pick one primary per row, two fallbacks; have your orchestrator switch based on quota state.


3. The Five-Step SOP

Step 1 Audit needs and model mix: list your modalities; assign each a primary plus two fallbacks from the table in section 2. The point is not to pick only a primary--free quota always runs out, and a pipeline with no fallback dies the first time it hits the cap.

Step 2 Unify access: OpenAI compatibility is the key. Agnes gives one key + one base_url for both text and image (use the openai SDK directly), saving you three SDKs' worth of cognitive overhead. Non-compatible Chinese APIs (e.g., DashScope) use their native SDK, but wrap them behind a uniform interface (a single generate_text(prompt) / generate_image(prompt) signature) so swapping models only changes the implementation.

Step 3 Build the minimal pipeline: get text -> image -> video working as one chain first. Do not pile on five modalities at once. Once this chain runs, adding TTS or subtitles is wiring, not a rewrite. Section 4 has runnable code.

Step 4 Local fallback: add a switch VIDEO_GEN_LOCAL_MODEL=wan2.1-14b on the video step so quota exhaustion routes to local generation. Section 5 has the config.

Step 5 Cost control: cache repeated requests, run video off-peak, rotate keys (watch the ToS), keep video tasks async and serial--do not fire them concurrently. Monitor usage per endpoint; the moment you cross the free tier, drop to the next layer of the degradation chain.


4. Minimal Runnable Pipeline: Text -> Image -> Video

This Python runs three steps: agnes-2.5-flash writes the storyboard -> agnes-image-2.1-flash renders the first frame -> agnes-video-v2.0 turns the image into video (async polling). Text and image go through the openai SDK (compatible); video is a task-based async endpoint hit directly with requests.

python
import os, time, requests
from openai import OpenAI

AGNES_KEY = os.getenv("AGNES_API_KEY", "ag-xxxxxxxx")  # desensitized; never hardcode
BASE = "https://apihub.agnes-ai.com/v1"

# Text + image via the OpenAI-compatible SDK: just swap base_url
client = OpenAI(api_key=AGNES_KEY, base_url=BASE)

# Step 1 Text: generate a 15s storyboard (free tier, 20 RPM)
script = client.chat.completions.create(
    model="agnes-2.5-flash",
    messages=[{"role": "user",
               "content": "Write a 15-second product video storyboard. Output three shot descriptions, one per line."}],
)
shots = script.choices[0].message.content
first_shot = shots.splitlines()[0]
print("Storyboard:", shots)

# Step 2 Image: text-to-image (image RPM quota)
img = client.images.generate(
    model="agnes-image-2.1-flash",
    prompt=first_shot,
    n=1,
    size="1280x720",
)
image_url = img.data[0].url
print("First frame:", image_url)

# Step 3 Video: image-to-video, async task (video quota)
# Video is a task endpoint not in the openai SDK; hit Agnes directly with requests
headers = {"Authorization": f"Bearer {AGNES_KEY}"}
create = requests.post(f"{BASE}/videos/generations", headers=headers, json={
    "model": "agnes-video-v2.0",
    "image": image_url,
    "prompt": shots,
}, timeout=30).json()
task_id = create["id"]

# Critical: video is async. You MUST poll; the create call only returns an id.
for _ in range(60):  # wait up to 10 minutes
    st = requests.get(f"{BASE}/videos/generations/{task_id}",
                      headers=headers, timeout=30).json()
    if st["status"] == "succeeded":
        print("Video URL:", st["video"]["url"])
        break
    if st["status"] == "failed":
        raise RuntimeError("Video generation failed: " + st.get("error", "unknown"))
    time.sleep(10)

Quota per step: text 20 RPM, image under the image RPM quota, video under the task quota--all subject to the platform. When quota runs out, swap Step 3 for the local fallback in the next section; the first two steps stay untouched.


5. Local Model Fallback Config

Video quota runs out first, so local fallback mainly covers video. Set VIDEO_GEN_LOCAL_MODEL; when quota is short, the script routes to a local Wan2.1 run with zero API cost:

python
# Local fallback: Wan2.1 offline video, zero API cost
# Env: pip install diffusers torch accelerate
# Sizing: 24GB+ VRAM for 14b; ~8GB for 1.3b. Pick to your hardware.
import os, torch
from diffusers import WanPipeline

model_id = os.getenv("VIDEO_GEN_LOCAL_MODEL", "Wan-AI/Wan2.1-T2V-14B-Diffusers")
pipe = WanPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16).to("cuda")

video = pipe(
    prompt=first_shot,          # reuse the storyboard line from above
    num_frames=49, height=720, width=1280,
    num_inference_steps=30,
).frames[0]
# Export to mp4 with imageio / opencv (omitted)

Sizing discipline: 24GB+ VRAM for the 14b (best quality); otherwise the 1.3b (lower quality but it runs). Hunyuan and CogVideo are drop-in alternatives with similar interfaces. Local fallback ignores RPM limits--slow but stable, the last line of defense when the free tier is gone.


6. Five Pitfalls

Pitfall 1: Treating a free API as production Quota runs out and the service stops; with no fallback you go dark on the spot. Fix: give every modality a Chinese/local fallback per section 2, and have the orchestrator auto-degrade on 429 or quota errors. Never let the pipeline single-depend on the free tier.

Pitfall 2: Not polling video, getting nothing back Video is an async task: the create endpoint returns only a task_id; status and result live on the query endpoint. Use the create response directly and you get an id, not a video. Fix: loop GET /videos/generations/{id} like section 4, with a max wait and a failure branch.

Pitfall 3: Assuming every Chinese model is drop-in Chinese model APIs are not uniform. DashScope is not OpenAI-compatible--parameter names and response shapes differ; Jimeng and Kling each have their own signatures. Fix: use the native SDK for non-compatible ones, but wrap them behind a uniform interface (generate_image(prompt)->url) so swapping models changes only the implementation, not the pipeline.

Pitfall 4: Forcing a 14b locally and OOMing The 14b needs 24GB+ VRAM; forcing it causes OOM or glacial speed. Fix: check your GPU first--8-12GB takes the 1.3b, 16GB the 5b, 24GB+ the 14b. Watch real usage with nvidia-smi and leave headroom for the OS.

Pitfall 5: Multi-key rotation tripping the ToS Spinning up multiple accounts to concurrency-farm video quota can violate the terms of service and get you banned. Fix: run video serially on one account (video is async-slow anyway; concurrency buys nothing), and reserve multi-key for isolating usage across distinct projects, not for concurrency-farming one account.


7. FAQ

Q1: Is Agnes's free quota enough? Enough for prototypes and small-batch production, not for scale. Text at 20 RPM covers personal daily use; image RPM covers tens of images; video quota is the smallest and runs out first. The rule: after the pipeline runs, check a week of real usage--past 70% of the free tier, move the video step to local or Chinese pay-as-you-go. Quotas change; trust the platform.

Q2: Can I build this without Agnes? Yes. Agnes's value is one key for all modalities plus OpenAI compatibility, which saves integration effort. You can go all-Chinese: DeepSeek text + Qwen-Image + Jimeng video, pay-as-you-go but cheap. Or all-local: Qwen local + Flux + Wan2.1, zero API cost but GPU-bound. Agnes is just the most convenient "free-first" layer, not a requirement.

Q3: How long does local video take? The 14b on a 24GB card takes minutes to low-teens for 5s of 720p (depending on step count)--slower than APIs but free. The 1.3b is much faster but lower quality. If time matters, prefer an API (free or paid); keep local as fallback only.

Q4: n8n or Python scripts for orchestration? For prototypes and a single pipeline, Python is most direct (this article's code). For visual editing, scheduled triggers, branching, and human-in-the-loop approval, use n8n. They are not exclusive: n8n can call your wrapped Python functions, keeping complex logic in Python and scheduling in n8n.

Q5: How does this relate to OpenMontage? They complement each other. OpenMontage is an open-source orchestration framework whose PROVIDERS.md catalogs Chinese/local models (this SOP's section 2 mapping aligns with it). You can run this SOP's flow by hand in Python, or slot it into OpenMontage to reuse its provider adapters and skip writing the uniform interface yourself. See this batch's OpenMontage guide.


Reusable Orchestration Template

text
# Multimodal workflow orchestration template (pseudocode)
PIPELINE:
  1. text_gen(prompt) -> script          # Agnes agnes-2.5-flash, free first
  2. image_gen(script.first_shot) -> img  # Agnes agnes-image-2.1-flash
  3. video_gen(img, script) -> video      # Agnes agnes-video-v2.0; on quota, local Wan2.1
  4. (optional) tts(script) -> audio      # Doubao Speech / Qwen TTS
  5. (optional) asr(audio) -> subtitle    # WhisperX local

FALLBACK_RULE:
  On failure or 429 -> degrade per mapping table: free -> Chinese usage-based -> local
  Video step prefers local (cost-sensitive); text/image prefer Chinese usage-based (quality-sensitive)

COST_RULE:
  Cache identical-prompt results; video async and serial, never concurrent; monitor per-endpoint usage

References

This article is AI-assisted and human-edited. Last updated: 2026-08-10

FAQ

Is Agnes's free quota enough?
Enough for prototypes and small-batch production, not for scale. Text 20 RPM covers personal daily use; images cover dozens; video quota is the smallest and most easily exhausted. After running a week, if you exceed 70% of free tier, switch video to local or Chinese pay-as-you-go; quotas change per platform.
Can I build this without Agnes?
Yes. Agnes's value is one key for all modalities + OpenAI compatibility saving integration effort. You can go all-Chinese (DeepSeek+Qwen-Image+Jimeng, pay-as-you-go but cheap) or all-local (local Qwen+Flux+Wan2.1, zero API cost but GPU-hungry). Agnes is just the easiest free-first layer, not required.
How long does local video generation take?
14b on a 24GB GPU takes minutes to ~15 min for 5s 720p -- slower than API but zero cost; 1.3b is faster but lower quality. For time-sensitive tasks use API; local is only fallback.
n8n or Python scripts for orchestration?
Python is most direct for prototypes and single pipelines; n8n for visual, scheduled, multi-branch, human-in-the-loop approval. They compose: n8n calls wrapped Python interfaces, complex logic in Python, scheduling in n8n.
How does this relate to OpenMontage?
Complementary. OpenMontage is an open-source orchestration framework; its PROVIDERS.md lists Chinese/local models (this SOP's mapping table aligns with it). You can run the pipeline in pure Python, or plug into OpenMontage to reuse its provider adapter layer and skip writing a unified interface yourself.

Related

Field SOP

LLaDA-Image Local Deploy SOP: Setup, Inference, Production

A five-step SOP for running Ant's open-source 6B image model LLaDA-Image: (1) environment setup with dependencies and mirror-accelerated downloads; (2) choosing among four weight variants (Base 50-step / Turbo 4-step, each in BF16 or FP8, with ModelScope for China); (3) generating the first image with minimal Base and Turbo commands; (4) advanced work - reference-image editing, text rendering, ComfyUI integration, and degradation strategies when VRAM runs short; (5) productionizing with batch queues, concurrency sizing, cost monitoring, result storage and graceful failure modes. Includes 6 pitfalls and a 10-item launch checklist, with every command copied verbatim from the official README; note the repo license is null, so confirm rights before commercial use.

Sep 9, 202611 min read
Field SOP

Self-Hosting OpenMAIC: From Zero-Deploy to Agent Workbench

A complete SOP for getting OpenMAIC running from zero: (1) zero-deploy hosted mode with an access code from open.maic.chat; (2) standard local setup (pnpm >= 10: clone, pnpm install, .env, pnpm dev); (3) production (pnpm build && pnpm start, one-click Vercel, docker compose up --build); (4) advanced (Postgres persistence profile, ACCESS_CODE, MP4 export profile, Lemonade/FunASR local providers); (5) wiring it into agent workbenches (clawhub install openmaic or importing skills/openmaic/, generating classrooms from Feishu/Slack messages). Includes 6 pitfalls and a 10-item pre-launch checklist, with every command copied verbatim from the official README.

Sep 8, 202611 min read