Explore/Kling 4.0 Flash
Video

Kling 4.0 Flash

Generate 720p videos from text prompts with Kling 4.0 Flash. Choose a duration from 3 to 20 seconds and an aspect ratio of 21:9, 16:9, 9:16, or 1:1.

View docs
import { config, higgsfield } from "@higgsfield/client/v2";config({  credentials: process.env.HF_CREDENTIALS,});const result = await higgsfield.subscribe(  "kling-video/v4.0-flash/text-to-video",  {    input: {      "prompt": "A cinematic scene at sunset",      "duration": 10,      "resolution": "720p",      "aspect_ratio": "16:9"    },    withPolling: true,  },);console.log(result);

1. Calling the API

Use the Higgsfield client to call Kling 4.0 Flash from your application.

Install

Choose the installation method for your selected client. cURL does not require a client package.

npm install @higgsfield-ai/client

Setup

Create a client and submit input to the model endpoint.

import { HiggsfieldClient } from '@higgsfield-ai/client' const client = new HiggsfieldClient({ apiKey: process.env.HIGGSFIELD_API_KEY, })

2. Authentication

API Key

Pass your API key through the client configuration or the authorization header.

Authorization: Bearer $HIGGSFIELD_API_KEY

Keep API keys on the server and never expose them in browser code.

3. Queue

Model requests run asynchronously. Submit a request, then fetch it until it reaches a terminal state.

Submit

const request = await client.submit('kling-video/v4.0-flash/text-to-video', { prompt: 'A cinematic portrait in soft natural light', })

Fetch

const result = await client.requests.get(request.id)