PineRouterDocs
GuidesModelsAPI referenceApps

Create image

POST
/v1/images/generations
AuthorizationBearer <token>

In: header

Request Body

application/json

model?string

The model id, from the Models page.

prompt*string

Text description of the image you want.

n?integer

Number of images, where the model supports it.

size?string

Size of the image, WIDTHxHEIGHT; mapped to the nearest aspect ratio and resolution the model offers.

background?string

Sets transparency for the image background, where the model supports it: transparent, opaque or auto (default). With auto the model picks the best background.

For transparent, use an output format that supports transparency: png (default) or webp.

quality?string

Image quality, where the model supports it.

stream?string
style?string
user?string

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://pinerouter.ai/v1/images/generations" \  -H "Content-Type: application/json" \  -d '{    "model": "nano-banana-pro",    "prompt": "A matte ceramic mug on a beige backdrop, studio light",    "size": "1024x1024"  }'
{
  "data": [
    {
      "url": "https://files.example.com/abc.png"
    }
  ]
}
{
  "error": {
    "code": "",
    "message": "Invalid token (request id: 20261102053704107200635868d9d6m7EOL5JK)",
    "type": "api_error"
  }
}
{
  "error": {
    "code": "",
    "message": "This token has no access to model gpt-5-2 (request id: 20261102053704107200635868d9d6m7EOL5JK)",
    "type": "api_error"
  }
}
{
  "error": {
    "code": "",
    "message": "You have reached the request limit: maximum 60 requests in 1 minutes (request id: 20261102053704107200635868d9d6m7EOL5JK)",
    "type": "api_error"
  }
}
Empty