Skip to content

Legacy transition format

This section documents the older Nano Banana-compatible request shape that was previously used in the model docs. It is kept only for transition. New integrations should use the OpenAI-compatible model pages and API Reference.

Legacy endpoints

http
POST /v1/images/generate
POST /v1/images/edit

Legacy fields

FieldReplacementNotes
numnNumber of output images.
image_sizesizeOutput size now uses OpenAI-style values such as 1024x1024.
JSON image URLmultipart image fileNew edit docs use POST /v1/images/edits with form fields.
data.url responsedata[0].url responseNew responses follow the OpenAI image response shape.

Legacy generate example

bash
curl https://api.pixapi.ai/v1/images/generate \
  -H "Authorization: Bearer $PIXAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3-pro-image-preview",
    "prompt": "Editorial product photo of a matte black water bottle on stone",
    "num": 1,
    "image_size": "1:1"
  }'

Legacy edit example

bash
curl https://api.pixapi.ai/v1/images/edit \
  -H "Authorization: Bearer $PIXAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3-pro-image-preview",
    "prompt": "Change the bottle color to warm ivory and keep the background",
    "image": "https://example.com/input.png",
    "num": 1
  }'

Legacy response

json
{
  "code": 0,
  "message": "ok",
  "data": {
    "url": "https://cdn.pixapi.ai/generated/image.png"
  }
}

When num is greater than 1, legacy responses may return data.url as an array.