PopNowDocs API
Contenu principal

Référence API de Nano Banana 2.1

La toute dernière Nano Banana de Google, texte net et sortie 4K

Une seule clé API PopNow suffit pour appeler Nano Banana 2.1 depuis votre code. Vous trouverez ici les identifiants de modèle à envoyer, chaque champ d’entrée accepté, le coût d’une requête en crédits et une requête à coller telle quelle dans un terminal.

Les descriptions des paramètres proviennent du schéma d’entrée du modèle et ne sont disponibles qu’en anglais.

En bref

Éditeur
Google
Résultat
Image
À partir de
7.2 crédits par image ($0.072)
Durée habituelle
environ 37 s

1 crédit = 0,01 $. À l’acceptation, une tâche réserve le montant maximal possible, puis facture la consommation réelle à la fin, arrondie au crédit supérieur ; le reste est libéré. Une tâche en échec n’est pas facturée. Pour connaître le montant exact avant de lancer, appelez POST /api/v1/jobs/quote.

Créer une image

google/nano-banana-2.1/text-to-image

Prix

OptionCrédits (par image)Dollars US
1k7.2$0.072
2k10.8$0.108
4k24.3$0.243

Paramètres

ChampTypeValeur par défautValeurs admisesRôle
promptObligatoirestring—jusqu’à 5 000 caractèresDescribe the image you want.
aspect_ratioFacultatifstring16:91:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1Output aspect ratio.
resolutionFacultatifstring1k1k, 2k, 4kOutput size tier.
enable_web_searchFacultatifbooleanfalse—Look up current facts on the web before drawing.
enable_image_searchFacultatifbooleanfalse—Look up reference pictures on the web before drawing.
output_formatFacultatifstringpngpng, jpegFile format of the result.

Exemple de requête

Cette requête fonctionne telle quelle ; les champs omis gardent leur valeur par défaut. Placez d’abord votre clé dans POPNOW_API_KEY.

POST /api/v1/jobs/createTask?wait=60
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask?wait=60" \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "model": "google/nano-banana-2.1/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",
    "enable_image_search": false,
    "enable_web_search": false,
    "resolution": "1k"
  }
}'

La réponse contient tout de suite un taskId. Récupérez le résultat avec GET /api/v1/jobs/recordInfo, ou ajoutez callBackUrl pour être prévenu.

GET /api/v1/jobs/recordInfo
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Modifier une image

google/nano-banana-2.1/edit

Prix

OptionCrédits (par image)Dollars US
1k7.2$0.072
2k10.8$0.108
4k24.3$0.243

Paramètres

ChampTypeValeur par défautValeurs admisesRôle
promptObligatoirestring—jusqu’à 5 000 caractèresSay what to change and what must stay the same.
image_urlsObligatoirearray<string (uri)>—jusqu’à 14 élémentsOne to 14 source images, in the order your prompt refers to them.
aspect_ratioFacultatifstringautoauto, 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, … (+1)Output aspect ratio; auto keeps the shape of the source image.
resolutionFacultatifstring1k1k, 2k, 4kOutput size tier.
enable_web_searchFacultatifbooleanfalse—Look up current facts on the web before drawing.
enable_image_searchFacultatifbooleanfalse—Look up reference pictures on the web before drawing.
output_formatFacultatifstringpngpng, jpegFile format of the result.

Exemple de requête

Cette requête fonctionne telle quelle ; les champs omis gardent leur valeur par défaut. Placez d’abord votre clé dans POPNOW_API_KEY.

L’exemple utilise des fichiers d’exemple PopNow dans image_urls. Remplacez-les par vos propres liens HTTPS publics, fichiers envoyés ou ressources enregistrées.

POST /api/v1/jobs/createTask
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": "google/nano-banana-2.1/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"
    ],
    "enable_image_search": false,
    "enable_web_search": false,
    "resolution": "1k"
  }
}'

La réponse contient tout de suite un taskId. Récupérez le résultat avec GET /api/v1/jobs/recordInfo, ou ajoutez callBackUrl pour être prévenu.

GET /api/v1/jobs/recordInfo
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Pour aller plus loin

Sur cette page