Kling Image 4.0 uses the model ID kling-image/v4.0/text-to-image/series. Generate a coordinated series of 2–10 images from one prompt with Kling Image 4.0. Create storyboards, product collections or visual sequences at 2K, 4K or native 8K.
1. Calling the API
Send requests to https://api.higgsfield.ai/kling-image/v4.0/text-to-image/series with a JSON body matching the parameters below.
Install
Install an official server-side SDK. cURL needs no package.
npm install @higgsfield/clientSetup
Keep credentials in server-side environment variables. The SDKs accept the same KEY_ID:KEY_SECRET value under their documented variable names.
export HF_CREDENTIALS="YOUR_KEY_ID:YOUR_KEY_SECRET" # TypeScript
export HF_KEY="YOUR_KEY_ID:YOUR_KEY_SECRET" # Python and cURLRequest parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | Prompt. Minimum length: 1. Maximum length: 50000. |
resolution | string | No | "2k" | Options: 2k, 4k, 8k. |
aspect_ratio | string | No | "auto" | Options: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, auto. |
series_amount | integer | Yes | — | Number of related images to generate. Charged per image. Minimum: 2. Maximum: 10. |
2. Authentication
The official SDKs read credentials from the server environment and send the required Authorization: Key KEY_ID:KEY_SECRET header.
API Key
Never expose the secret in browser-side code or commit it to source control. The TypeScript SDK is server-side only. For direct HTTP calls, use:
Authorization: Key $HF_KEY3. Queue
subscribe submits the asynchronous request and waits for a terminal result. The TypeScript SDK polls automatically when withPolling: true; the Python SDK's synchronous subscribe call also waits. A completed request returns generated files in the images array.
Submit and wait
import { config, higgsfield } from "@higgsfield/client/v2";
config({
credentials: process.env.HF_CREDENTIALS,
baseURL: "https://api.higgsfield.ai",
});
const result = await higgsfield.subscribe(
"kling-image/v4.0/text-to-image/series",
{
input: {
"prompt": "Create four cohesive storyboard images of a cyclist arriving at a seaside cafe",
"resolution": "2k",
"aspect_ratio": "16:9",
"series_amount": 4
},
withPolling: true,
},
);
console.log(result);Custom polling
For direct HTTP integration, submit the request and poll the returned status_url using the same API credentials until it reaches a terminal status. Use the returned cancel_url to request cancellation while the request is still queued. See the request lifecycle guide for response states.
4. Using this model
Use a non-empty prompt of at most 50,000 characters. resolution accepts 2k, 4k or 8k and defaults to 2k. aspect_ratio defaults to auto; supported values are listed above.
series_amount is required and must be an integer from 2 to 10. Describe the whole sequence in the prompt. The series is generated together; retrieve the resulting images from the completed request.
5. Pricing
| Resolution | Price per image |
|---|---|
2k | $0.063 |
4k | $0.094 |
8k | $0.157 |
The total price is series_amount × price per image. A 4-image series costs $0.252 at 2K, $0.376 at 4K or $0.628 at 8K. Series use the same per-image rates as single images.