Panduan
Migrating from kie.ai
Keep your kie.ai integration and point it at Minu. What works unchanged, what behaves differently, and what does not carry over.
Halaman ini belum diterjemahkan. Versi bahasa Inggris yang ditampilkan.
Minu serves a set of routes that take the requests kie.ai takes and answer in the shapes kie.ai answers in. For the models in Minu's catalog, an integration written for kie.ai moves over by changing two values:
| kie.ai | Minu | |
|---|---|---|
| Base URL | https://api.kie.ai | https://api.minu.ai |
| API key | your kie.ai key | a Minu key, mk_live_… |
The header stays the same: Authorization: Bearer <key>.
This page lists what maps one to one and, just as plainly, what does not. Read that section before you switch production traffic.
Before you switch
- Create a Minu account, top up, and create an API key. Minu bills in US dollars from a prepaid balance, not in credits.
- If you verify callback signatures, create a signing secret in the console under Webhooks. You will need it in place of your kie.ai webhook key.
- Check that the models you use are in the catalog.
Routes that are served
| Route | Use |
|---|---|
POST /api/v1/jobs/createTask | Create a generation task |
GET /api/v1/jobs/recordInfo | Read a task created with createTask |
POST /api/v1/veo/generate | Create a Veo video |
GET /api/v1/veo/record-info | Read a task created with veo/generate |
GET /api/v1/chat/credit is answered as well, for code that reads it: it returns your available balance converted to kie.ai credits at 200 credits to the US dollar, rounded down to two decimals. The balance in dollars is GET /v1/balance. Other kie.ai routes are not served.
# Before
curl https://api.kie.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $KIE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "YOUR_MODEL_NAME", "input": { "prompt": "A paper boat on a rain puddle" } }'
# After: another host, another key, the same request
curl https://api.minu.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $MINU_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "YOUR_MODEL_NAME", "input": { "prompt": "A paper boat on a rain puddle" } }'Responses and errors
As at kie.ai, every answer is HTTP 200 and the outcome is in the body. A request that was accepted answers { "code": 200, "msg": "success", "data": … }; the two create routes return "data": { "taskId": "task_…" }. A request that was refused answers { "code": …, "msg": "…" } with one of these codes:
code | When |
|---|---|
401 | The key cannot be used: it is invalid or revoked, not allowed from this IP address or for this model, or the organization is suspended. |
402 | The balance is too low, or the key has reached its daily spend cap. |
422 | The request cannot be served as sent: a missing or invalid field, a model that is not supported, content that was blocked, an input file that cannot be used. |
429 | Too many requests, or too many tasks waiting. The Retry-After header says how long to wait. |
500 | Something went wrong on Minu's side. |
Check code in the body, as you do with kie.ai, not the HTTP status.
Model names
Send the model values you send to kie.ai today. These names are recognised, in any letter case, and run the Minu model beside them; the name you sent is what you get back in the record.
kie.ai model | Minu model |
|---|---|
nano-banana-2-lite | google/nano-banana-2-lite |
nano-banana-2, google/nano-banana, google/nano-banana-edit | google/nano-banana-2 |
nano-banana-pro | google/nano-banana-pro |
veo3_lite, veo-3-1-lite | google/veo-3.1-lite |
veo3_fast, veo-3-1, veo-3-1-fast | google/veo-3.1-fast |
POST /api/v1/veo/generate without a model uses veo3_fast, which is kie.ai's own default. A Minu model ID from the model reference is accepted as model too, which is how you reach the task models that have no kie.ai name here. Any other name is refused with code 422.
Request fields
Requests are read with kie.ai's field names and turned into the model's own parameters:
- Image models (
createTask):prompt; reference images fromimage_input,image_urlsorimageUrls, as a list of URLs or a single URL; the aspect ratio fromaspect_ratio,aspectRatioorimage_size, whereautomeans the model's default;seedorseeds;n.resolution: "1K"is accepted. - Video models (
veo/generate, orcreateTaskwith a video model):prompt; reference images fromimageUrls,image_urlsorimage_input;aspectRatiooraspect_ratio;seedsorseed;resolution;duration; andgenerationTypeTEXT_2_VIDEOorREFERENCE_2_VIDEO. callBackUrl: an empty string means no callback, as at kie.ai.
The result is then checked against the model's parameters, which the model reference lists with their allowed values. A value the model does not take is refused with code 422 and a msg that names the field.
Task IDs
taskId values are Minu task IDs. They start with task_ and do not look like kie.ai's. Treat them as opaque strings, and make sure the column you store them in is long enough.
What maps one to one
Job records
GET /api/v1/jobs/recordInfo returns the record in the data field of kie.ai's usual code / msg / data envelope, with the fields kie.ai uses:
{
"taskId": "task_1k8r2m4p0a7c9e3g5j6n8q2s",
"model": "YOUR_MODEL_NAME",
"state": "success",
"param": "{\"model\":\"YOUR_MODEL_NAME\",\"input\":{\"prompt\":\"A paper boat on a rain puddle\"}}",
"resultJson": "{\"resultUrls\":[\"https://…\"]}",
"failCode": "",
"failMsg": "",
"costTime": 11840,
"completeTime": 1796169611840,
"createTime": 1796169600000,
"creditsConsumed": 0
}| Field | Value |
|---|---|
taskId | The Minu task ID. |
model | The model name you sent. |
state | waiting, queuing, generating, success or fail. See the table below. |
param | Your request as a JSON string: model and input. |
resultJson | When state is success, a JSON string holding resultUrls, the list of result files. Otherwise an empty string. |
failCode | When state is fail: "400" for a rejected request or an unusable input, "422" for content that was refused, "500" for anything else. Otherwise an empty string. |
failMsg | When state is fail, the reason. Otherwise an empty string. |
costTime | Milliseconds from creation to completion. 0 until the task ends. |
completeTime | When the task ended, in Unix milliseconds. 0 until then. |
createTime | When the task was created, in Unix milliseconds. |
creditsConsumed | Always 0. See what does not map. |
resultJson and param are JSON strings, as at kie.ai: parse them a second time.
Minu's task statuses appear as kie.ai states:
| Minu status | state |
|---|---|
queued | waiting |
preparing | queuing |
running, finalizing | generating |
succeeded, partially_succeeded | success |
failed, canceled, expired | fail |
Veo records
GET /api/v1/veo/record-info returns, in data:
{
"taskId": "task_1k8r2m4p0a7c9e3g5j6n8q2s",
"paramJson": "{\"prompt\":\"A slow dolly shot through a bamboo forest\"}",
"completeTime": 1796169671000,
"response": {
"taskId": "task_1k8r2m4p0a7c9e3g5j6n8q2s",
"resultUrls": ["https://…"],
"originUrls": ["https://…"],
"fullResultUrls": ["https://…"],
"resolution": "720p"
},
"successFlag": 1,
"errorCode": null,
"errorMessage": null,
"createTime": 1796169600000,
"fallbackFlag": false
}| Field | Value |
|---|---|
taskId | The Minu task ID. |
paramJson | The task's input as a JSON string. |
successFlag | 0 in progress, 1 done, 2 refused (the content, the input or the request was rejected), 3 failed. |
response | When successFlag is 1: taskId, resultUrls, originUrls, fullResultUrls and resolution. The three URL lists hold the same files. Otherwise null. |
errorCode | When successFlag is 2 or 3: 400, 422 or 500, as a number. Otherwise null. |
errorMessage | When successFlag is 2 or 3, the reason. Otherwise null. |
completeTime | When the task ended, in Unix milliseconds, or null. |
createTime | When the task was created, in Unix milliseconds. |
fallbackFlag | Always false. |
Callbacks
A task created with a callBackUrl posts one callback to that URL when it ends, in kie.ai's format for the route that created it.
For jobs/createTask:
{
"code": 200,
"msg": "success",
"data": { "taskId": "task_1k8r2m4p0a7c9e3g5j6n8q2s", "state": "success", "resultJson": "{\"resultUrls\":[\"https://…\"]}" }
}data is the full job record described above (shortened here). code is 200 on success and 501 on failure, where msg carries the reason.
For veo/generate:
{
"code": 200,
"msg": "Veo3 video generated successfully.",
"data": {
"taskId": "task_1k8r2m4p0a7c9e3g5j6n8q2s",
"info": {
"taskId": "task_1k8r2m4p0a7c9e3g5j6n8q2s",
"resultUrls": ["https://…"],
"originUrls": ["https://…"],
"fullResultUrls": ["https://…"],
"resolution": "720p"
},
"fallbackFlag": false
}
}On failure code is 400, 422 or 500, msg carries the reason and info is null.
A callback that your server does not answer with a 2xx status within 10 seconds is retried on the same schedule as Minu webhooks: eight attempts over about 33 hours.
Callback signatures
Callbacks are signed the way kie.ai signs them, with two headers:
| Header | Value |
|---|---|
x-webhook-timestamp | When the callback was sent, in Unix seconds. |
x-webhook-signature | HMAC-SHA256 over taskId.timestamp, encoded as base64. |
The key is your organization's Minu signing secret (the whole string, including whsec_), not your kie.ai webhook key. The headers are sent once your organization has a signing secret.
import crypto from 'node:crypto';
// `body` is the parsed JSON of the callback; `secret` is the Minu signing secret (whsec_…).
function verifyCallback(headers, body, secret) {
const timestamp = headers['x-webhook-timestamp'];
const signature = headers['x-webhook-signature'];
const taskId = body?.data?.taskId;
if (!timestamp || !signature || !taskId) return false;
const expected = crypto.createHmac('sha256', secret).update(`${taskId}.${timestamp}`).digest('base64');
const given = Buffer.from(String(signature));
const wanted = Buffer.from(expected);
return given.length === wanted.length && crypto.timingSafeEqual(given, wanted);
}import base64
import hashlib
import hmac
# `body` is the parsed JSON of the callback; `secret` is the Minu signing secret (whsec_…).
def verify_callback(headers, body, secret: str) -> bool:
timestamp = headers.get("x-webhook-timestamp", "")
signature = headers.get("x-webhook-signature", "")
task_id = (body.get("data") or {}).get("taskId", "")
if not timestamp or not signature or not task_id:
return False
digest = hmac.new(secret.encode(), f"{task_id}.{timestamp}".encode(), hashlib.sha256).digest()
return hmac.compare_digest(signature, base64.b64encode(digest).decode())What does not map
These differ from kie.ai. None of them is an error on your side, but each can surprise you.
| What | How it behaves at Minu |
|---|---|
enableTranslation | Ignored. The prompt is used as you wrote it. If you relied on this option to translate prompts, translate them before you send them. watermark and output_format are accepted and ignored as well. |
creditsConsumed | Always 0. Minu does not count in credits. The cost in dollars is on the task: GET /v1/tasks/{taskId} returns cost_usd, and the console lists every task with its cost. |
| 2K and 4K images, video above 720p | Not available yet, and refused rather than made smaller. Images are generated at 1K and video at 720p. A request for 2K or 4K, or for a video resolution the model does not list, is answered with code 422. |
generationType: FIRST_AND_LAST_FRAMES_2_VIDEO | Refused with code 422. Images sent with a video request are reference images of people or objects the video should keep, not its first and last frames. Use TEXT_2_VIDEO, or REFERENCE_2_VIDEO with reference images. |
| Aspect ratios | Only the ratios the model reference lists for the model are accepted. Others are refused with code 422; auto selects the default. |
veo-3-1 | Without a tier, veo-3-1 means Fast (Veo 3.1 Fast). |
fallbackFlag | Always false. |
| Webhook endpoints in the Minu console | A task created through these routes sends its callback only to its own callBackUrl. Endpoints set up in the console receive events for Task API tasks, not for these. |
| Billing | A prepaid balance in US dollars, not credits. |
| Other routes of the kie.ai API | Not served. Only the routes listed above are. |
Two more things to keep in mind:
- Limits are Minu's. The default rate limit is 20 requests per 10 seconds per organization, and tasks beyond your concurrency limit wait in a bounded queue. See Errors and rate limits.
- Result files are kept for 14 days by default. Download what you need to keep.
Check your migration
- Create one task per model you use, with a real prompt, against
https://api.minu.ai. - Poll
recordInfoorrecord-infountil the task ends and confirm that your code readsresultUrlsas before. - If you use callbacks, confirm that one arrives and that your signature check passes with the Minu signing secret.
- Open Logs in the console and check the cost of each task.
Moving to the Task API later
The compatible routes are there so that you can switch without rewriting your integration. When you next touch it, the Task API gives you more: the cost of each task in the response, your own metadata on every task, safe retries with Idempotency-Key, cancellation, and webhook endpoints with signatures that survive a secret rotation. A task created through either API can be read with GET /v1/tasks/{id}.