Genace

Kling API error: the validation failures specific to this model

Most API errors are the same on every model. These are the ones specific to Kling 2.0 Standard — payloads another model would accept.

What you sentYou getWhy
duration_sec not 5 or 10400 INVALID_PARAMOnly those lengths exist upstream
resolution other than 1080p400 INVALID_PARAMSingle resolution tier on this model
aspect_ratio outside 16:9, 9:16, 1:1400 INVALID_PARAMNarrower than some other models — a ratio that works elsewhere fails here
model misspelled400 UNKNOWN_MODELThe exact id is kling-2.0-standard

All of these fail before anything is submitted upstream, so no credits are touched and there is nothing to reconcile. The response names the offending field in error.param.

The errors that are not your fault

Different category, and they arrive differently: a job that was accepted and then failed returns a successful HTTP response describing a failure.

{ "state": "failed", "error": { "code": "UPSTREAM_EMPTY_RESULT" } }

Your try/catch will not see it. Check state, not the status code. Credits refund in full. Full taxonomy in job state failed and UPSTREAM_FAIL.

Errors that apply to every model

Full parameter reference: Kling API parameters.

Models covered on this page

Where these facts come from

  • codebase: src/ai/providers/kling.ts — paramsSchema
  • codebase: src/ai/jobs/service.ts — validation and error mapping