Skip to content

Creative Lab error reference

A successful request returns HTTP 200 with code: 0 in the response body. An error returns the corresponding HTTP status and a machine-readable value in code.

{
"code": 5,
"message": "Insufficient balance, check account balance.",
"trace_id": "662f1a9c4b1e2d0012a3b4c5"
}
FieldTypeRequiredDescription
codenumberyesError code. 0 indicates success. See the table below for error codes.
messagestringyesHuman-readable error description.
detailsarraynoDetails of the validation of input data (at present) code: 3).
trace_idstringnoRequest identifier for support (in internal errors, code: 1).

A missing or invalid API key returns HTTP 401 with { "error": { "message": "Unauthorized" } } in the response body. Check the Authorization header.

Code HTTP Message
1 # 500 Internal server error.
3 # 400 Invalid input, check schema issues.
5 # 402 Insufficient balance, check account balance.
6 # 429 API key limit exceeded. Check your daily or monthly limits.
7 # 403 Model is not available for this account (banned or restricted).
20 # 404 Model not found or is not available via the LAB API.
21 # 410 Model is deprecated or not available for this organization.
22 # 404 Task not found in LAB API v2. Only tasks created via LAB API v2 are available here.
23 # 409 Task with this idempotency_key already exists with different input.
24 # 404 Model is not available for this API key. Request GET /api/v2/media/models to see the models available to you.
25 # 400 Input file was rejected by the model. Check its size, format, resolution and aspect ratio.
26 # 400 Prompt was rejected by the model. Check its length and content.
27 # 400 Requested combination of parameters is not supported by this model.
28 # 503 Generation failed for a reason we could not attribute. Repeat the same request later; if it keeps failing, check the input files and their URLs.
29 # 403 Model is not allowed for this API key. Adjust allowed models in the dashboard or use another key.
30 # 429 Too many generation requests. Retry after the window resets.
31 # 429 Too many tasks running at once. Wait for the current ones to finish.
99 # 404 API method not found, check the URL.
1001 # 400 Sensitive content has been detected in your request or uploaded files. Please check the text and media and try again.
1002 # 400 Request was blocked by moderation.

An empty prompt when calculating Kling price

Section titled “An empty prompt when calculating Kling price”

ERR_EMPTY_PROMPT # When you request a price for kling-v3, the API returns HTTP 400 with code: 3 and details[].message: "ERR_EMPTY_PROMPT" if the prompt is missing or appears only inside params. Add prompt at the top level of the request alongside model, then request the price again.

For kling-image-v4-product, include an image in inputs.image. If the image is present and the prompt is missing, the API returns the same error.