Create/update Kling API account
April 18, 2025
Table of contents
This endpoint adds or updates a Kling account in your configuration. The API will automatically login to verify your credentials.
https://api.useapi.net/v1/kling/accounts
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API token
is required, see Setup useapi.net for details.
Request Body
{
"email": "[email protected]",
"password": "your-password",
"maxJobs": 5
}
-
email
,password
are required.
Please see Setup Kling for details. -
maxJobs
is required, specify maximum number of concurrent jobs (1
-10
)
Responses
-
{ "email": "[email protected]", "session": { "userId": "user12345", "ExpireTime": 123456789, "ExpireTimeUTC": "2025-01-01T12:13:14.000Z" }, "maxJobs": 5, "password": "…secured…" }
-
{ "error": "Account does not exist or password is incorrect" }
-
{ "error": "Unauthorized", "code": 401 }
-
{ "error": "Subscription required", "code": 402 }
Model
{ // TypeScript, all fields are optional
email: string
session: {
userId: string
ExpireTime: number
ExpireTimeUTC: string
}
maxJobs: number
password: string
error: string
}
Examples
-
curl -X POST https://api.useapi.net/v1/kling/accounts \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -d '{"email": "[email protected]", "password": "your-password", "maxJobs": 5}'
-
const token = "API token"; const apiUrl = "https://api.useapi.net/v1/kling/accounts"; const response = await fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`, }, body: JSON.stringify({ email: "[email protected]", password: "your-password", maxJobs: 5 }) }); const result = await response.json(); console.log("response", {response, result});
-
import requests token = "API token" apiUrl = "https://api.useapi.net/v1/kling/accounts" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } data = { "email": "[email protected]", "password": "your-password", "maxJobs": 5 } response = requests.post(apiUrl, headers=headers, json=data) print(response, response.json())