Static validation and live checks complement each other
The contract includes different bodies for video, images and chat. Unknown parameters are rejected rather than silently forwarded. Some catalog restrictions are narrower than a general enum: the currently published image rate supports medium quality only. A complete preflight therefore needs both structural validation and live product settings.
What to do next
- 01
Validate the correct body
Select the schema corresponding to your route and model. Check prompt length, duration bounds, image count or message structure before the user approves the task.
- 02
Verify referenced resources
For H3 reference fields, use owned IDs from the upload endpoint. A string that resembles a UUID is not proof that the account owns a usable image or video.
- 03
Quote after normalization
Send the valid intended body to /quotes. Preserve its result and any validation error, with secrets removed, so the user sees a specific correction rather than a generic failure.
A concrete example
Illustrative preflight: a payload is syntactically valid JSON but contains response_format on the image endpoint. The field is outside the customer contract. Remove it rather than assuming the gateway will forward arbitrary provider parameters.
Before you call it ready
- The selected schema matches the endpoint.
- Live catalog restrictions are checked.
- Validation does not trigger media generation.
When to stop or choose another method
If your validator accepts a field that the service rejects, inspect the exact deployed schema and request body. Do not disable validation globally to force an undocumented payload through.
