Riferimento API di Kling Image 4.0
Immagini native in 2K, 4K o 8K con testo leggibile, più modifiche con fino a dieci riferimenti
Con una sola chiave API di PopNow chiami Kling Image 4.0 dal tuo codice. Qui trovi gli ID del modello da inviare, ogni campo di input accettato, quanto costa ogni richiesta in USD e una richiesta da incollare nel terminale così com’è.
Le descrizioni dei parametri provengono dallo schema di input del modello e sono disponibili solo in inglese.
In sintesi
- Sviluppato da
- Kuaishou
- Risultato
- Immagine
- Da
- $0.063 USD per immagine
- Tempo tipico
- circa 51 s
- ID del modello
I prezzi sono indicati in USD e gli importi vengono addebitati sul tuo saldo PopNow. Alla ricezione viene riservato il massimo importo; al termine viene addebitato il consumo effettivo e il resto viene sbloccato. Le attività fallite non vengono addebitate. Per un preventivo esatto prima di eseguire, usa POST /api/v1/jobs/quote.
Crea immagine
kling/image-4.0/text-to-image
Prezzo
| Opzione | USD |
|---|---|
2k | $0.063 per immagine |
4k | $0.094 per immagine |
8k | $0.157 per immagine |
Parametri
| Campo | Tipo | Predefinito | Valori ammessi | A cosa serve |
|---|---|---|---|---|
promptObbligatorio | string | — | fino a 21.000 caratteri | Describe the subject, setting, lighting, and any exact words to render. |
num_outputsFacoltativo | integer | 1 | da 1 a 9 | How many independent images to generate. |
resolutionFacoltativo | string | 2k | 2k, 4k, 8k | Output resolution tier; the price follows this choice. |
aspect_ratioFacoltativo | string | auto | auto, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9 | Output aspect ratio; auto lets the model choose from the prompt and any reference images. |
Richiesta di esempio
Questa richiesta funziona così com’è; i campi omessi usano il valore predefinito. Prima salva la tua chiave in POPNOW_API_KEY.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "kling/image-4.0/text-to-image",
"input": {
"prompt": "A cozy reading nook beside a rain-streaked window, warm lamp light, a sleeping orange cat on a knitted blanket, soft film grain",
"resolution": "2k",
"num_outputs": 1
}
}'La risposta contiene subito un taskId. Recupera il risultato con GET /api/v1/jobs/recordInfo, oppure aggiungi callBackUrl per ricevere una notifica.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"Modifica immagine
kling/image-4.0/edit
Prezzo
| Opzione | USD |
|---|---|
2k | $0.063 per immagine |
4k | $0.094 per immagine |
8k | $0.157 per immagine |
Parametri
| Campo | Tipo | Predefinito | Valori ammessi | A cosa serve |
|---|---|---|---|---|
promptObbligatorio | string | — | fino a 21.000 caratteri | Say what each reference supplies, what should change, and what must stay the same. Cite references as @image_1, @image_2. |
image_urlsObbligatorio | array<string (uri)> | — | fino a 10 elementi | Reference images in the order they are cited. JPG or PNG, up to 30 MB, at least 300 px per side, ratio between 2:5 and 5:2. |
num_outputsFacoltativo | integer | 1 | da 1 a 9 | How many independent images to generate. |
resolutionFacoltativo | string | 2k | 2k, 4k, 8k | Output resolution tier; the price follows this choice. |
aspect_ratioFacoltativo | string | auto | auto, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9 | Output aspect ratio; auto lets the model choose from the prompt and any reference images. |
Richiesta di esempio
Questa richiesta funziona così com’è; i campi omessi usano il valore predefinito. Prima salva la tua chiave in POPNOW_API_KEY.
L’esempio usa file di prova di PopNow in image_urls. Sostituiscili con i tuoi link HTTPS pubblici, file caricati o asset salvati.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "kling/image-4.0/edit",
"input": {
"prompt": "Change the orange jacket to deep forest green and add soft golden-hour light; keep the face, pose and background unchanged",
"image_urls": [
"https://media.popnow.ai/influencer/examples/marco.webp"
],
"resolution": "2k",
"num_outputs": 1
}
}'La risposta contiene subito un taskId. Recupera il risultato con GET /api/v1/jobs/recordInfo, oppure aggiungi callBackUrl per ricevere una notifica.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
