Documentazione API PopNow

Genera immagini, video e audio dal tuo codice

Una chiave API, un endpoint REST, gli stessi modelli e crediti di popnow.ai. Invii un’attività e ricevi il file.

La tua prima immagine in tre passaggi

  1. Crea una chiave

    Accedi a popnow.ai e crea una chiave nella console API. Inizia con sk-popnow- e usa i crediti che hai già sul tuo account.

  2. Invia una richiesta

    Incolla questo in un terminale. Chiede un’immagine a Z-Image, costa 2 crediti ($0.02) e aspetta il risultato fino a 60 secondi.

    POST /api/v1/jobs/createTask?wait=60
    export POPNOW_API_KEY="sk-popnow-..."   # your key from the API console
    
    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": "alibaba/z-image-turbo/text-to-image",
      "input": {
        "prompt": "A small red fox curled up in a teacup, soft morning light, studio photo"
      }
    }'
  3. Apri il risultato

    La risposta contiene un link firmato all’immagine in output.assets[0].url. I lavori più lunghi, come i video, restituiscono prima un taskId: recupera il risultato dopo con recordInfo o ricevilo via webhook.

    200 OK
    {
      "code": 200,
      "msg": "success",
      "data": {
        "taskId": "job_01JH8Z4Q5W2N7R3K9M6P1C0VXD",
        "model": "alibaba/z-image-turbo/text-to-image",
        "state": "succeeded",
        "output": {
          "assets": [
            {
              "url": "https://…signed-link…",
              "expiresAt": "2026-10-16T09:20:00Z",
              "mime": "image/png",
              "width": 1024,
              "height": 1024
            }
          ]
        },
        "credits": 2,
        "cost": "0.02",
        "settled": true
      },
      "request_id": "req_…"
    }

Per approfondire