PhotoGPT Developers
API ReferenceGeneration

Generate images

POST
/images/generation

Triggers an asynchronous image generation job. The response returns a jobId; poll GET /jobs/{id} for status and outputs.

Authorization

BearerAuth
AuthorizationBearer <token>

Developer API key. Send as Authorization: Bearer <api_key>.

In: header

Request Body

application/json

Image generation request. Choose the schema matching modelID.

TypeScript Definitions

Use the request body type in TypeScript.

Generate images with nanobanana, nanobanana-pro, or nanobanana-2.

aspectRatio?string
modelID*string
numImages?integer
options?

Options for this model family. Send only the option group matching modelID.

preset?string

Optional preset tag. The preset will be applied to the image.

prompt*string
referenceImageURLs?array<>

Reference image limits: nanobanana 3; nanobanana-pro/nanobanana-2 14; seedream/seedream-4_5/seedream-5-lite/gpt-image-2 10.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/images/generation" \  -H "Content-Type: application/json" \  -d '{    "aspectRatio": "1:1",    "modelID": "nanobanana",    "numImages": 1,    "options": {      "gemini": {        "imageSize": "1K",        "safetyFilterLevel": "OFF",        "sequentialMode": "disabled"      }    },    "preset": "editorial",    "prompt": "Editorial portrait in warm window light",    "referenceImageURLs": []  }'
{  "result": {    "jobId": "job_123",    "status": "queued"  },  "status": "OK"}
{  "err": "string",  "message": "string",  "result": null,  "status": "NOK"}
{  "err": "string",  "message": "string",  "result": null,  "status": "NOK"}
{  "err": "string",  "message": "string",  "result": null,  "status": "NOK"}
{  "err": "string",  "message": "string",  "result": null,  "status": "NOK"}