Image and video generation API

Images and video,
one API.

Connect image and video models through one interface. Pay with credits based on the model and parameters, and track long-running tasks asynchronously.

99.9%
Availability over 30 days
312ms
Average time to first byte
28models
Available media models

Nano Banana 2

Featured

Text to image / Image to image

2 - 3
credits / image
Text to image / Image to image

Nano Banana Pro

PRO

Text to image / Image to image

2 - 4
credits / image
Text to image / Image to image

GPT Image 2

Text to image / Image to image

1 - 3
credits / image
Text to image / Image to image

Give your AI one link

Ask Codex or another coding agent to create images and videos, upload local references, and save the results. No skill or MCP installation required.

Read /openapi.md and follow its workflow for this task: [describe the image or video]. Reuse saved PixZoo credentials; if none exist, start browser authorization and show me the authorization link and code. Never show secrets, automatically retry an ambiguous generation submission, or lose the original outputs; save them locally.

Requires network access and Python 3.9+. On first use, sign in and approve tool access; credentials are saved in the tool environment and renewed automatically. Developer API keys remain supported.

01 · Pricing

Pay with credits, no monthly API fee

Choose a model and parameters for your task. See the current directory for supported capabilities and pricing rules.

  • GPT Image 2
    gpt-image-2

    Text to image / Image to image

    1 - 3credits / image
    Text to image / Image to image
  • GPT Image 2.5 FlareNEW
    gpt-image-2.5-flare

    Text to image / Image to image

    1 - 100credits / image
    Text to image / Image to imageQuality options
  • GPT Image 2.5 SunburstPRO
    gpt-image-2.5-sunburst

    Text to image / Image to image

    1 - 100credits / image
    Text to image / Image to imageQuality options
  • Z Image TurboNEW
    z-image-turbo

    Text to image

    1credits / image
    Text to image
  • Seedream 5.0NEW
    seedream-5.0

    Text to image / Image to image

    2credits / image
    Text to image / Image to image
  • Seedream 5.0 FlashNEW
    seedream-5.0-flash

    Text to image / Image to image

    2 - 3credits / image
    Text to image / Image to image
  • Seedream 5.0 ProPRO
    seedream-5.0-pro

    Text to image / Image to image

    4credits / image
    Text to image / Image to image
  • wan2.5-text-to-image
    wan2.5-text-to-image

    Text to image

    2credits / image
    Text to image
  • Qwen Image
    qwen-image-edit-plus

    Image to image

    2credits / image
    Image to image
  • Nano Banana 2Popular
    nano-banana-2

    Text to image / Image to image

    2 - 3credits / image
    Text to image / Image to imageWeb search
  • Nano Banana 2.1PopularNEW
    nano-banana-2.1

    Text to image / Image to image

    4 - 5credits / image
    Text to image / Image to imageWeb search
  • Nano Banana ProPopularPRO
    nano-banana-pro

    Text to image / Image to image

    2 - 4credits / image
    Text to image / Image to imageWeb search
  • Seedance 2.0NEW
    seedance-2.0

    Text to video / Image to video

    12 - 125credits / second
    Text to video / Image to video
  • Seedance 2.0 FastNEW
    seedance-2.0-fast

    Text to video / Image to video

    7 - 75credits / second
    Text to video / Image to video
  • Seedance 2.0 MiniNEW
    seedance-2.0-mini

    Text to video / Image to video

    2 - 20credits / second
    Text to video / Image to video
  • Seedance 2.5NEW
    seedance-2.5

    Text to video / Image to video

    18 - 200credits / second
    Text to video / Image to video
  • Veo3.1 FastNEW
    veo3.1-fast-official

    Text to video / Image to video

    15 - 120credits / second
    Text to video / Image to video
  • Veo3.1 QualityNEW
    veo3.1-quality-official

    Text to video / Image to video

    55 - 440credits / second
    Text to video / Image to video
  • Veo3.1 Fast LiteNEW
    veo3.1-fast

    Text to video / Image to video

    15 - 120credits / second
    Text to video / Image to video
  • Veo3.1 Quality LiteNEW
    veo3.1-quality

    Text to video / Image to video

    55 - 440credits / second
    Text to video / Image to video
  • Kling V3NEW
    kling-v3

    Text to video / Image to video

    12 - 75credits / second
    Text to video / Image to video
  • Wan 3.0 VideoNEW
    wan3.0-video

    Text to video / Image to video

    2 - 27credits / second
    Text to video / Image to video
  • Grok Imagine ImageNEW
    grok-imagine-image

    Text to image / Image to image

    2credits / image
    Text to image / Image to imageQuality options
  • Grok Imagine VideoNEW
    grok-imagine-video

    Text to video / Image to video

    2 - 11credits / second
    Text to video / Image to video
  • Gemini Omni FlashNEW
    gemini-omni-flash

    Text to video / Image to video

    16 - 96credits / second
    Text to video / Image to video
  • gpt-image-2-officialNEW
    gpt-image-2-official

    Text to image / Image to image

    1 - 45credits / image
    Text to image / Image to imageQuality options
  • nano-banana-2-officialPopular
    nano-banana-2-official

    Text to image / Image to image

    4 - 5credits / image
    Text to image / Image to imageWeb search
  • nano-banana-pro-officialPopularPRO
    nano-banana-pro-official

    Text to image / Image to image

    3 - 6credits / image
    Text to image / Image to imageWeb search
Track the task status. A client network timeout does not mean generation failed; resume queries with the saved task ID.Actual charges are calculated by the server
02 · API reference

API Reference

Submit once with generate, then query the saved site task ID every 10 seconds. Upload local references first. Do not resubmit when a request times out.

Workflow

  1. 1.Call /api/ai/generate/ once and save data.id as the site task ID
  2. 2.Query the saved task ID every 10 seconds until success, failed or canceled; never resubmit on timeout
  3. 3.Download original media from outputImages, for both image and video tasks

Authentication

API keys allow uploads, generation (including image processing), and querying your own tasks only. They cannot purchase credits, change account settings, or manage keys. Generation spends existing account credits. Use this request header:

Authorization: Bearer sk-<your-api-key>
Content-Type: application/json

Available Models

modelNameSupported Scenes
gpt-image-2GPT Image 2Text to image / Image to image
gpt-image-2.5-flareGPT Image 2.5 FlareText to image / Image to image
gpt-image-2.5-sunburstGPT Image 2.5 SunburstText to image / Image to image
z-image-turboZ Image TurboText to image
seedream-5.0Seedream 5.0Text to image / Image to image
seedream-5.0-flashSeedream 5.0 FlashText to image / Image to image
seedream-5.0-proSeedream 5.0 ProText to image / Image to image
wan2.5-text-to-imagewan2.5-text-to-imageText to image
qwen-image-edit-plusQwen ImageImage to image
nano-banana-2Nano Banana 2Text to image / Image to image
nano-banana-2.1Nano Banana 2.1Text to image / Image to image
nano-banana-proNano Banana ProText to image / Image to image
seedance-2.0Seedance 2.0Text to video / Image to video
seedance-2.0-fastSeedance 2.0 FastText to video / Image to video
seedance-2.0-miniSeedance 2.0 MiniText to video / Image to video
seedance-2.5Seedance 2.5Text to video / Image to video
veo3.1-fast-officialVeo3.1 FastText to video / Image to video
veo3.1-quality-officialVeo3.1 QualityText to video / Image to video
veo3.1-fastVeo3.1 Fast LiteText to video / Image to video
veo3.1-qualityVeo3.1 Quality LiteText to video / Image to video
kling-v3Kling V3Text to video / Image to video
wan3.0-videoWan 3.0 VideoText to video / Image to video
grok-imagine-imageGrok Imagine ImageText to image / Image to image
grok-imagine-videoGrok Imagine VideoText to video / Image to video
gemini-omni-flashGemini Omni FlashText to video / Image to video
gpt-image-2-officialgpt-image-2-officialText to image / Image to image
nano-banana-2-officialnano-banana-2-officialText to image / Image to image
nano-banana-pro-officialnano-banana-pro-officialText to image / Image to image

Image and video models and full capabilities: /openapi/models.json

POST/api/ai/generate/Submit one image or video task. Save data.id and query it for results. Submission is not idempotent.

Request Parameters

FieldTypeRequiredDescription
mediaTypestring✓image or video
modelstring✓Model identifier — see available models above
promptstring✓Text prompt for generation
scenestringUse a scene supported by the selected model: text-to-image, image-to-image, text-to-video or image-to-video
options.aspectRatiostringAspect ratio, e.g. "1:1", "16:9", "9:16"
options.resolutionstringResolution tier, e.g. "1K", "2K", "4K"
options.referenceImages{url, role?}[]Ordered reference objects with url and optional role: firstFrame, lastFrame or reference

Request example (Python / Node.js)

import json, os
from urllib.request import Request, build_opener, HTTPRedirectHandler

class NoRedirect(HTTPRedirectHandler):
    def redirect_request(self, *args):
        return None

body = {
  "schemaVersion": 1,
  "mediaType": "image",
  "model": "nano-banana-2",
  "prompt": "A red panda reading a book, soft natural light",
  "scene": "text-to-image",
  "options": {
    "aspectRatio": "1:1"
  }
}
request = Request(
    "https://pixzoo.ai/api/ai/generate/",
    data=json.dumps(body).encode(),
    headers={"Authorization": "Bearer " + os.environ["PIXZOO_API_KEY"],
             "Content-Type": "application/json"},
)
# One attempt. Never retry an ambiguous generation submission.
with build_opener(NoRedirect()).open(request, timeout=180) as response:
    result = json.load(response)
if result.get("code") != 0:
    raise RuntimeError("PixZoo API rejected the request")
from pathlib import Path
Path("pixzoo-task-id.txt").write_text(result["data"]["id"])
print("Task ID saved; query the same ID for results")
# Full resumable upload/wait/download workflow: https://pixzoo.ai/openapi.md

Response Example

{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "3f2a1b4c-...",
    "status": "queuing"
  }
}

Video request example

{
  "schemaVersion": 1,
  "mediaType": "video",
  "model": "seedance-2.0",
  "prompt": "A red panda reading a book, slow camera dolly, soft natural light",
  "scene": "text-to-video",
  "options": {
    "aspectRatio": "16:9"
  }
}

Use the current model directory for supported scenes, reference limits, durations and resolutions. Upload references before passing canonical referenceImages/referenceVideos/referenceAudios.

Upload local references

Reserve and complete accept Authorization: Bearer API_KEY with application/json. PUT file bytes directly to the returned storage URL. Existing reachable URLs can be passed to generation without uploading again.

1. Reserve a direct upload

POST/api/storage/presign/
FieldTypeRequiredDescription
filenamestring✓Original filename, 1–255 characters.
contentTypestring✓Actual MIME type from the supported list below.
sizeinteger✓Actual original file length in bytes, as a positive integer; not MB.
purpose"media"Use media for ordinary reference uploads without creating a material-library record.

Request JSON

{
  "filename": "reference.png",
  "contentType": "image/png",
  "size": 1024,
  "purpose": "media"
}

Response example (domains, signatures, IDs and times are placeholders)

{
  "code": 0,
  "message": "ok",
  "data": {
    "uploadId": "11111111-1111-4111-8111-111111111111",
    "uploadUrl": "https://storage.example.test/pending/reference.png?signature=example",
    "headers": {
      "Content-Type": "image/png"
    },
    "expiresAt": "2030-01-01T00:05:00.000Z"
  }
}

2. PUT original bytes to uploadUrl

Use the original file bytes as the entire request body with data.headers. Do not send JSON, multipart, cookies or the PixZoo API key to storage. Check the PUT HTTP status before completion.

3. Complete and get the final URL

POST/api/storage/complete/
FieldTypeRequiredDescription
uploadIdUUID✓The UUID uploadId returned by presign. The same user must complete it.

Request JSON

{
  "uploadId": "11111111-1111-4111-8111-111111111111"
}

Response example (domains, signatures, IDs and times are placeholders)

{
  "code": 0,
  "message": "ok",
  "data": {
    "uploadId": "11111111-1111-4111-8111-111111111111",
    "key": "uploads/example/reference.png",
    "url": "https://media.example.test/uploads/reference.png",
    "filename": "reference.png",
    "size": 1024,
    "materialId": null
  }
}

The signed URL expires after 5 minutes; completion has a 1-hour window. Completion is idempotent for the same uploadId: retry only completion after a lost response. Use the final data.url as a reference, never the temporary uploadUrl. Models may have tighter reference limits.

Supported types and per-file limits

MIME typeMaximum size
image/jpeg25 MiB
image/png25 MiB
image/webp25 MiB
image/gif25 MiB
image/svg+xml5 MiB
video/mp4100 MiB
video/webm100 MiB
video/quicktime100 MiB
audio/mpeg25 MiB
audio/wav25 MiB
audio/x-wav25 MiB
audio/mp425 MiB
audio/aac25 MiB
audio/ogg25 MiB
Operation guide
POST/api/ai/query/Query an owned site task ID every 10 seconds. Success, failed and canceled are terminal; a timeout is not task failure.

Request Parameters

FieldTypeRequiredDescription
taskIdstring✓Task ID returned by /api/ai/generate/

Request example (Python / Node.js)

import json, os
from urllib.request import Request, build_opener, HTTPRedirectHandler

class NoRedirect(HTTPRedirectHandler):
    def redirect_request(self, *args):
        return None

body = {
  "taskId": "replace-with-site-task-id"
}
request = Request(
    "https://pixzoo.ai/api/ai/query/",
    data=json.dumps(body).encode(),
    headers={"Authorization": "Bearer " + os.environ["PIXZOO_API_KEY"],
             "Content-Type": "application/json"},
)
# One attempt. Never retry an ambiguous generation submission.
with build_opener(NoRedirect()).open(request, timeout=180) as response:
    result = json.load(response)
if result.get("code") != 0:
    raise RuntimeError("PixZoo API rejected the request")
print("Task status:", result["data"]["status"])
# Full resumable upload/wait/download workflow: https://pixzoo.ai/openapi.md

In-progress Response

{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "3f2a1b4c-...",
    "status": "processing",
    "outputImages": null
  }
}

Success Response

{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "3f2a1b4c-...",
    "status": "success",
    "outputImages": [
      "https://gempix.cn/outputs/xxx.png"
    ]
  }
}

Task Status

statusDescription
queuingQueued, waiting to be processed
pendingSubmitted to AI provider, awaiting response
processingBeing processed by AI provider
successGeneration succeeded; outputImages contains original image or video URLs
failedGeneration failed — credits have been automatically refunded
canceledTask canceled; stop querying

Error Responses

Check HTTP status and JSON code. HTTP 200 with code -1 is a business error. Stop on invalid credentials or insufficient credits; do not automatically resubmit generation.

{
  "code": -1,
  "message": "insufficient credits"
}
  • no authAPI Key is invalid or missing
  • insufficient creditsInsufficient credits
  • task not foundTask does not exist
  • no permissionNot authorized to access this task (belongs to another user)
03 · Your keys

Create an API key here

Create and copy a key on this page. Each account can have up to 10 keys for separate projects.

Loading API keys…

Authorized AI tools

Manage tool access separately from developer API keys. Revocation immediately blocks access and renewal.

Loading tool access…

04 · FAQ

Developer questions

Authentication, local uploads, billing and task recovery.

Ready to create?
Try the API.

Choose a model and authorize your AI tool to start generating images or videos.

Image and video generation · Asynchronous tasks · Original results