AGTCloud API Docs
GuidesAPI ReferenceIntegrations and resourcesUpdate and help
Video generationKling

Text-to-video

Submit text-to-video tasks using the Kling 4.0 native format.

Prompts can describe both desired and unwanted content. Use settings for duration, resolution, and aspect ratio, and options for callbacks and watermarks.

POST/kling/text-to-video/kling-4.0

Generate Kling 4.0 video from a prompt. The path specifies the model; no model field is needed in the body.

Authorization

bearerAuth
AuthorizationBearer <token>

Use a platform API Key: Authorization: Bearer your-api-key.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

Common errors and troubleshooting

Response or errorWhat to check
HTTP 401, Invalid tokenCheck Bearer authentication and whether the API Key belongs to the requested site
HTTP 400, prompt cannot be emptyProvide a nonempty text prompt
HTTP 400, prompt value type is invalidprompt must be a string, not an array or object
HTTP 400, invalid_requestCheck types such as settings.duration; duration must be an integer
HTTP 400, resolution or aspect-ratio validation errorUse the documented enum values for settings.resolution and settings.aspect_ratio
HTTP 400, invalid JSON request bodyCheck JSON syntax and remove comments from the request body

Generic validation errors may list values beyond those available for this model. Use integer durations of 3–30 seconds and 720p or 1080p as documented here; do not infer other durations or resolutions from error messages alone.

Creation errors may return code/message/data or an error object rather than the success response structure. Find the cause of fail_to_fetch_task in message, which may be a JSON string containing code/message/request_id. Keep the request ID for troubleshooting, but do not share your API Key.