APIMPAPIMP
User GuideAI APIImage APIVideo APIPublic API

Image API

Task-style image generation (gpt-image-2 / nano-banana series)

Overview

The Image API submits image-generation requests task-style: all models share the same submit endpoint POST /api/generate/submit, differing only in the model field and the model-specific input.metadata passthrough. Submit returns a task_id immediately — poll GET /api/generate/status/{task_id} until status=finished.

Authentication

Same Bearer token as the AI API: Authorization: Bearer sk-xxxxxx.

Shared Request Skeleton

{
  "model": "gpt-image-2 | nano-banana-2 | nano-banana-pro",
  "input": {
    "prompt": "image description",
    "size": "1:1 | 16:9 | 9:16 | auto | 1024x1024",
    "image": "reference image URL (optional)",
    "images": ["reference image URLs (optional)"],
    "metadata": { /* model-specific params */ }
  }
}

Only prompt / size / image / images / duration / seconds are allowed at the top of input; any other field (quality, resolution, n, mask_url, etc.) must go under input.metadata or the request returns 400.

Models

How is this guide?

Last updated on