Porting native Wan examples to CometAPI: request fields are only half the contract

A native Wan example with duration and a media array is not a CometAPI request with a different base URL. CometAPI’s Wan 2.7 guide describes a separate, unified video schema. The useful migration boundary is what the CometAPI route accepts, not everything the underlying model family can do.

Here is a field-mapping checklist based on that official guide, published August 31 and fetched September 7, 2026. It is documentation-based, not a report of a tested integration.

Start with the route, then translate the fields

Before adapting a tutorial, confirm the current route documentation, arrange server-side authentication, and choose a simple text-to-video request. The guide describes multipart creation at POST https://api.cometapi.com/v1/videos, using model=wan2.7.

Native tutorial assumption CometAPI mapping in the guide Migration consequence
Use wan2.7-t2v or a native I2V variant identifier wan2.7 Do not carry the native model string across unchanged.
Duration is named duration seconds Translate the field; separately confirm the route’s allowed values.
Resolution and aspect ratio are separate resolution and ratio fields size, with 1280x720 as an example Map the intended dimensions rather than just renaming resolution.
A first frame lives in media[].type=first_frame input_reference file input Confirm the multipart upload requirements instead of forwarding the native media array.
The task identifier lives at output.task_id The guide lists id or task_id Verify the response shape before wiring the parser.

For example, the guide’s small baseline uses model=wan2.7, a prompt, seconds=5, and size=1280x720. Treat these as fields to check against the current multipart route, not as a complete executable request. A five-second baseline also avoids assuming that every duration documented for native Wan is accepted by CometAPI.

Translate the response contract too

The guide describes a create–poll–download lifecycle: keep the returned identifier, query GET /v1/videos/{id}, and retrieve the finished output through GET /v1/videos/{id}/content. Returning from the creation call is not the same as having a completed clip.

My suggested migration check is to verify identifier extraction and terminal-state handling before adding image input. Otherwise a request-field fix can mask a second bug: a parser still looking for Alibaba’s output.task_id, or code treating task creation as the final result. Confirm the actual response wrapper and documented status values; the mapping table alone is not a full response specification.

Leave advanced native controls unproven

The same guide explicitly warns that CometAPI’s unified schema may not expose every Alibaba field. Its discussion of native first/last-frame workflows, continuation, and audio guidance does not establish their exact availability on this route.

I would keep those options disabled until each has an explicit CometAPI field mapping and a controlled compatibility check. Add one feature at a time after the baseline works, and distinguish “documented for native Wan” from “documented for the CometAPI route” in your own integration notes. Do not infer either support or lack of support from a missing example.

The practical question before porting a native tutorial is: can you point to a CometAPI contract for each request field and each response field your application depends on? If not, that field is still a migration assumption—not an implemented feature.

I would add a recovery boundary to the field-mapping checklist: a missing task ID is not proof that creation failed. That matters when testing the new response parser—a timeout or an unrecognized response wrapper should not automatically trigger another video creation request.

My suggested runbook is:

  • Before sending, record a local attempt ID and the adapter version. Keep credentials, prompts, and uploaded media out of diagnostic logs; retain only the permitted correlation metadata needed for investigation.
  • If creation returns but the parser cannot extract an identifier, stop automatic resubmission and flag a response-contract mismatch. Alert on that separately from a documented task failure: the former means the client cannot establish the task’s identity, not that generation failed.
  • If creation times out without an identifier, mark the attempt as unresolved. Use only a documented lookup or deduplication mechanism to reconcile it; do not assume the unified route accepts an idempotency header. If no such mechanism is documented, escalate for investigation rather than retrying creation blindly.
  • Once an identifier is known, keep polling recovery separate from creation recovery. Bound polling by an elapsed-time budget and backoff policy; exhausting that budget should leave the task unresolved locally, not manufacture a provider failure or start a replacement task.

These are proposed client safeguards, not claims about CometAPI’s current retry guarantees. A useful adapter test would simulate a successful create response with an unexpected wrapper and assert that the client raises a contract alert without issuing a second POST. That tests a failure mode the happy-path field mapping cannot catch.