How Do I Normalize Inputs and Outputs When Media APIs Use Incompatible Schemas?
Normalize image and video APIs with a canonical request, provider adapters, explicit extensions, and stable job and output states.

Overview
Normalize the workflow concepts that are truly shared, then preserve model-specific controls in an extension layer. Trying to force every image, video, audio, and editing model into one flat request usually creates misleading fields and silent defaults.
Build a canonical contract
A useful request can include model, prompt, negative_prompt, reference_media, output_size, duration, seed, webhook, and provider_options. The response can normalize request_id, provider_task_id, status, outputs, error, usage, and timestamps.
Each adapter should perform three explicit steps: validate the canonical request against current capabilities, map fields into the provider schema, and transform the raw response back into your job model. Keep the untouched provider response for debugging. Never silently drop an unsupported parameter; return a capability error or require an intentional fallback.
WaveSpeedAI already unifies authentication and access across its model catalog, but each model still has its own request schema. Treat that model-specific schema as the source of truth rather than assuming every endpoint accepts the same media fields.
Version both sides
Version your canonical contract separately from provider adapters. Add capability flags for masks, multiple references, native audio, seed support, and output formats. Contract tests should run against representative endpoints after schema changes.
Keep the abstraction honest
The goal is not to make every model identical. It is to give your product stable job handling while allowing meaningful model differences to remain visible and testable.





